【发布时间】:2018-05-04 03:31:03
【问题描述】:
我的应用程序在调试模式下的模拟器上运行良好。当我尝试在设备上使用签名的 APK 或在模拟器上以发布模式运行它时,使用:
react-native run-android --variant=release
它只是给出一个空白的白色屏幕并且不加载。
我正在使用 React-Native-Navigation 和 React-Native-Firebase,这可能会或可能不会导致问题。
我确实看到的一个错误与我认为的 Firebase 有关:
W/GooglePlayServicesUtil:Google Play 服务已过期。需要 11717000 但发现 10298470 11-20 11:24:04.624 16106-16106/? W/FA:
failed to send app launch 看起来确实不祥。
编辑:在我的设备上运行发行版时,我不确定上述错误是否真的导致了空白屏幕。此消息显示在模拟器中,但我的应用程序在模拟器上运行。在我的设备上,我看到 Google Play 服务的版本是 11.7.46,我相信它应该可以正常工作。
还有什么会导致我的应用仅在发布时出现空白屏幕?
编辑 2:
这次我发现了另一个错误(我已经降级到旧版本的 react-native-firebase 2.2)
11-25 12:11:07.278 5281-5295/com.spectrum E/FirebaseCrash:加载崩溃报告失败 com.google.android.gms.internal.mn: .com.google.android.gms.dynamite.DynamiteModule$zzc: 远程加载失败。未找到本地回退。 在 com.google.android.gms.internal.ml.zzFk(未知来源) 在 com.google.firebase.crash.zzc.zzFi(未知来源) 在 java.util.concurrent.FutureTask.run(FutureTask.java:237) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 在 java.lang.Thread.run(Thread.java:818) 原因:com.google.android.gms.dynamite.DynamiteModule$zzc:远程加载失败。未找到本地回退。 ...
编辑 3:
这里是来自 app.gradle 的依赖项:
dependencies {
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:25.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
compile project(':react-native-navigation')
// RNFirebase required dependencies
compile(project(':react-native-firebase')) {
transitive = false
}
compile "com.google.firebase:firebase-core:11.0.4"
// RNFirebase optional dependencies
compile "com.google.firebase:firebase-crash:11.0.4"
compile "com.google.firebase:firebase-messaging:11.0.4"
// If you are receiving Google Play API availability issues, add the following dependency
// compile "com.google.android.gms:play-services-base:11.0.4"
}
【问题讨论】:
-
请发布您的项目 build.gradle
标签: android firebase react-native google-play-services react-native-navigation