react-native-google-signin / google-signin

Google Sign-in for your React Native applications
https://react-native-google-signin.github.io/
MIT License
3.23k stars 880 forks source link

All firebase libraries must be either above or below 14.0.0 #385

Closed ChaoTzuJung closed 6 years ago

ChaoTzuJung commented 6 years ago

I just follow the android guide but i got the error !

Build file '/Users/alan2305/dougo/android/app/build.gradle' line: 204

* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.google.gms.google-services']
   > All firebase libraries must be either above or below 14.0.0

I find any method to solve my problem but it still no work And the document ask me to replace

distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-all.zip

instead of

distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip

But my version is

distributionUrl=https\://services.gradle.org/distributions/gradle-4.4--all.zip

So if I change version to 2.14, it will crash

Do anybody know how to fix it ?

This is my app/build.gradle

dependencies {
    compile project(':react-native-google-signin')
    //(For react-native-google-signin) Update android/app/build.gradle with 153~159
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:23.0.1"
    implementation "com.facebook.react:react-native:+"
    // implementation project(':react-native-google-signin'){
    //     exclude group: "com.google.android.gms" // very important
    // }
    compile(project(":react-native-google-signin")){         
        exclude group: "com.google.android.gms" // very important
    }
    implementation "com.google.android.gms:play-services-auth:9.2.1" // should be at least 9.0.0

    implementation project(':react-native-fbsdk')

    implementation(project(':react-native-firebase')) {
        transitive = false
    }

    // RNFirebase required dependencies
    implementation "com.google.firebase:firebase-core:15.0.2" // 15.0.0 -> 15.0.2 failed for task ':app:transformClassesWithMultidexlistForDebug'.
    implementation "com.google.android.gms:play-services-base:15.0.1" // 15.0.0 -> 15.0.1

    // RNFirebase optional dependencies
    implementation "com.google.firebase:firebase-ads:15.0.0"
    implementation "com.google.firebase:firebase-auth:15.0.0"
    implementation "com.google.firebase:firebase-config:15.0.2" // 15.0.0 -> 15.0.2 failed for task ':app:transformClassesWithMultidexlistForDebug'.
    implementation "com.google.firebase:firebase-database:15.0.0"
    implementation "com.google.firebase:firebase-invites:15.0.1"
    implementation "com.google.firebase:firebase-firestore:16.0.0" // 15.0.0 -> 16.0.0 failed for task ':app:transformClassesWithMultidexlistForDebug'.
    implementation "com.google.firebase:firebase-messaging:15.0.2" // 15.0.0 -> 15.0.2 failed for task ':app:transformClassesWithMultidexlistForDebug'.
    implementation "com.google.firebase:firebase-perf:15.1.0"
    implementation "com.google.firebase:firebase-storage:15.0.2" // // 15.0.0 -> 15.0.2
    implementation('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') {
        transitive = true
    }

    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:27.0.2"
    implementation "com.facebook.react:react-native:+"  // From node_modules
    implementation "com.android.support:multidex:1.0.1" // Degug failed for task ':app:transformClassesWithMultidexlistForDebug -- Enable Multidex for Apps with Over 64K Methods
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

apply plugin: 'com.google.gms.google-services'
jaschaio commented 6 years ago

Change this line: implementation "com.google.android.gms:play-services-auth:9.2.1

To: implementation "com.google.android.gms:play-services-auth:15.0.0"

had the same error. That resolved it

AndreiCalazans commented 6 years ago

Please follow @jaschaio suggestion, if problems persist feel free to reopen the issue thank you @jaschaio

d-gubert commented 6 years ago

Is this behavior documented somewhere? I'm somewhat busy right now, but will be back and try to update the documentation to include this instructions when using the library with Gradle 4.4

ps06756 commented 6 years ago

I am facing same issue: Even though I am using implementation "com.google.android.gms:play-services-auth:15.0.0"

ps06756 commented 6 years ago

This is the android/app/build.gradle, I am using.

dependencies {
    compile project(':react-native-fs')
    compile project(':react-native-image-resizer')
    compile project(':react-native-image-picker')
    compile project(':react-native-fetch-blob') 
    compile project(':react-native-fcm')
    compile 'com.google.firebase:firebase-core:10.0.1' //this decides your firebase SDK version
    compile 'com.google.firebase:firebase-messaging:10.0.1'
    compile project(':react-native-vector-icons')
    compile project(':react-native-fcm')
    compile project(':react-native-webview-bridge')
    compile project(':react-native-svg')
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:+"  // From node_modules
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:23.0.1"
    implementation "com.facebook.react:react-native:+"
    implementation(project(":react-native-google-signin")){         
        exclude group: "com.google.android.gms" // very important
    }
    implementation "com.google.android.gms:play-services-auth:15.0.0" // should be at least 15.0.0 to work with most recent APIS
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

apply plugin: 'com.google.gms.google-services'
ailsoncgt commented 6 years ago

I don't know about react but in ionic I fix this issue doing: 1 - go to file platforms/android/app/build.gradle and change the line

compile "com.google.android.gms:play-services-location:15.+" to: compile "com.google.android.gms:play-services-location:11.0.1"

2 - file platform/android/project.properties and change the line: cordova.system.library.1=com.google.android.gms:play-services-location:15.+ to: cordova.system.library.1=com.google.android.gms:play-services-location:11.0.1

ChrisKG32 commented 5 years ago

If anyone is still struggling with this. I found an issue that isn't mentioned here that caused this error message. Here is what I found:

  implementation 'com.google.android.gms:play-services-gcm:15.0.1'
  implementation 'com.google.android.gms:play-services-analytics:16.0.1'
  implementation 'com.google.android.gms:play-services-maps:15.0.1'
  implementation 'com.google.android.gms:play-services-auth:15.0.1'
  implementation 'com.google.android.gms:play-services-location:15.0.1'
  implementation 'com.google.android.gms:play-services-ads:15.0.1'

For some reason implementation 'com.google.android.gms:play-services-analytics:16.0.1' is 16.0.1 - This is a typo, and if you correct it to 15.0.1 it will prevent the error.

galladivya commented 4 years ago

My Android Module level gradle file`apply plugin: 'com.android.application'

apply plugin: 'io.fabric' apply plugin: 'com.google.firebase.firebase-perf'

android { compileSdkVersion 26 buildToolsVersion '28.0.3' defaultConfig { applicationId "com.bodaty.deyaPay.deyaPay9" minSdkVersion 19 targetSdkVersion 26 versionCode 15 versionName "2.4" multiDexEnabled true testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } }

dependencies { implementation 'com.google.firebase:firebase-crash:11.4.2' implementation fileTree(include: ['*.jar'], dir: 'libs') androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) implementation 'com.google.firebase:firebase-perf:11.4.2' implementation 'com.squareup.okhttp3:okhttp:3.10.0' implementation 'com.google.code.gson:gson:2.8.2' implementation 'com.squareup.retrofit2:retrofit:2.3.0' implementation 'com.squareup.retrofit2:converter-gson:2.3.0' implementation 'com.google.firebase:firebase-messaging:11.4.2' implementation 'com.google.firebase:firebase-messaging:11.4.2' implementation 'com.android.support:appcompat-v7:26.+' implementation 'com.android.support.constraint:constraint-layout:1.0.2' implementation 'com.google.firebase:firebase-core:11.4.2' implementation 'com.google.firebase:firebase-database:11.4.2' implementation 'com.google.firebase:firebase-firestore:11.4.2' implementation 'com.google.firebase:firebase-auth:11.4.2' implementation 'com.android.support:design:26.+' implementation 'com.android.support:cardview-v7:26.1.0' implementation 'com.android.support:support-vector-drawable:26.+' implementation 'com.googlecode.libphonenumber:libphonenumber:8.7.0' implementation 'com.android.support:support-v4:26.+' implementation 'com.stripe:stripe-android:5.1.0' implementation 'de.hdodenhof:circleimageview:2.2.0' implementation 'com.google.android.gms:play-services-wallet:11.4.2' implementation 'com.crashlytics.sdk.android:crashlytics:2.9.6' implementation 'com.android.support:recyclerview-v7:26.0.0' testImplementation 'junit:junit:4.12' implementation 'com.stripe:stripe-android-issuing-push-provisioning:1.0.3' implementation 'com.google.android.gms:play-services-tapandpay:17.0.1' } apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.android.gms.strict-version-matcher-plugin' `

I'm facing the same issue.Can anyone look to help?