如果debuggable = false,为什么反应本地android版本会崩溃?

时间:2019-07-10 08:48:45

标签: android react-native

无法在发布模式下运行react-native android应用程序。它在释放模式下成功构建,但是随后在打开并运行时崩溃。如果在发布模式下使用debuggable = true进行构建,则该应用程序已在android仿真器中成功运行。我不知道这是什么问题。你能启发我吗?我也做adb logcat,下面是adb logcat日志的输出。

在app / build.gradle文件中发生以下代码崩溃。

release {
    minifyEnabled true
    proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
    signingConfig signingConfigs.release
}

使用以下代码在app / build.gradle文件中。

release {
    debuggable true
    minifyEnabled false
    proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
    signingConfig signingConfigs.release
} 

ADB logcat

07-10 16:32:02.720  1766  3624 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.notenavi/.SplashActivity bnds=[643,1396][849,1674] (has extras)} from uid 10022 on display 0
07-10 16:32:02.725  1456  1492 W audio_hw_generic: Not supplying enough data to HAL, expected position 2792355 , only wrote 2792160
07-10 16:32:02.737 12063 12063 W art     : Unexpected CPU variant for X86 using defaults: x86
07-10 16:32:02.739  1766  4669 I ActivityManager: Start proc 12063:com.notenavi/u0a86 for activity com.notenavi/.SplashActivity
07-10 16:32:02.769  1352  1365 D gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 8294400
07-10 16:32:02.823 12063 12063 I FirebaseInitProvider: FirebaseApp initialization successful
07-10 16:32:02.828 12063 12063 D SoLoader: init start
07-10 16:32:02.828 12063 12063 D SoLoader: adding system library source: /vendor/lib
07-10 16:32:02.828 12063 12063 D SoLoader: adding system library source: /system/lib
07-10 16:32:02.828 12063 12063 D SoLoader: adding application source: com.facebook.soloader.c[root = /data/app/com.notenavi-2/lib/x86 flags = 0]
07-10 16:32:02.828 12063 12063 D SoLoader: adding backup  source: com.facebook.soloader.a[root = /data/data/com.notenavi/lib-main flags = 1]
07-10 16:32:02.829 12063 12063 D SoLoader: Preparing SO source: com.facebook.soloader.c[root = /system/lib flags = 2]
07-10 16:32:02.829 12063 12063 D SoLoader: Preparing SO source: com.facebook.soloader.c[root = /system/vendor/lib flags = 2]
07-10 16:32:02.829 12063 12063 D SoLoader: Preparing SO source: com.facebook.soloader.c[root = /data/app/com.notenavi-2/lib/x86 flags = 0]
07-10 16:32:02.829 12063 12063 D SoLoader: Preparing SO source: com.facebook.soloader.a[root = /data/data/com.notenavi/lib-main flags = 1]
07-10 16:32:02.829 12063 12063 V fb-UnpackingSoSource: locked dso store /data/user/0/com.notenavi/lib-main
07-10 16:32:02.831 12063 12063 I fb-UnpackingSoSource: dso store is up-to-date: /data/user/0/com.notenavi/lib-main
07-10 16:32:02.831 12063 12063 V fb-UnpackingSoSource: releasing dso store lock for /data/user/0/com.notenavi/lib-main
07-10 16:32:02.832 12063 12063 D SoLoader: init finish: 4 SO sources prepared
07-10 16:32:02.832 12063 12063 D SoLoader: init exiting
07-10 16:32:02.833 12063 12063 D ReactNative: ReactInstanceManager.ctor()
07-10 16:32:02.833 12063 12063 D SoLoader: init exiting
07-10 16:32:02.836  2590  2590 W SearchService: Abort, client detached.
07-10 16:32:02.855  1766  3624 I ActivityManager: START u0 {cmp=com.notenavi/.MainActivity} from uid 10086 on display 0
07-10 16:32:02.878 12063 12082 I FA      : App measurement is starting up, version: 16250
07-10 16:32:02.878 12063 12082 I FA      : To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
07-10 16:32:02.878 12063 12082 I FA      : To enable faster debug mode event logging run:
07-10 16:32:02.878 12063 12082 I FA      :   adb shell setprop debug.firebase.analytics.app com.notenavi
07-10 16:32:02.904 12063 12063 D ReactNative: ReactInstanceManager.createReactContextInBackground()
07-10 16:32:02.904 12063 12063 D ReactNative: ReactInstanceManager.recreateReactContextInBackgroundInner()
07-10 16:32:02.904 12063 12063 D ReactNative: ReactInstanceManager.recreateReactContextInBackgroundFromBundleLoader()
07-10 16:32:02.904 12063 12063 D ReactNative: ReactInstanceManager.recreateReactContextInBackground()
07-10 16:32:02.904 12063 12063 D ReactNative: ReactInstanceManager.runCreateReactContextOnNewThread()
07-10 16:32:02.906  2590  2792 D EGL_emulation: eglMakeCurrent: 0xcc53c000: ver 3 0 (tinfo 0xd0343ee0)
07-10 16:32:02.909 12063 12087 D SoLoader: About to load: libreactnativejni.so
07-10 16:32:02.910 12063 12087 D SoLoader: libreactnativejni.so not found on /data/data/com.notenavi/lib-main
07-10 16:32:02.910 12063 12087 D SoLoader: libreactnativejni.so found on /data/app/com.notenavi-2/lib/x86
07-10 16:32:02.910 12063 12087 D SoLoader: Not resolving dependencies for libreactnativejni.so
07-10 16:32:02.917  2621  2685 D EGL_emulation: eglMakeCurrent: 0x7aaecc835820: ver 3 0 (tinfo 0x7aaecc80cb20)
07-10 16:32:02.935 12063 12082 I FA      : Tag Manager is not found and thus will not be used
07-10 16:32:02.946  1352  1366 E SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
07-10 16:32:02.973 12063 12087 D SoLoader: Loaded: libreactnativejni.so
07-10 16:32:02.973 12063 12087 D SoLoader: About to load: libfb.so
07-10 16:32:02.973 12063 12087 D SoLoader: libfb.so not found on /data/data/com.notenavi/lib-main
07-10 16:32:02.973 12063 12087 D SoLoader: libfb.so found on /data/app/com.notenavi-2/lib/x86
07-10 16:32:02.973 12063 12087 D SoLoader: Not resolving dependencies for libfb.so
07-10 16:32:02.977 12063 12087 D SoLoader: About to load: libfb.so
07-10 16:32:02.977 12063 12087 D SoLoader: libfb.so not found on /data/data/com.notenavi/lib-main
07-10 16:32:02.978 12063 12087 D SoLoader: libfb.so found on /data/app/com.notenavi-2/lib/x86
07-10 16:32:02.978 12063 12087 D SoLoader: Not resolving dependencies for libfb.so
07-10 16:32:02.978 12063 12087 I art     : Thread[14,tid=12087,Native,Thread*=0xe30a7100,peer=0x12d60160,"Thread-3"] recursive attempt to load library "/data/app/com.notenavi-2/lib/x86/libfb.so"
07-10 16:32:02.978 12063 12087 D SoLoader: Loaded: libfb.so
07-10 16:32:02.978 12063 12087 D SoLoader: Loaded: libfb.so
07-10 16:32:02.980 12063 12087 D ReactNative: ReactInstanceManager.createReactContext()
07-10 16:32:02.990 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.reactnativenavigation.react.ElementViewManager
07-10 16:32:02.995 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.uimanager.n
07-10 16:32:02.999 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.airbnb.android.react.maps.AirMapCalloutManager
07-10 16:32:03.001 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.airbnb.android.react.maps.AirMapMarkerManager
07-10 16:32:03.003 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.airbnb.android.react.maps.AirMapPolylineManager
07-10 16:32:03.005 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.airbnb.android.react.maps.AirMapPolygonManager
07-10 16:32:03.008 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.airbnb.android.react.maps.AirMapCircleManager
07-10 16:32:03.012 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.airbnb.android.react.maps.AirMapManager
07-10 16:32:03.022 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.airbnb.android.react.maps.AirMapLiteManager
07-10 16:32:03.022 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.airbnb.android.react.maps.AirMapUrlTileManager
07-10 16:32:03.023 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.airbnb.android.react.maps.AirMapLocalTileManager
07-10 16:32:03.025 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.airbnb.android.react.maps.AirMapOverlayManager
07-10 16:32:03.032 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.dylanvann.fastimage.FastImageViewManager
07-10 16:32:03.040 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTGroupViewManager
07-10 16:32:03.043 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.a
07-10 16:32:03.047 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTShapeViewManager
07-10 16:32:03.047 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.b
07-10 16:32:03.048 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTTextViewManager
07-10 16:32:03.048 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.f
07-10 16:32:03.057 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.checkbox.ReactCheckBoxManager
07-10 16:32:03.061 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.picker.ReactDialogPickerManager
07-10 16:32:03.064 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.drawer.ReactDrawerLayoutManager
07-10 16:32:03.080 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.picker.ReactDropdownPickerManager
07-10 16:32:03.087 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollViewManager
07-10 16:32:03.106 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollContainerViewManager
07-10 16:32:03.112 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.ReactProgressBarViewManager
07-10 16:32:03.113 12063 12089 D         : HostConnection::get() New Host Connection established 0xe309d980, tid 12089
07-10 16:32:03.114 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.b
07-10 16:32:03.116 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactScrollViewManager
07-10 16:32:03.116 12063 12089 I OpenGLRenderer: Initialized EGL, version 1.4
07-10 16:32:03.116 12063 12089 D OpenGLRenderer: Swap behavior 1
07-10 16:32:03.118 12063 12089 W OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
07-10 16:32:03.118 12063 12089 D OpenGLRenderer: Swap behavior 0
07-10 16:32:03.119 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.slider.ReactSliderManager
07-10 16:32:03.120 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.slider.ReactSliderManager$a
07-10 16:32:03.120 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager
07-10 16:32:03.123 12063 12089 D EGL_emulation: eglCreateContext: 0xe620be80: maj 3 min 0 rcv 3
07-10 16:32:03.127 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager$a
07-10 16:32:03.128 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.toolbar.ReactToolbarManager
07-10 16:32:03.129 12063 12089 D EGL_emulation: eglMakeCurrent: 0xe620be80: ver 3 0 (tinfo 0xe30f0730)
07-10 16:32:03.136 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.webview.ReactWebViewManager
07-10 16:32:03.140 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.swiperefresh.SwipeRefreshLayoutManager
07-10 16:32:03.145 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTSurfaceViewManager
07-10 16:32:03.145 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.e
07-10 16:32:03.148 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageViewManager
07-10 16:32:03.149 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.frescosupport.a
07-10 16:32:03.162 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.image.ReactImageManager
07-10 16:32:03.172 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.ReactModalHostManager
07-10 16:32:03.176 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.b
07-10 16:32:03.176 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactRawTextManager
07-10 16:32:03.180 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.k
07-10 16:32:03.180 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputManager
07-10 16:32:03.183 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.textinput.q
07-10 16:32:03.183 12063 12089 D EGL_emulation: eglMakeCurrent: 0xe620be80: ver 3 0 (tinfo 0xe30f0730)
07-10 16:32:03.186 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactTextViewManager
07-10 16:32:03.190 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.o
07-10 16:32:03.190 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.view.ReactViewManager
07-10 16:32:03.192 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.viewpager.ReactViewPagerManager
07-10 16:32:03.194 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextViewManager
07-10 16:32:03.194 12063 12087 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.r
07-10 16:32:03.203 12063 12087 I RNFusedLocation: RNFusedLocation initialized
07-10 16:32:03.217 12063 12087 D SoLoader: About to load: librealmreact.so
07-10 16:32:03.217 12063 12087 D SoLoader: librealmreact.so not found on /data/data/com.notenavi/lib-main
07-10 16:32:03.217 12063 12087 D SoLoader: librealmreact.so found on /data/app/com.notenavi-2/lib/x86
07-10 16:32:03.217 12063 12087 D SoLoader: Not resolving dependencies for librealmreact.so
07-10 16:32:03.224 12063 12087 D SoLoader: Loaded: librealmreact.so
07-10 16:32:03.225 12063 12087 V JSRealm : setDefaultRealmFileDirectory
07-10 16:32:03.225 12063 12087 D JSRealm : Absolute path: /data/data/com.notenavi/files
07-10 16:32:03.232 12063 12087 D NetworkSecurityConfig: No Network Security Config specified, using platform default
07-10 16:32:03.241 12063 12087 D ReactNative: Initializing React Xplat Bridge.
07-10 16:32:03.245 12063 12087 D ReactNative: Initializing React Xplat Bridge before initializeBridge
07-10 16:32:03.251 12063 12087 D ReactNative: Initializing React Xplat Bridge after initializeBridge
07-10 16:32:03.251 12063 12087 D ReactNative: CatalystInstanceImpl.runJSBundle()
07-10 16:32:03.252 12063 12087 E AndroidRuntime: FATAL EXCEPTION: Thread-3
07-10 16:32:03.252 12063 12087 E AndroidRuntime: Process: com.notenavi, PID: 12063
07-10 16:32:03.252 12063 12087 E AndroidRuntime: java.lang.RuntimeException: Unable to load script from assets 'index.android.bundle'. Make sure your bundle is packaged correctly or you're running a packager server.
07-10 16:32:03.252 12063 12087 E AndroidRuntime:    at com.facebook.react.bridge.CatalystInstanceImpl.jniLoadScriptFromAssets(Native Method)
07-10 16:32:03.252 12063 12087 E AndroidRuntime:    at com.facebook.react.bridge.CatalystInstanceImpl.loadScriptFromAssets()
07-10 16:32:03.252 12063 12087 E AndroidRuntime:    at com.facebook.react.bridge.JSBundleLoader$1.loadScript()
07-10 16:32:03.252 12063 12087 E AndroidRuntime:    at com.facebook.react.bridge.CatalystInstanceImpl.runJSBundle()
07-10 16:32:03.252 12063 12087 E AndroidRuntime:    at d.c.m.O.a()
07-10 16:32:03.252 12063 12087 E AndroidRuntime:    at d.c.m.O.a()
07-10 16:32:03.252 12063 12087 E AndroidRuntime:    at d.c.m.J.run()
07-10 16:32:03.252 12063 12087 E AndroidRuntime:    at java.lang.Thread.run(Thread.java:761)
07-10 16:32:03.272  1766  3624 W ActivityManager:   Force finishing activity com.notenavi/.MainActivity
07-10 16:32:03.286  1766  2360 I WindowManager: Failed to capture screenshot of Token{4bd0ee8 ActivityRecord{d65800b u0 com.notenavi/.MainActivity t17 f}} appWin=Window{cf4ddf5 u0 com.notenavi/com.notenavi.MainActivity} drawState=4
07-10 16:32:03.302 12063 12089 D EGL_emulation: eglMakeCurrent: 0xe620be80: ver 3 0 (tinfo 0xe30f0730)
07-10 16:32:03.358  2590  2792 D EGL_emulation: eglMakeCurrent: 0xcc53c000: ver 3 0 (tinfo 0xd0343ee0)
07-10 16:32:03.379  2621  2685 D EGL_emulation: eglMakeCurrent: 0x7aaecc835820: ver 3 0 (tinfo 0x7aaecc80cb20)
07-10 16:32:03.399  1766  4992 I OpenGLRenderer: Initialized EGL, version 1.4
07-10 16:32:03.399  1766  4992 D OpenGLRenderer: Swap behavior 1
07-10 16:32:03.399  1766  4992 W OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
07-10 16:32:03.400  1766  4992 D OpenGLRenderer: Swap behavior 0
07-10 16:32:03.404  1766  4992 D EGL_emulation: eglCreateContext: 0x7aaeb7c44ca0: maj 3 min 0 rcv 3
07-10 16:32:03.406  1766  4992 D EGL_emulation: eglMakeCurrent: 0x7aaeb7c44ca0: ver 3 0 (tinfo 0x7aaeb644b9e0)
07-10 16:32:03.428  1766  4992 D EGL_emulation: eglMakeCurrent: 0x7aaeb7c44ca0: ver 3 0 (tinfo 0x7aaeb644b9e0)
07-10 16:32:03.430  2590  2590 I OptInState: There is a new client and it does not support opt-in. Dropping request.
07-10 16:32:03.465  2590  2590 I MicroDetectionWorker: Micro detection mode: [mDetectionMode: [1]].
07-10 16:32:03.466  2590  2590 I AudioController: Using mInputStreamFactoryBuilder
07-10 16:32:03.468  2590 12107 W LocationOracle: No location history returned by ContextManager

1 个答案:

答案 0 :(得分:0)

我不知道为什么?我改变

classpath'com.android.tools.build:gradle:3.4.1'到

classpath'com.android.tools.build:gradle:3.3.0',它工作正常。

谢谢大家!