Development issue/problem:
I’m trying to create a simple application with FireStore and Google authentication. Problems with the diploma:
Application plug-in: com.android.app
android {compileSdkVersion 27defaultConfig {applicationId myapp.comminSdkVersion 19targetSdkVersion 27versionCode 11versionName 1.1 1testInstrumentationRunner android.support.test.runner.AndroidJUnitRunnermultiDexEnabled true}buildTypes {release {minifyEnabled falseproguardFiles getDefaultProguardFile(‘proguard-android.txt’), ‘proguard-rules.pro’}}}}}
dependencies [
-implementation fileTree(dir: ‘libs’, including: [‘*.jar’])
-implementation ‘com.android.support:appcompat-v7:27.1.1’
-implementation ‘com.android.support.constraint:constraint-layout:1.1.1.3’
androidTestImplementation ‘junit:junit:4.12
androidTestImplementation ‘com.android.support.test:runner:1.0.2’
androidTestImplementation ‘com.android.support.test.espresso:espresso-core:3.0.2’
implementation ‘com.google.firebase:firebase-firestore:17.1.5
Implementation of com.firebaseui:firebase-ui-auth:4.2.0.
}
Application plugin: com.google.gms.google-services
com.google.gms.googleservices.GoogleServicesPlugin
Project Diploma :
Assembly scenario {
Repositories {
google()
jcenter()
}
dependencies {
classpath ‘com.android.tools.build:gradle:3.2.1
Classpath ‘com.google.gms:google-services:4.2.0’.
}
}
Can somebody help me?
How can I solve this problem?
Solution 1:
There are many ready-made answers that do not really solve the problem. Here’s how to solve the problem in the first place:
As you can see in the original logbook, it makes sense to perform the construction in the terminal with the following command:
./gradlew -info mountingDebug
This gives you a list of all the dependencies involved in the conflict. It looks similar (I removed the name of the package to make it a bit more readable):
Help in resolving dependencies : Shows all currently known paths to any version of the dependency: Artifact (groupId=com.google.firebase, artifactId=firebase-iid)
— task/module dep -> [protected by e-mail] —- firebase-analystics:17.2.0 library depend -> [protected by e-mail] —— play-services-measure-api:17.2.0 library depend -> [protected by e-mail].
— task/module dep -> [protected by e-mail] —- firebase-core:17.2.0 library depend -> [protected by e-mail] —— firebase-analytics:17.2.0 library depend -> [protected by e-mail] ——– play-services-measure-api:17.2.0 library depend -> [protected by e-mail].
— task/module dep -> [protected via e-mail] —- play-services-meet-api:17.2.0 library depends -> [protected via e-mail].
— task/module dep -> [protected by email]
— task/module dep -> fire [protected via e-mail] —- firebase-messaging:17.1.0 library depends -> [protected via e-mail] [16.2.0].
— task/module dep -> com.pressenger : [protected via e-mail] —- com.pressenger:sdk:4.8.0 library dependent -> [protected via e-mail] —— firebase-messaging:17.1.0 library dependent -> [protected via e-mail] [16.2.0].
This list will teach you two things:
- Where do you find the controversial depression
- Which versions of the conflicting dependencies have been installed
In my case, a conflicting addiction is a burning id: Either @19.0.0 or @16.2.0.
To fix this, you must explicitly define a high dependency on the wrong Firebase database identifier in your build.gralde.
The top log file shows that there are two cases of using [secure email]. One comes from — task/module dep -> [protected by email], the other comes from a third party library (pressenger). We have no control over a foreign library, so there’s nothing we can do here.
But for another addiction, we have to explain it explicitly with the correct version:
Implementation of com.google.firebase:firebase-maessaging:20.0.0.
Now the building is operational again. Happy ending.
Solution 2:
The problem was that there was a lack of addiction.
Adding com.google.firebase:firebase-auth has solved the problem.
dependencies [
-implementation fileTree(dir: ‘libs’, including: [‘*.jar’])
-implementation ‘com.android.support:appcompat-v7:27.1.1’
-implementation ‘com.android.support.constraint:constraint-layout:1.1.1.3’
androidTestImplementation ‘junit:junit:4.12
androidTestImplementation ‘com.android.support.test:runner:1.0.2’
androidTestImplementation ‘com.android.support.test.espresso:espresso-core:3.0.2’
implementation ‘com.google.firebase:firebase-firestore:17.1.5
// version ‘com.google.firebase:firebase-core:16.0.6’
// version ‘com.google.firebase:firebase-storage:16.0.5’.
implementation ‘com.google.firebase:firebase-auth:16.1.0’ => add this line
implementation ‘com.firebaseui:firebase-ui-auth:4.2.0’
}.
Solution 3:
There is a known bug in Google Services 4.2.0 that can cause this. Reducing version 4.1.0 of Google Services in the build.gradle of your project can solve this problem.
Builds the script { dependencies{classpath ‘com.google.gms:google services:4.1.0’ // reduced from 4.2.0}}} }.
Solution 4:
A bug regarding Google’s services has finally been fixed in version 4.3.3.
So you can use both version 4.3.3 and the latest version (see here).
classpath ‘com.google.gms:google-services:4.3.3’ // or the latest version
or downgrade to 4.1.0
Classpath ‘com.google.gms:google-services:4.1.0’.
Solution No 5:
I have added the latest version of the firebase messages for build.gradle (module: application) to my project and the problem is solved.
Implementation of com.google.firebase:firebase-maessaging:20.0.0.
Solution No 6:
In your app/build.gradle the lemon color can be locked, depending on the dependencies in Android Studio, as shown below,
These (lemon-coloured blocks) mean that this is not the latest version of the dependency. Just move over each block and the IDE (Android Studio) will show you the songs you want to customize.
Solution No 7:
Upgrading all my Google Play Services libraries to the latest versions of ALL modules has solved this problem for me. I do not see that you have libraries of Google Play services, but I want to leave that answer here for those who may find it useful.
Solution No 8:
My project worked well (no construction problems). Suddenly I get this mistake
The permitted dependency of the Google Play Services Library depends on the other in the exact version.
I realized it was because I was building offline.
If someone gets the same mistake, make sure you’re building offline.
Solution No 9:
Thanks, but unfortunately it didn’t really work out. I also had to add the following to my build.class (module:app).
Implementation com.google.android.gms:play-services-flags:16.0.1Implementation com.google.android.gms:play-services-flags:16.0.1.
Solution No 10:
The problem was solved after I updated this library in the build.gradle of my project:
Classpath ‘com.google.gms:google-services:4.3.3’.
in the build.gradle module application:
com.google.firebase:firebase-core:17.3.0′
version ‘com.google.firebase:firebase messages:20.1.5’.
Then use the Clean menu in Android Studio.
Good luck!
Related Tags:
play-services-vision-common,could not resolve com google android gms play-services-base:(15.0 1 16.0 0),com google android gms play-services 12.0 1,android a resolved google play-services library dependency depends on another at an exact version,googleservices { disableversioncheck = false },googleservices.disableversioncheck = true,google play services library error,please apply google-services plugin at the bottom of the build file,firebase dependencies,implementation 'com google android gms play-services error,com.google.gms:google-services version,play-services-ads-identifier