安装react-native-fbsdk

时间:2019-04-15 17:44:38

标签: android-studio react-native build.gradle gradlew react-native-fbsdk

在安装react-native-fbsdk并运行./gradlew build时出现一些错误。

  

错误:所有com.android.support库必须使用完全相同的版本规范(混合版本可能导致运行时崩溃)。找到版本27.1.1、27.0.2。示例包括com.android.support:animated-vector-drawable:27.1.1和com.android.support:cardview-v7:27.0.2 [GradleCompatible]

我对android / app / build.gradle的依赖是

dependencies {

    implementation project(':react-native-svg')
    implementation project(':react-native-google-signin')
    implementation project(':react-native-firebase')

    implementation(project(':react-native-firebase')) {
       transitive = false
    }
    implementation project(':react-native-svg')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:23.0.1"
    implementation "com.facebook.react:react-native:+"  // From node_modules
    implementation project(':react-native-google-signin')
    implementation "com.google.android.gms:play-services-base:15.0.0"
    implementation "com.google.firebase:firebase-core:15.0.2"
    implementation "com.google.firebase:firebase-messaging:15.0.2"
    implementation "com.google.firebase:firebase-auth:16.1.0"
    implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
    implementation project(':react-native-fbsdk')

}

和我在android / build.gradle中的构建脚本:

buildscript {

    ext {
        buildToolsVersion = "27.0.3"
        minSdkVersion = 16
        compileSdkVersion = 27
        targetSdkVersion = 26
        supportLibVersion = "27.1.1"
        googlePlayServicesAuthVersion = "15.0.1"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.2'
        classpath 'com.google.gms:google-services:3.2.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }

}

我在this answer中找到了解决方案,但是当我在依赖项上添加com.android.support:cardview-v7:27.1.1时,我也遇到了同样的问题。

怎么了?

0 个答案:

没有答案