Could not parse the Android Application Module's Gradle config ,While connecting to Firebase - firebase

I am getting this error ,While connecting the app to firebase from the firebase assistant in Android Studio.
Error message -Could not parse the Android Application Module's Gradle config. Resolve gradle build issues and/or resync.
I tried every posted Solution from Stack overflow and had watched many you tube videos ,
even cleared the gradle caches and also Updated the IDE.
Even There is No error or Warning in my Gradle build files.
>build.gradle(app)
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.project.PlacementInfo"
minSdk 25
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildFeatures {
dataBinding = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
compileSdkVersion 32
buildToolsVersion '32.0.0'
}
dependencies {
implementation 'com.google.android.gms:play-services-location:20.0.0'
implementation 'com.google.firebase:firebase-analytics'
implementation platform('com.google.firebase:firebase-bom:30.2.0')
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.firebase:firebase-database:20.0.5'
testImplementation 'junit:junit:'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
>build.gradle(Project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.4"
classpath "com.android.tools.build:gradle:4.2.2"
classpath 'com.google.gms:google-services:4.3.13'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

Issue is resolved.
Removed this line:
testImplementation 'junit:junit:'
from build.gradle (app) and also downgrade the compile SDK from 32 to 31
and added following line:
android.suppressUnsupportedCompileSdk=32
in the gradle's properties(Project)

well here you have to add classpath in gradle level 1
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.2"
classpath 'com.google.gms:google-services:4.3.10'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url "https://github.com/jitsi/jitsi-maven-repository/raw/master/releases"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
then you have to add apply plugin in gradle level 2
below dependencies
plugins {
id 'com.android.application'
}
android {
compileSdkVersion 31
defaultConfig {
applicationId "com.example.chatapp"
minSdkVersion 23
targetSdkVersion 31
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation platform('com.google.firebase:firebase-bom:29.2.1')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-auth:21.0.1'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.firebase:firebase-firestore:24.1.0'
implementation 'com.google.firebase:firebase-storage:20.0.1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.firebaseui:firebase-ui-firestore:6.2.1'
implementation 'com.firebaseui:firebase-ui-database:8.0.0'
implementation 'com.google.firebase:firebase-database:20.0.4'
implementation 'com.google.firebase:firebase-messaging:23.0.5'
implementation ('org.jitsi.react:jitsi-meet-sdk:3.10.2') { transitive = true }
implementation 'com.android.volley:volley:1.2.0'
implementation 'com.google.firebase:firebase-appcheck-safetynet:16.0.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
apply plugin: 'com.google.gms.google-services'
source [here]

Related

android studio is not connecting with firebase

I am trying to setup Firebase in my android project.
Could not parse the Android Application Module's Gradle config. Resolve gradle build issues and/or resync.
Been looking for fixes online, most of them are removing jcenter() in build.gradle file. I don't have jcenter() or any other repository in my build.gradle.
Heres my build gradle project:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.1.1' apply false
id 'com.android.library' version '7.1.1' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Build gradle module (app):
plugins {
id 'com.android.application'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.pabhelhasan.autowebpagerefresher2022"
minSdk 22
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildToolsVersion '32.0.0'
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.6.0-alpha01'
implementation 'com.getbase:floatingactionbutton:1.10.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
Try to go to tools tab and firebase section, that will open chrome console.firebase.google.com and u connect it automatically with all the modules and imports.
Because gradle has changed and firebase didn't update the instructions, so it will not work they way you tried.

Task :app:processDebugMainManifest FAILED when I add dependency implementation 'com.mesibo.api:mesibo:1.5.2'

I started a new project in Android Studio. Empty project compiles without problem.
As soon as I add implementation 'com.mesibo.api:mesibo:1.5.2' to dependencies, I get the following error:
[com.android.support:animated-vector-drawable:28.0.0] C:\Users\nenad\.gradle\caches\transforms-2\files-2.1\2321a6ddb441101d2687f6656a3ad88a\animated-vector-drawable-28.0.0\AndroidManifest.xml Warning:
Package name 'android.support.graphics.drawable' used in: com.android.support:animated-vector-drawable:28.0.0, com.android.support:support-vector-drawable:28.0.0.
[androidx.versionedparcelable:versionedparcelable:1.1.1] C:\Users\nenad\.gradle\caches\transforms-2\files-2.1\7db5a34e07a8e6159e7e1ab900eaa2f0\versionedparcelable-1.1.1\AndroidManifest.xml Warning:
Package name 'androidx.versionedparcelable' used in: androidx.versionedparcelable:versionedparcelable:1.1.1, com.android.support:versionedparcelable:28.0.0.
D:\AndroidStudioProjects\LiburnijaVoIP\app\src\main\AndroidManifest.xml:24:18-86 Error:
Attribute application#appComponentFactory value=(androidx.core.app.CoreComponentFactory) from [androidx.core:core:1.5.0] AndroidManifest.xml:24:18-86
is also present at [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 value=(android.support.v4.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:5:5-22:19 to override.
My build.gradle is as follows:
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "hr.grafiknet.liburnijavoip"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation platform('com.google.firebase:firebase-bom:28.2.1')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.mesibo.api:mesibo:1.5.2'
}
Those errors are dure to mixing AndroidX/Support. Enable jetifier to resolve. Add following lines to your gradle.properties:
android.useAndroidX=true
android.enableJetifier=true

error "No such property: applicationVariants for class: java.lang.String" when connecting the plugin "com.google.gms.google-services"

I am using the latest version of Android Studio and all plugins. I am trying to connect android app to firebase console. Successfully downloaded google-services.json file and added to module root directory. Added lines "classpath 'com.google.gms: google-services: 4.3.3" and "apply plugin:' com.google.gms.google-services'" to the build.gradle files.
build.gradle project level:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath 'com.google.gms:google-services:4.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
build.gradle app level:
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "app"
minSdkVersion 16
targetSdkVersion 29
versionCode 42
versionName "16.0.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
lintOptions {
checkReleaseBuilds false
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
implementation 'androidx.navigation:navigation-fragment:2.3.0'
implementation 'androidx.navigation:navigation-ui:2.3.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.android.support.constraint:constraint-layout:2.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
// CloudPayments SDK
implementation 'ru.cloudpayments.android:sdk:1.0.5'
// add the Firebase SDK for Google Analytics
implementation 'com.google.firebase:firebase-iid:20.2.4'
implementation 'com.google.firebase:firebase-messaging:20.2.4'
implementation 'com.google.firebase:firebase-analytics:17.5.0'
}
apply plugin: 'com.google.gms.google-services'
When synchronizing the project, I get the error
No such property: applicationVariants for class: java.lang.String
which refers to the line "apply plugin: 'com.google.gms.google-services'" in build.gradle app level.
I ask for advice on how you can fix this error.
I solved this by checking all my gradle files and found out that, the gradle.properties file has some errors in it. I don’t know how they got there. But I replaced the file contents by copying the contents from a fresh android project.
Solved

Please help me CloudFirestorePlugin.java uses or overrides a deprecated API.( unchecked or unsafe operations.)

I've tried everything i see on the net to solve this problem for a day.Downgrade versions add something in gradle or rebuild etc. in short i am tring to use firebase.
For every solution i try, the error changes, but it doesn't end. Here is my mysterious gradles and pubspec. in android/app/gradle:
apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.app"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
signingConfig signingConfigs.debug
}
}
}
dependencies {
implementation 'com.google.firebase:firebase-analytics:17.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
in android/gradle
...
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
...
in pubspech.yaml:
path_provider: ^1.2.0
sembast: ^2.0.1+2
flutter_bloc: ^0.21.0
equatable: ^0.5.1
cloud_firestore: ^0.12.9+3
I would be grateful if someone help i also tried app plugin google service or change google services to 3.2.1 or minsdkversions..
i found the answer for my case tried all of them, but it fixed when targetsdk and min sdk used same time
Flutter: FlutterFirebaseInstanceIDService.java uses or overrides a deprecated API

Firebase Admin in backend module triggers "All firebase libraries must be either above or below 14.0.0

I have an android studio project that includes one module for my app and one module for my backend.
According to the documentation I can use the following code to bring all the build endpoint libraries to my app module:
endpointsServer project(path: ':backend', configuration: 'endpoints')
In my backend module gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.google.cloud.tools:endpoints-framework-gradle-plugin:1.0.3'
classpath 'com.google.cloud.tools:appengine-gradle-plugin:1.3.5'
}
}
repositories {
jcenter(); }
apply plugin: 'java' apply plugin: 'war'
apply plugin: 'com.google.cloud.tools.appengine'
apply plugin: 'com.google.cloud.tools.endpoints-framework-server'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
dependencies {
implementation 'com.google.endpoints:endpoints-framework:2.0.14'
implementation 'javax.servlet:servlet-api:2.5'
implementation 'javax.inject:javax.inject:1'
implementation 'com.google.firebase:firebase-admin:5.11.0'
}
appengine {
deploy {
stopPreviousVersion = false
promote = false
version = '1'
project = 'project-name'
} }
In my app module gradle:
apply plugin: 'com.android.application'
apply plugin: 'com.google.cloud.tools.endpoints-framework-client'
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
mavenCentral()
jcenter()
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
classpath 'com.google.cloud.tools:endpoints-framework-gradle-plugin:1.0.2'
}
}
apply plugin: 'io.fabric'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "appID"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1"
multiDexEnabled = true
resConfigs "en", "fr"
}
dexOptions {
javaMaxHeapSize "4g"
preDexLibraries = false
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
zipAlignEnabled true
debuggable false
}
debug {
signingConfig null
}
}
}
repositories {
flatDir {
dirs 'libs'
}
mavenCentral()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
implementation('com.crashlytics.sdk.android:crashlytics:2.9.2#aar') {
transitive = true;
}
implementation('com.firebaseui:firebase-ui-auth:3.3.1')
implementation 'com.google.firebase:firebase-core:15.0.2'
endpointsServer project(path: ':backend', configuration: 'endpoints')
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'com.google.api-client:google-api-client-android:1.23.0'
implementation 'com.google.http-client:google-http-client-android:1.23.0'
implementation 'com.google.http-client:google-http-client-gson:1.23.0'
implementation 'com.android.support:support-v4:27.1.0'
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:design:27.1.0'
implementation 'com.google.firebase:firebase-messaging:15.0.2'
implementation 'com.google.android.gms:play-services-gcm:15.0.0'
implementation 'com.google.firebase:firebase-auth:15.1.0'
implementation 'com.firebase:firebase-jobdispatcher-with-gcm-dep:0.8.5'
testImplementation 'junit:junit:4.12'
}
configurations {
all {
exclude module: 'httpclient'
}
}
apply plugin: 'com.google.gms.google-services'
The problem is that when gradle is executing is causing the following error:
All firebase libraries must be either above or below 14.0.0
I have already looked at:
How to add firebase-admin to my android project?
and
android firebase admin sdk error 'All firebase libraries must be either above or below 14.0.0' [duplicate]
But both of them are trying to add the admin sdk on client side. Which is not why I am trying to do.
So how can I tell gradle that this are two different modules or how can I exclude the admin sdk from coming to my app module when I am using:
endpointsServer project(path: ':backend', configuration: 'endpoints')

Resources