将 react-native firebase 插件添加到我的 react native 应用程序后,我的应用程序在启动时崩溃。
我正在使用 RN 0.51、gradle 2.2.3 和 2.14.1
dependencies {
compile project(':react-native-config')
compile project(':react-native-code-push')
compile (project(':react-native-camera')) {
exclude group: "com.android.support"
}
编译“com.android.support:exifinterface:26.1.0”
compile project(':react-native-beacons-manager')
//compile project(':react-native-google-places')
compile project(':react-native-device-info')
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:multidex:1.0.1'
compile project(':react-native-fcm')
compile 'com.google.firebase:firebase-core:10.0.1' //this decides your firebase SDK version
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile project(':react-native-bluetooth-status')
compile project(':react-native-beacons-manager')
compile project(':react-native-vector-icons')
}
这些是我的项目中的插件。在新的 gradle 版本中,我所有的插件都过时了,所以我降级了 gradle。我尝试了一切,但我的应用程序仍然崩溃并且我遇到了同样的错误。请帮助我..谢谢
这是我的错误日志
FATAL EXCEPTION: main Process: com.spazebudenterprise, PID: 8089
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/internal/zzbp;
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:6057)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5628)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5567)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1625)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:203)
at android.app.ActivityThread.main(ActivityThread.java:6339)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1084)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:945)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.internal.zzbp" on path: DexPathList[[zip file "/data/app/com.spazebudenterprise-1/base.apk"],nativeLibraryDirectories=[/data/app/com.spazebudenterprise-1/lib/arm, /data/app/com.spazebudenterprise-1/base.apk!/lib/armeabi-v7a, /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)