我的发行版APK在安装后首次启动时立即崩溃。第二次发射以后,它不会崩溃。使用react-native run-android进行调试不会导致任何崩溃。
安装后(崩溃发生时)发布应用程序首次启动的Logcat
我认为当日志抛出致命异常时崩溃开始:mqt_native_modules
01-24 18:11:54.107 4143 4323 W BroadcastQueue: Permission Denial: receiving Intent { act=com.android.launcher3.action.LAUNCH flg=0x10 pkg=com.google.android.gms (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$GmsExternalReceiver requires com.android.launcher3.permission.RECEIVE_LAUNCH_BROADCASTS due to sender com.google.android.googlequicksearchbox (uid 10040)
01-24 18:11:54.252 20736 20757 W DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
01-24 18:11:54.269 20736 20759 W DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
01-24 18:11:54.278 5106 5120 W ResourceType: ResTable_typeSpec entry count inconsistent: given 467, previously 1317
01-24 18:11:54.473 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTGroupViewManager
01-24 18:11:54.474 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTGroupShadowNode
01-24 18:11:54.476 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTShapeViewManager
01-24 18:11:54.476 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTShapeShadowNode
01-24 18:11:54.478 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTTextViewManager
01-24 18:11:54.478 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTTextShadowNode
01-24 18:11:54.479 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.checkbox.ReactCheckBoxManager
01-24 18:11:54.482 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.uimanager.LayoutShadowNode
01-24 18:11:54.486 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.picker.ReactDialogPickerManager
01-24 18:11:54.491 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.drawer.ReactDrawerLayoutManager
01-24 18:11:54.494 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.picker.ReactDropdownPickerManager
01-24 18:11:54.495 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollViewManager
01-24 18:11:54.496 5106 5120 W ResourceType: ResTable_typeSpec entry count inconsistent: given 14, previously 15
01-24 18:11:54.497 5106 5120 W ResourceType: ResTable_typeSpec entry count inconsistent: given 1381, previously 1386
01-24 18:11:54.497 5106 5120 W ResourceType: ResTable_typeSpec entry count inconsistent: given 1357, previously 1359
01-24 18:11:54.497 5106 5120 W ResourceType: ResTable_typeSpec entry count inconsistent: given 205, previously 984
01-24 18:11:54.499 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollContainerViewManager
01-24 18:11:54.501 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.ReactProgressBarViewManager
01-24 18:11:54.502 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.ProgressBarShadowNode
01-24 18:11:54.504 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactScrollViewManager
01-24 18:11:54.508 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.slider.ReactSliderManager
01-24 18:11:54.509 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.slider.ReactSliderManager$ReactSliderShadowNode
01-24 18:11:54.510 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager
01-24 18:11:54.512 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager$ReactSwitchShadowNode
01-24 18:11:54.512 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.toolbar.ReactToolbarManager
01-24 18:11:54.516 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.webview.ReactWebViewManager
01-24 18:11:54.520 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.swiperefresh.SwipeRefreshLayoutManager
01-24 18:11:54.523 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTSurfaceViewManager
01-24 18:11:54.524 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTSurfaceViewShadowNode
01-24 18:11:54.525 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageViewManager
01-24 18:11:54.525 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageShadowNode
01-24 18:11:54.527 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.image.ReactImageManager
01-24 18:11:54.530 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.ReactModalHostManager
01-24 18:11:54.532 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.ModalHostShadowNode
01-24 18:11:54.532 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactRawTextManager
01-24 18:11:54.533 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactRawTextShadowNode
01-24 18:11:54.535 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputManager
01-24 18:11:54.539 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputShadowNode
01-24 18:11:54.541 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactTextViewManager
01-24 18:11:54.543 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactTextShadowNode
01-24 18:11:54.543 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.view.ReactViewManager
01-24 18:11:54.550 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.viewpager.ReactViewPagerManager
01-24 18:11:54.553 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextViewManager
01-24 18:11:54.561 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextShadowNode
01-24 18:11:54.563 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class co.apptailor.googlesignin.RNGoogleSigninButtonViewManager
01-24 18:11:54.566 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.swmansion.gesturehandler.react.RNGestureHandlerRootViewManager
01-24 18:11:54.567 20736 20764 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.swmansion.gesturehandler.react.RNGestureHandlerButtonViewManager
01-24 18:11:54.749 368 368 W /system/bin/hwservicemanager: getTransport: Cannot find entry android.hardware.configstore@1.0::ISurfaceFlingerConfigs/default in either framework or device manifest.
01-24 18:11:54.771 368 368 W /system/bin/hwservicemanager: getTransport: Cannot find entry android.hardware.graphics.mapper@2.0::IMapper/default in either framework or device manifest.
01-24 18:11:54.908 7586 7687 W SearchServiceCore: Abort, client detached.
01-24 18:11:55.207 3571 3615 E QC-QMI : linux_qmi_qmux_io_wake_lock: Err in writing wakelock=qmuxd_port_wl_0, error [1:Operation not permitted]
01-24 18:11:55.207 3571 3615 E QC-QMI : linux_qmi_qmux_io_wake_unlock: Err in writing wakelock=qmuxd_port_wl_0, error [1:Operation not permitted]
01-24 18:11:55.221 7586 7687 W SearchServiceCore: Abort, client detached.
01-24 18:11:55.423 20736 20770 W ReactNativeJS: [SECURITY] node-uuid: crypto not usable, falling back to insecure Math.random()
01-24 18:11:55.992 20736 20770 W ReactNativeJS: { permissionsSucc: undefined }
01-24 18:11:56.633 20736 20770 W ReactNativeJS: { token: null }
01-24 18:11:57.232 7586 7687 W ThreadPoolDumper: Queue length for executor EventBus is now 11. Perhaps some tasks are too long, or the pool is too small.
01-24 18:11:57.447 3571 3615 E QC-QMI : linux_qmi_qmux_io_wake_lock: Err in writing wakelock=qmuxd_port_wl_0, error [1:Operation not permitted]
01-24 18:11:57.447 3571 3615 E QC-QMI : linux_qmi_qmux_io_wake_unlock: Err in writing wakelock=qmuxd_port_wl_0, error [1:Operation not permitted]
01-24 18:11:58.068 20736 20770 E ReactNativeJS: null is not an object (evaluating 't.uid')
01-24 18:11:58.083 20736 20771 E AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
01-24 18:11:58.083 20736 20771 E AndroidRuntime: Process: com.adourapp, PID: 20736
01-24 18:11:58.083 20736 20771 E AndroidRuntime: com.facebook.react.common.JavascriptException: null is not an object (evaluating 't.uid'), stack:
01-24 18:11:58.083 20736 20771 E AndroidRuntime: <unknown>@834:304
01-24 18:11:58.083 20736 20771 E AndroidRuntime: <unknown>@339:171
01-24 18:11:58.083 20736 20771 E AndroidRuntime: <unknown>@341:1766
01-24 18:11:58.083 20736 20771 E AndroidRuntime: <unknown>@850:3761
01-24 18:11:58.083 20736 20771 E AndroidRuntime: value@46:1362
01-24 18:11:58.083 20736 20771 E AndroidRuntime: <unknown>@796:952
01-24 18:11:58.083 20736 20771 E AndroidRuntime: value@46:1362
01-24 18:11:58.083 20736 20771 E AndroidRuntime: <unknown>@720:523
01-24 18:11:58.083 20736 20771 E AndroidRuntime: value@46:1362
01-24 18:11:58.083 20736 20771 E AndroidRuntime: value@25:3449
01-24 18:11:58.083 20736 20771 E AndroidRuntime: <unknown>@25:960
01-24 18:11:58.083 20736 20771 E AndroidRuntime: value@25:2703
01-24 18:11:58.083 20736 20771 E AndroidRuntime: value@25:932
01-24 18:11:58.083 20736 20771 E AndroidRuntime:
01-24 18:11:58.083 20736 20771 E AndroidRuntime: at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:54)
01-24 18:11:58.083 20736 20771 E AndroidRuntime: at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:38)
01-24 18:11:58.083 20736 20771 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
01-24 18:11:58.083 20736 20771 E AndroidRuntime: at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
01-24 18:11:58.083 20736 20771 E AndroidRuntime: at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
01-24 18:11:58.083 20736 20771 E AndroidRuntime: at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
01-24 18:11:58.083 20736 20771 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:790)
01-24 18:11:58.083 20736 20771 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
01-24 18:11:58.083 20736 20771 E AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
01-24 18:11:58.083 20736 20771 E AndroidRuntime: at android.os.Looper.loop(Looper.java:164)
01-24 18:11:58.083 20736 20771 E AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
01-24 18:11:58.083 20736 20771 E AndroidRuntime: at java.lang.Thread.run(Thread.java:764)
01-24 18:11:58.087 4143 18341 W ActivityManager: Force finishing activity com.adourapp/.MainActivity
01-24 18:11:58.199 7586 7687 W SessionLifecycleManager: Handover failed. Creating new session controller.
01-24 18:11:58.269 4143 4324 W Looper : Dispatch took 175ms on android.ui, h=Handler (com.android.server.am.ActivityManagerService$UiHandler) {3f98a53} cb=null msg=1
01-24 18:11:58.528 4143 4327 W zygote64: kill(-17311, 9) failed: No such process
01-24 18:11:58.573 4143 4327 W zygote64: kill(-17311, 9) failed: No such process
01-24 18:11:58.997 4143 4327 W zygote64: kill(-17311, 9) failed: No such process
01-24 18:11:59.042 4143 4327 W zygote64: kill(-17311, 9) failed: No such process
01-24 18:11:59.652 4143 4327 W zygote64: kill(-17311, 9) failed: No such process
01-24 18:11:59.687 3571 3615 E QC-QMI : linux_qmi_qmux_io_wake_lock: Err in writing wakelock=qmuxd_port_wl_0, error [1:Operation not permitted]
01-24 18:11:59.687 3571 3615 E QC-QMI : linux_qmi_qmux_io_wake_unlock: Err in writing wakelock=qmuxd_port_wl_0, error [1:Operation not permitted]
01-24 18:11:59.697 4143 4327 W zygote64: kill(-17311, 9) failed: No such process
01-24 18:11:59.997 4143 4327 W zygote64: kill(-17311, 9) failed: No such process
01-24 18:11:59.997 4143 4327 E zygote64: Failed to kill process cgroup uid 10051 pid 17311 in 1469ms, 1 processes remain
01-24 18:12:00.598 4143 4327 W zygote64: kill(-20034, 9) failed: No such process
01-24 18:12:00.642 4143 4327 W zygote64: kill(-20034, 9) failed: No such process
01-24 18:12:00.718 7586 7720 W ThreadPoolDumper: Task Trigger[ax[Guard future timeout]] was queued for 1133ms before starting on executor TimerThread
项目级构建gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "27.0.3"
minSdkVersion = 16
compileSdkVersion = 27
targetSdkVersion = 26
supportLibVersion = "27.1.1"
googlePlayServicesAuthVersion = "15.0.1"
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.google.gms:google-services:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.4'
distributionUrl = distributionUrl.replace("bin", "all")
}
应用程序级别构建gradle依赖项:
dependencies {
compile project(':react-native-google-signin')
compile project(':react-native-gesture-handler')
implementation project(':react-native-firebase')
// Firebase dependencies
implementation "com.google.android.gms:play-services-base:16.0.1"
implementation "com.google.firebase:firebase-core:16.0.4"
implementation "com.google.firebase:firebase-auth:16.0.5"
implementation "com.google.firebase:firebase-database:16.0.4"
implementation "com.google.firebase:firebase-messaging:17.3.4"
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
apply plugin: 'com.google.gms.google-services'