React Native问题: app:preDebugBuild


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:preDebugBuild'.
> Android dependency 'com.android.support:appcompat-v7' has different version for the compile (25.0.0) and runtime (27.0.2) classpath. You should manually set the same version via DependencyResolution

 

处理:

in android/app/build.gradle:

dependencies {
    compile project(':react-native-linear-gradient')
    compile project(':react-native-native-video-player')
    compile project(':react-native-push-notification')
    compile project(':react-native-photo-view')
    compile ('com.google.android.gms:play-services-gcm:10.0.1')
    // See https://stackoverflow.com/questions/44190829/facebook-sdk-android-error-building/44190896#44190896
    compile(project(':react-native-fbsdk')){
      exclude(group: 'com.facebook.android', module: 'facebook-android-sdk')
    }
    compile "com.facebook.android:facebook-android-sdk:4.22.1"
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:+"  // From node_modules
    compile "com.android.support:appcompat-v7:27.0.2"  //此行为处理问题所增加
}

增加最后一行


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM