首页 > 解决方案 > Flutter 在 Android 6 上崩溃:[ERROR:flutter/runtime/dart_vm_data.cc(18)] VM 快照无效,无法从设置中推断

问题描述

我们在现有应用程序中使用颤振作为模块。最近我们发现我们的应用程序在启动时崩溃了,并且只发生在 Android 6 上。崩溃堆栈看起来像这样。

10-29 08:53:02.851 F/libc    (26633): Fatal signal 6 (SIGABRT), code -6 in tid 26633 (com.)
10-29 08:53:02.954 F/DEBUG   (  390): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-29 08:53:02.954 F/DEBUG   (  390): Build fingerprint: 'motorola/lux_verizon/lux:6.0.1/MCD24.294-4-6/8:user/release-keys'
10-29 08:53:02.954 F/DEBUG   (  390): Revision: 'p2c0'
10-29 08:53:02.954 F/DEBUG   (  390): ABI: 'arm'
10-29 08:53:02.954 F/DEBUG   (  390): pid: 26633, tid: 26633, name: com.  >>> com. <<<
10-29 08:53:02.954 F/DEBUG   (  390): signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
10-29 08:53:02.988 F/DEBUG   (  390): Abort message: '[FATAL:flutter/shell/common/shell.cc(264)] Check failed: vm. Must be able to initialize the VM.
10-29 08:53:02.988 F/DEBUG   (  390): '
10-29 08:53:02.989 F/DEBUG   (  390):     r0 00000000  r1 00006809  r2 00000006  r3 b6fb1b7c
10-29 08:53:02.989 F/DEBUG   (  390):     r4 b6fb1b84  r5 b6fb1b34  r6 00000002  r7 0000010c
10-29 08:53:02.989 F/DEBUG   (  390):     r8 be8ca9a4  r9 be8cb4e8  sl be8cb89c  fp 8f7ea810
10-29 08:53:02.989 F/DEBUG   (  390):     ip 00000006  sp be8c9e90  lr b6d371cd  pc b6d395c8  cpsr 400f0010
10-29 08:53:02.994 F/DEBUG   (  390): 
10-29 08:53:02.994 F/DEBUG   (  390): backtrace:
10-29 08:53:02.994 F/DEBUG   (  390):     #00 pc 000445c8  /system/lib/libc.so (tgkill+12)
10-29 08:53:02.994 F/DEBUG   (  390):     #01 pc 000421c9  /system/lib/libc.so (pthread_kill+32)
10-29 08:53:02.994 F/DEBUG   (  390):     #02 pc 0001bb1f  /system/lib/libc.so (raise+10)
10-29 08:53:02.994 F/DEBUG   (  390):     #03 pc 00018cc1  /system/lib/libc.so (__libc_android_abort+34)
10-29 08:53:02.994 F/DEBUG   (  390):     #04 pc 00016880  /system/lib/libc.so (abort+4)
10-29 08:53:02.994 F/DEBUG   (  390):     #05 pc 00024a3f  /data/app/com.-1/split_config.armeabi_v7a.apk (offset 0x144c000)
10-29 08:53:04.084 W/ActivityManager( 2082):   Force finishing activity com./com.example.sdk.splash.SplashActivity
10-29 08:53:04.084 F/DEBUG   (  390): 
10-29 08:53:04.084 F/DEBUG   (  390): Tombstone written to: /data/tombstones/tombstone_04
10-29 09:02:18.927 I/Finsky  (30199): [1718] ose.g(22): Successfully applied new configurations for package com.google.android.finsky.regular.
10-29 09:02:18.928 I/Finsky  (30199): [1715] ose.h(1): Triggered update for experiment package com.google.android.finsky.regular.
10-29 09:02:19.035 I/Apm_PackageManager(30397): getApplicationInfo from Cache,pkg is :com.,flag is :128,cache flag is :128
10-29 09:02:19.058 E/flutter (30397): [ERROR:flutter/runtime/dart_vm_data.cc(18)] VM snapshot invalid and could not be inferred from settings.
10-29 09:02:19.058 E/flutter (30397): [ERROR:flutter/runtime/dart_vm.cc(247)] Could not setup VM data to bootstrap the VM from.
10-29 09:02:19.059 E/flutter (30397): [ERROR:flutter/runtime/dart_vm_lifecycle.cc(84)] Could not create Dart VM instance.
10-29 09:02:19.059 F/flutter (30397): [FATAL:flutter/shell/common/shell.cc(264)] Check failed: vm. Must be able to initialize the VM.
10-29 09:02:19.060 F/libc    (30397): Fatal signal 6 (SIGABRT), code -6 in tid 30397 (com.) 

重现这次崩溃并不容易。我们尝试通过Play商店安装我们的应用程序,我们看到了这个崩溃,当应用程序启动时它会崩溃。但过了一段时间,它不会再次崩溃。我们尝试了很多设备,系统是 Android 6(6.0.1),一切正常。但是Play商店显示这个崩溃仍然存在。

有人有这个问题吗?

所有堆栈都在这里:

10-29 09:02:14.818 I/ActivityManager( 2082): Start proc 30397:com./u0a293 for activity com./com.example.sdk.splash.SplashActivity
10-29 09:02:14.836 D/ProcSpeedReader( 4065): Failed to read freq stats from null
10-29 09:02:14.854 W/ResourceType(30397): ResTable_typeSpec entry count inconsistent: given 3933, previously 3943
10-29 09:02:14.854 W/ResourceType(30397): ResTable_typeSpec entry count inconsistent: given 4845, previously 4867
10-29 09:02:14.854 W/ResourceType(30397): ResTable_typeSpec entry count inconsistent: given 60, previously 58
10-29 09:02:14.854 W/ResourceType(30397): ResTable_typeSpec entry count inconsistent: given 225, previously 1157
10-29 09:02:15.199 I/DM._hotpatch(30397): hotpatch sdk version: 3.10.1.7.7.2
10-29 09:02:15.205 I/Apm_PackageManager(30397): getApplicationInfo from Binder,pkg is :com.,flag is :128
10-29 09:02:15.205 D/DM._hotpatch(30397): insert hack = false
10-29 09:02:15.214 I/Apm_PackageManager(30397): getPackageInfo from Binder,pkg is :com.,flag is :0
10-29 09:02:15.317 W/com.asurion.android.verizon.vms(27872): type=1400 audit(0.0:6202): avc: denied { search } for uid=10069 comm=546F704170704D6F6E69746F72202D name="3445" dev="proc" ino=273985 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:platform_app:s0:c512,c768 tclass=dir permissive=0
10-29 09:02:15.317 W/com.asurion.android.verizon.vms(27872): type=1400 audit(0.0:6203): avc: denied { search } for uid=10069 comm=546F704170704D6F6E69746F72202D name="3445" dev="proc" ino=273985 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:platform_app:s0:c512,c768 tclass=dir permissive=0
10-29 09:02:15.504 I/art     (30397): Background partial concurrent mark sweep GC freed 3026(259KB) AllocSpace objects, 3(60KB) LOS objects, 38% free, 25MB/41MB, paused 5.300ms total 28.158ms
10-29 09:02:15.876 D/BaseApplication(30397): xcrash anr check open status:true
10-29 09:02:15.876 D/BaseApplication(30397): xcrash anr check open success
10-29 09:02:15.878 W/AppCrashInterceptor(30397): hookActivityThread success 
10-29 09:02:16.057 I/SFPerfTracer(  372):      triggers: (rate: 0:2) (5670 sw vsyncs) (0 skipped) (120:49242 vsyncs) (122:58386)
10-29 09:02:16.138 I/Apm_PackageManager(30397): getApplicationInfo from Cache,pkg is :com.,flag is :128,cache flag is :128
10-29 09:02:16.145 I/Apm_PackageManager(30397): getApplicationInfo from Cache,pkg is :com.,flag is :128,cache flag is :128
10-29 09:02:16.151 I/Apm_PackageManager(30397): getPackageInfo from Cache,pkg is :com.,flag is :0,cache flag is :0
10-29 09:02:16.300 W/ResourceType(30397): ResTable_typeSpec entry count inconsistent: given 67, previously 69
10-29 09:02:16.319 W/System  (30397): ClassLoader referenced unknown path: /data/data/com.google.android.gms/app_chimera/m/00000055/n/armeabi-v7a
10-29 09:02:16.319 W/System  (30397): ClassLoader referenced unknown path: /data/data/com.google.android.gms/app_chimera/m/00000055/n/armeabi
10-29 09:02:16.324 I/Apm_PackageManager(30397): getApplicationInfo from Cache,pkg is :com.,flag is :128,cache flag is :128
10-29 09:02:16.323 W/com.asurion.android.verizon.vms(27872): type=1400 audit(0.0:6204): avc: denied { search } for uid=10069 comm=546F704170704D6F6E69746F72202D name="3445" dev="proc" ino=276017 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:platform_app:s0:c512,c768 tclass=dir permissive=0
10-29 09:02:16.323 W/com.asurion.android.verizon.vms(27872): type=1400 audit(0.0:6205): avc: denied { search } for uid=10069 comm=546F704170704D6F6E69746F72202D name="3445" dev="proc" ino=276017 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:platform_app:s0:c512,c768 tclass=dir permissive=0
10-29 09:02:16.330 I/Apm_PackageManager(30397): getApplicationInfo from Cache,pkg is :com.,flag is :128,cache flag is :128
10-29 09:02:16.330 I/Apm_PackageManager(30397): getApplicationInfo from Cache,pkg is :com.,flag is :128,cache flag is :128
10-29 09:02:16.330 I/Apm_PackageManager(30397): getApplicationInfo from Cache,pkg is :com.,flag is :128,cache flag is :128
10-29 09:02:16.333 I/Apm_PackageManager(30397): getApplicationInfo from Cache,pkg is :com.,flag is :128,cache flag is :128
10-29 09:02:16.384 I/Apm_PackageManager(30397): getApplicationInfo from Cache,pkg is :com.,flag is :128,cache flag is :128
10-29 09:02:16.420 I/Apm_PackageManager(30397): getPackageInfo from Binder,pkg is :com.,flag is :16512
10-29 09:02:16.438 I/Apm_PackageManager(30397): getPackageInfo from Cache,pkg is :com.,flag is :0,cache flag is :0
10-29 09:02:16.486 I/Apm_PackageManager(30397): getPackageInfo from Cache,pkg is :com.,flag is :16512,cache flag is :16512
10-29 09:02:16.488 I/Apm_PackageManager(30397): getApplicationInfo from Cache,pkg is :com.,flag is :128,cache flag is :128
10-29 09:02:16.517 I/Apm_PackageManager(30397): getPackageInfo from Cache,pkg is :com.,flag is :0,cache flag is :0
10-29 09:02:16.527 D/WifiService( 2082): New client listening to asynchronous messages
10-29 09:02:16.550 I/FA      (30397): App measurement initialized, version: 44007
10-29 09:02:16.550 I/FA      (30397): To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
10-29 09:02:16.551 I/FA      (30397): To enable faster debug mode event logging run:
10-29 09:02:16.551 I/FA      (30397):   adb shell setprop debug.firebase.analytics.app com.
10-29 09:02:16.558 I/Apm_PackageManager(30397): getPackageInfo from Cache,pkg is :com.,flag is :16512,cache flag is :16512
10-29 09:02:16.661 D/BoundBrokerSvc( 7123): onBind: Intent { act=com.google.android.gms.measurement.START pkg=com.google.android.gms }
10-29 09:02:16.661 D/BoundBrokerSvc( 7123): Loading bound service for intent: Intent { act=com.google.android.gms.measurement.START pkg=com.google.android.gms }
10-29 09:02:16.678 I/art     (30397): Background sticky concurrent mark sweep GC freed 75603(6MB) AllocSpace objects, 27(540KB) LOS objects, 14% free, 35MB/41MB, paused 3.395ms total 100.981ms
10-29 09:02:16.727 D/audio_hw_primary(  394): out_standby: enter: stream (0xb807c2f8) usecase(1: low-latency-playback)
10-29 09:02:16.730 I/Apm_PackageManager(30397): getApplicationInfo from Cache,pkg is :com.,flag is :128,cache flag is :128
10-29 09:02:16.745 D/ApmPool—(30397): active count = 1; task count = 2
10-29 09:02:16.747 I/Apm_PackageManager(30397): getPackageInfo from Cache,pkg is :com.,flag is :0,cache flag is :0
10-29 09:02:16.750 D/PreLoaders(30397): preloadSp time is :9
10-29 09:02:16.752 I/ApmServiceManager(30397): redirectLogStreams
10-29 09:02:16.811 D/hardware_info(  394): hw_info_append_hw_type : device_name = speaker
10-29 09:02:16.852 I/Apm_PackageManager(30397): getPackageInfo from Cache,pkg is :com.,flag is :16512,cache flag is :16512
10-29 09:02:17.444 I/art     (30397): Thread[1,tid=30397,Native,Thread*=0xb81dbd60,peer=0x737082a0,"main"] recursive attempt to load library "/data/app/com.-1/split_config.armeabi_v7a.apk!/lib/armeabi-v7a/libwsg.so"
10-29 09:02:17.458 I/Apm_PackageManager(30397): getPackageInfo from Cache,pkg is :com.,flag is :16512,cache flag is :16512
10-29 09:02:17.462 I/Apm_PackageManager(30397): getPackageInfo from Cache,pkg is :com.,flag is :16512,cache flag is :16512
10-29 09:02:17.462 I/Apm_PackageManager(30397): getApplicationInfo from Cache,pkg is :com.,flag is :128,cache flag is :128
10-29 09:02:17.463 I/Apm_PackageManager(30397): getApplicationInfo from Cache,pkg is :com.,flag is :128,cache flag is :128
10-29 09:02:17.471 I/Apm_PackageManager(30397): getPackageInfo from Binder,pkg is :com.android.vending,flag is :0
10-29 09:02:17.477 I/Apm_PackageManager(30397): getApplicationInfo from Cache,pkg is :com.,flag is :128,cache flag is :128
10-29 09:02:17.480 I/Apm_PackageManager(30397): getPackageInfo from Binder,pkg is :com.android.vending,flag is :8256
10-29 09:02:17.482 I/Apm_PackageManager(30397): getPackageInfo from Binder,pkg is :com.google.android.gms,flag is :64
10-29 09:02:17.552 W/linker  (30397): /data/app/com.-1/split_config.armeabi_v7a.apk: unused DT entry: type 0x1d arg 0xf20
10-29 09:02:17.657 I/ThermalEngine(  418): Thermal-Server: Thermal received msg from  override
10-29 09:02:17.657 E/ThermalEngine(  418): override_notify: SS mode 0 override
10-29 09:02:17.658 I/Thermal-Lib( 4747): Thermal-Lib-Client: Client request sent
10-29 09:02:17.675 I/ShortcutBadger(30199): Checking if platform supports badge counters, attempt 1/3.
10-29 09:02:17.684 I/Finsky  (30199): [1711] eqn.run(29): Initializing the instant apps module.
10-29 09:02:17.697 I/ShortcutBadger(30199): Checking if platform supports badge counters, attempt 2/3.
10-29 09:02:17.705 I/ShortcutBadger(30199): Checking if platform supports badge counters, attempt 3/3.
10-29 09:02:17.706 I/Finsky  (30199): [1719] ose.h(1): Triggered update for experiment package com.google.android.finsky.regular.
10-29 09:02:17.707 I/Apm_PackageManager(30397): getPackageInfo from Cache,pkg is :com.,flag is :0,cache flag is :0
10-29 09:02:17.713 W/ShortcutBadger(30199): Badge counter seems not supported in this platform: unable to resolve intent: Intent { act=android.intent.action.BADGE_COUNT_UPDATE (has extras) }
10-29 09:02:17.759 I/Apm_PackageManager(30397): getPackageInfo from Cache,pkg is :com.,flag is :16512,cache flag is :16512
10-29 09:02:17.759 I/Apm_PackageManager(30397): getPackageInfo from Cache,pkg is :com.,flag is :16512,cache flag is :16512
10-29 09:02:17.810 I/Apm_PackageManager(30397): getPackageInfo from Binder,pkg is :com.android.vending,flag is :128
10-29 09:02:17.841 I/Apm_PackageManager(30397): getPackageInfo from Cache,pkg is :com.,flag is :16512,cache flag is :16512
10-29 09:02:17.859 I/Apm_PackageManager(30397): getPackageInfo from Cache,pkg is :com.,flag is :0,cache flag is :0
10-29 09:02:18.015 D/ApmPool—(30397): active count = 2; task count = 3
10-29 09:02:18.030 I/Apm_PackageManager(30397): getPackageInfo from Cache,pkg is :com.,flag is :0,cache flag is :0
10-29 09:02:18.088 D/ApmPool—(30397): active count = 2; task count = 4
10-29 09:02:18.131 I/Apm_PackageManager(30397): getPackageInfo from Cache,pkg is :com.android.vending,flag is :8256,cache flag is :8256
10-29 09:02:18.131 I/Apm_PackageManager(30397): getPackageInfo from Cache,pkg is :com.google.android.gms,flag is :64,cache flag is :64
10-29 09:02:18.134 I/Apm_PackageManager(30397): getPackageInfo from Cache,pkg is :com.android.vending,flag is :0,cache flag is :0
10-29 09:02:18.136 I/Apm_PackageManager(30397): getPackageInfo from Cache,pkg is :com.android.vending,flag is :8256,cache flag is :8256
10-29 09:02:18.136 I/Apm_PackageManager(30397): getPackageInfo from Cache,pkg is :com.google.android.gms,flag is :64,cache flag is :64
10-29 09:02:18.330 W/com.asurion.android.verizon.vms(27872): type=1400 audit(0.0:6206): avc: denied { search } for uid=10069 comm=546F704170704D6F6E69746F72202D name="3445" dev="proc" ino=276017 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:platform_app:s0:c512,c768 tclass=dir permissive=0
10-29 09:02:18.330 W/com.asurion.android.verizon.vms(27872): type=1400 audit(0.0:6207): avc: denied { search } for uid=10069 comm=546F704170704D6F6E69746F72202D name="3445" dev="proc" ino=276017 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:platform_app:s0:c512,c768 tclass=dir permissive=0
10-29 09:02:18.354 I/Apm_PackageManager(30397): getPackageInfo from Cache,pkg is :com.,flag is :0,cache flag is :0
10-29 09:02:18.359 I/Apm_PackageManager(30397): getPackageInfo from Cache,pkg is :com.,flag is :0,cache flag is :0
10-29 09:02:18.362 I/Apm_PackageManager(30397): getPackageInfo from Cache,pkg is :com.,flag is :0,cache flag is :0
10-29 09:02:18.488 I/art     (30397): Background sticky concurrent mark sweep GC freed 8591(464KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 41MB/41MB, paused 11.594ms total 26.706ms
10-29 09:02:18.491 I/Finsky  (30199): [1719] osm.c(1): Regular flags synced
10-29 09:02:18.492 I/Finsky  (30199): [1719] pqp.s(3): Writing flags config, size 1.
10-29 09:02:18.493 I/Finsky  (30199): [1719] pqp.s(3): Started writing experiment flags into file [OLHc9oYTV-NaLIe_OkJtf4LG_fPlCS82vO15jjWcCO4].
10-29 09:02:18.511 I/Finsky  (30199): [1719] pqp.s(17): Finished writing experiment flags into file [OLHc9oYTV-NaLIe_OkJtf4LG_fPlCS82vO15jjWcCO4].
10-29 09:02:18.524 I/Finsky  (30199): [1719] ose.g(22): Successfully applied new configurations for package com.google.android.finsky.regular.
10-29 09:02:18.525 I/Finsky  (30199): [1718] ose.h(1): Triggered update for experiment package com.google.android.finsky.regular.
10-29 09:02:18.562 I/art     (30397): Background sticky concurrent mark sweep GC freed 719(89KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 42MB/42MB, paused 7.132ms total 25.061ms
10-29 09:02:18.634 I/Apm_PackageManager(30397): getPackageInfo from Cache,pkg is :com.,flag is :16512,cache flag is :16512
10-29 09:02:18.639 I/Apm_PackageManager(30397): getPackageInfo from Cache,pkg is :com.android.vending,flag is :0,cache flag is :0
10-29 09:02:18.738 I/Apm_PackageManager(30397): getApplicationInfo from Cache,pkg is :com.,flag is :128,cache flag is :128
10-29 09:02:18.886 I/Finsky  (30199): [1718] osm.c(1): Regular flags synced
10-29 09:02:18.888 I/Apm_PackageManager(30397): getPackageInfo from Cache,pkg is :com.,flag is :0,cache flag is :0
10-29 09:02:18.896 I/Finsky  (30199): [1718] pqp.s(3): Writing flags config, size 1.
10-29 09:02:18.898 I/Finsky  (30199): [1718] pqp.s(3): Started writing experiment flags into file [U_VxB5TkGKVLTJYoMWfHZF55KpJiC3UMsFQiwWDBuvg].
10-29 09:02:18.916 I/Finsky  (30199): [1718] pqp.s(17): Finished writing experiment flags into file [U_VxB5TkGKVLTJYoMWfHZF55KpJiC3UMsFQiwWDBuvg].
10-29 09:02:18.921 I/Apm_PackageManager(30397): getApplicationInfo from Cache,pkg is :com.,flag is :128,cache flag is :128
10-29 09:02:18.927 I/Finsky  (30199): [1718] ose.g(22): Successfully applied new configurations for package com.google.android.finsky.regular.
10-29 09:02:18.928 I/Finsky  (30199): [1715] ose.h(1): Triggered update for experiment package com.google.android.finsky.regular.
10-29 09:02:19.035 I/Apm_PackageManager(30397): getApplicationInfo from Cache,pkg is :com.,flag is :128,cache flag is :128
10-29 09:02:19.058 E/flutter (30397): [ERROR:flutter/runtime/dart_vm_data.cc(18)] VM snapshot invalid and could not be inferred from settings.
10-29 09:02:19.058 E/flutter (30397): [ERROR:flutter/runtime/dart_vm.cc(247)] Could not setup VM data to bootstrap the VM from.
10-29 09:02:19.059 E/flutter (30397): [ERROR:flutter/runtime/dart_vm_lifecycle.cc(84)] Could not create Dart VM instance.
10-29 09:02:19.059 F/flutter (30397): [FATAL:flutter/shell/common/shell.cc(264)] Check failed: vm. Must be able to initialize the VM.
10-29 09:02:19.060 F/libc    (30397): Fatal signal 6 (SIGABRT), code -6 in tid 30397 (com.)
10-29 09:02:19.117 F/DEBUG   (  390): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

标签: fluttercrash

解决方案


这与已知问题有关:https ://issuetracker.google.com/issues/147096055 。从链接:

“如果您是 Flutter 用户,您可以采取以下措施来解决此问题:

  1. 如果您构建 App Bundle 编辑 android/gradle.properties 并添加标志:android.bundle.enableUncompressedNativeLibs=false

  2. 如果你构建一个 APK。确保标签android:extractNativeLibs=false中没有设置 android/app/src/AndroidManifest.xml 。”<application>

我自己尝试使用我的颤振应用程序解决了这个问题。添加 android.bundle.enableUncompressedNativeLibs=false 标志解决了 BlackBerry DTEK STH100-2 Android 6.0.1 上的问题。该应用程序仅在发布模式下崩溃,并且仅在从 Play 商店作为应用程序包安装后才会崩溃。adb logcat 给出了无法启动 Dart VM 的致命错误。


推荐阅读