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" //此行为处理问题所增加 }
增加最后一行