我的应用已成功构建,但无法打开我的应用程序崩溃。我检查了logcat,看到下面提到的错误。
我的android / gradle.build文件包含classpath' com.android.tools.build:gradle:3.1.2'和classpath' com.google.gms:google-services:3.2.1'
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/zzuw;
at com.google.android.gms.internal.zzlx.<init>(Unknown Source)
at com.google.android.gms.internal.zzlx.<init>(Unknown Source)
at com.google.android.gms.ads.InterstitialAd.<init>(Unknown Source)
at com.sbugert.rnadmob.RNAdMobInterstitialAdModule.<init>(RNAdMobInterstitialAdModule.java:48)
at com.sbugert.rnadmob.RNAdMobPackage.createNativeModules(RNAdMobPackage.java:18)
at com.facebook.react.NativeModuleRegistryBuilder.processPackage(NativeModuleRegistryBuilder.java:106)
at com.facebook.react.ReactInstanceManager.processPackage(ReactInstanceManager.java:1171)
at com.facebook.react.ReactInstanceManager.processPackages(ReactInstanceManager.java:1141)
at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1083)
at com.facebook.react.ReactInstanceManager.access$900(ReactInstanceManager.java:113)
at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:920)
at java.lang.Thread.run(Thread.java:761)
Caused by: java.lang.ClassNotFoundException: com.google.android.gms.internal.zzuw
at java.lang.VMClassLoader.findLoadedClass(Native Method)
at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:742)
at java.lang.ClassLoader.loadClass(ClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 12 more
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/zzuy;
... 12 more
Caused by: java.lang.ClassNotFoundException: com.google.android.gms.internal.zzuy
at java.lang.VMClassLoader.findLoadedClass(Native Method)
at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:742)
at java.lang.ClassLoader.loadClass(ClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 12 more
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/zzev;
... 12 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.internal.zzev" on path: DexPathList[[zip file "/data/app/com.sixdee.marketplace-2/base.apk"],nativeLibraryDirectories=[/data/app/com.sixdee.marketplace-2/lib/x86, /data/app/com.sixdee.marketplace-2/base.apk!/lib/x86, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 12 more
Heres我的android / app / gradle.build:
dependencies {
implementation(project(':react-native-firebase')) {
transitive = false
}
implementation project(':react-native-image-picker')
implementation project(':react-native-fast-image')
implementation project(':react-native-admob')
implementation project(':react-native-google-analytics-bridge')
implementation project(':react-native-onesignal')
implementation project(':react-native-fbsdk')
implementation project(':react-native-blur')
implementation project(':react-native-linear-gradient')
implementation project(':react-native-vector-icons')
implementation project(':react-native-device-info')
implementation project(':react-native-geocoder')
implementation project(':react-native-image-resizer')
implementation 'com.facebook.android:facebook-android-sdk:[4.22.1)'
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.android.support:multidex:1.0.1'
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:27.1.1"
implementation 'com.google.android.gms:play-services-ads:15.0.0'
implementation ("com.facebook.react:react-native:0.54.4"){force = true}
//compile "com.facebook.react:react-native:+" // From node_modules
//classpath 'com.google.gms:google-services:3.0.0'
}
apply plugin: 'com.google.gms.google-services'