Issue
I am getting this error:
Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at href="https://bintray.com/android/android-tools/com.google.gms.google-services/" rel="nofollow noreferrer">https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 16.0.1.
I think the error I am getting is due to implementing com.google.firebase:firebase-messaging:17.1.0
because if I remove it, building is successful. But on trying version 16.0.1 of com.google.android.gms
for messaging, I get this message:
Unable to resolve error
I think the error means that com.google.firebase:firebase-messaging:16.0.1
is unavailable. How can my problem be solved ?
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 27
defaultConfig {
applicationId "in.anamika.anamika"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
implementation 'com.googlecode.libphonenumber:libphonenumber:8.9.7'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:design:27.1.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation('com.crashlytics.sdk.android:crashlytics:2.7.1@aar') {
transitive = true
}
implementation 'com.google.firebase:firebase-messaging:17.1.0'
implementation 'com.google.firebase:firebase-core:16.0.1'
}
apply plugin: 'com.google.gms.google-services'
Solution
You need to search over your native dependecies in node_modules for their build.gradle and in this files look for dependecies starting with com.google.android.gms or com.google.firebase. After that you need to exclude these internal dependecies and force use of same version everywhere.
Answered By - Mayank Bhatnagar
Answer Checked By - Mildred Charles (JavaFixing Admin)