我在运行 npx react-native run-android
时遇到以下错误:
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':react-native-push-notification:compileDebugAidl'.
> Could not resolve all task dependencies for configuration ':react-native-push-notification:debugCompileClasspath'.
> Could not find com.google.android.gms:play-services-cloud-messaging:12.0.1.
Required by:
project :react-native-push-notification > com.google.firebase:firebase-messaging:21.0.1
project :react-native-push-notification > com.google.firebase:firebase-iid:21.0.1
> Could not find com.google.android.gms:play-services-stats:12.0.1.
Required by:
project :react-native-push-notification > com.google.firebase:firebase-messaging:21.0.1
project :react-native-push-notification > com.google.firebase:firebase-iid:21.0.1
我正在使用:
"react-native-push-notification": "3.5.2", "react-native": "0.61.5",
我的根 build.gradle
buildscript {
ext {
buildToolsVersion = "29.0.2"
minSdkVersion = 21
compileSdkVersion = 29
targetSdkVersion = 29
googlePlayServicesVersion = "12.0.1"
firebaseVersion = "12.0.1"
}
repositories {
google()
jcenter()
}
dependencies {
classpath('com.android.tools.build:gradle:3.5.3')
classpath 'com.google.gms:google-services:4.3.3' // Google Services plugin
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
我的应用程序/build.gradle:
dependencies {
implementation project(':react-native-vector-icons')
implementation project(':react-native-minimize')
implementation project(':react-native-sqlite-storage')
implementation project(':react-native-exit-app')
implementation project(':react-native-splash-screen')
implementation project(':react-native-config')
implementation 'com.android.support:multidex:1.0.3'
implementation project(':jail-monkey')
implementation project(':react-native-art')
implementation ("com.google.android.gms:play-services-gcm:12.0.1") {
force = true
}
implementation ("com.google.firebase:firebase-messaging:12.0.1") {
force = true
}
implementation project(':react-native-randombytes')
implementation project(':react-native-push-notification')
implementation project(':react-native-i18n')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:+" // From node_modules
}
怎么了?我该如何解决?