Flutter项目上架Play Store闭测遇GCE x86模拟器原生崩溃问题
Flutter应用上架Google Play时在GCE x86测试设备上触发原生崩溃问题
基础配置信息
我开发了一款Flutter应用,完成签名配置后构建了App Bundle,在app/build.gradle中添加了如下配置:
android { compileSdkVersion 32 ndkPath = "/Users/mmm/Library/Android/sdk/ndk/24.0.8215888" ... defaultConfig { applicationId "com.blablabla.my_app" minSdkVersion 21 targetSdkVersion 32 versionCode flutterVersionCode.toInteger() versionName flutterVersionName ndk { abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64' } } ... buildTypes { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. signingConfig signingConfigs.release shrinkResources false minifyEnabled false } } } android.buildTypes.release.ndk.debugSymbolLevel = 'symbol_table'
崩溃现象
将应用发布到Play Store封闭式测试渠道时,测试流程在GCE x86模拟器上持续检测到原生崩溃问题:
- 曾尝试移除
'x86_64'ABI过滤配置,但Play控制台仍会将应用分配到该GCE测试设备上运行 - 测试录屏显示应用首页显示时长不足1秒就会闪退
- 本人仅掌握Dart与Flutter开发技术,无法读懂崩溃日志中的原生层内容,崩溃日志如下:
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** Build fingerprint: 'generic/gce_x86_phone/gce_x86:9/PGR1.190916.001/5877764:userdebug/test-keys' Revision: '0' ABI: 'x86' pid: 6487, tid: 7424, name: 1.raster >>> com.blablabla.my_app <<< signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr -------- Abort message: 'vendor/unbundled_google/libs/ndk_translation/ndk_translation/ir/include/ndk_translation/ir/ir.h:685: CHECK failed: IsAligned(offset, GetFormatSize(format))' eax 00000000 ebx 00001957 ecx 00001d00 edx 00000006 edi 00001957 esi ca3bfb5c ebp ca3bfb28 esp ca3bfab8 eip f10a2be9 backtrace: #00 pc 00000be9 [vdso:f10a2000] (__kernel_vsyscall+9) #01 pc 0001fdf8 /system/lib/libc.so (syscall+40) #02 pc 00022e73 /system/lib/libc.so (abort+115) #03 pc 00006c84 /system/lib/liblog.so (__android_log_assert+292) #04 pc 0009f2b4 /system/lib/libndk_translation.so (ndk_translation::GetInsn::GetInsn(ndk_translation::IR*, ndk_translation::Format, unsigned int)+276) #05 pc 0009f100 /system/lib/libndk_translation.so (ndk_translation::IRBuilder::Get(ndk_translation::Format, unsigned int)+144) #06 pc 0009dd2e /system/lib/libndk_translation.so (ndk_translation::(anonymous namespace)::InsnBuilder::Get(ndk_translation::Format, unsigned int)+46) #07 pc 000d0b4b /system/lib/libndk_translation.so (ndk_translation::SemanticsDecoder::VTBL(ndk_translation::VTBL_Args const&)+363) #08 pc 00100568 /system/lib/libndk_translation.so (ndk_translation::ArmDecoder::TranslateThumbInsn(unsigned short const*)+86104) #09 pc 0009c2b6 /system/lib/libndk_translation.so (ndk_translation::(anonymous namespace)::GenerateIRHelper(ndk_translation::CompilerHooks*, unsigned int, unsigned int, ndk_translation::IR*)+1142) #10 pc 0009be1f /system/lib/libndk_translation.so (ndk_translation::GenerateIR(ndk_translation::CompilerHooks*, unsigned int, ndk_translation::IR*, unsigned int*)+47) #11 pc 0009bbdf /system/lib/libndk_translation.so (ndk_translation::Compile(ndk_translation::CompilerHooks*, unsigned int, ndk_translation::GuestCodeEntry*, unsigned int*, ndk_translation::MachineCode*)+143) #12 pc 0007a0da /system/lib/libndk_translation.so (ndk_translation::(anonymous namespace)::Translate(ndk_translation::TranslationCache*, unsigned int, ndk_translation::GuestCodeEntry*)+378) #13 pc 00079f1c /system/lib/libndk_translation.so (ndk_translation_HandleNotTranslated+300) #14 pc 0018db57 /system/lib/libndk_translation.so
已尝试的解决方案
- 由于应用使用蓝牙功能,曾在
runApp()执行前添加校验逻辑,避免模拟器运行flutter_blue_plus相关代码,没有效果 - 先后尝试十余种解决方案,仍然收到相同崩溃报告
- 尝试直接提交生产环境发布,被控制台拦截,应用一直处于“审核中”状态
- 升级到最新的Flutter 3.0.2版本,新建Flutter官方默认的计数器Demo项目,完成release签名后提交到Play Store封闭式测试渠道,上述崩溃问题仍然复现
- 每次构建应用前都执行
flutter clean操作,没有任何改善
开发环境信息
- 设备:2020款M1芯片MacBook Pro
- IDE:Android Studio Chipmunk 2021.2.1 Patch 1(2022年5月19日构建版本)
诉求
希望找到可行配置,让Play控制台跳过该GCE x86设备的测试:
- 经查询该设备是Google计算引擎提供的虚拟设备,并未显示在Play控制台的设备目录中
- 已经将所有Intel芯片x86实体设备、Google官方x86模拟器加入测试排除列表,仍然无法规避该设备的测试
- 该应用开发耗时一年多,手动安装到实体设备上运行完全正常,目前上级施加的压力极大,必须在1周内完成应用上架。


内容的提问来源于stack exchange,提问作者Man of Misery
相关产品推荐
相关产品推荐

