Flutter发行版APK崩溃,尽管调试版本运行良好

时间:2020-08-26 12:00:07

标签: android flutter apk

我正在研究使用这些软件包的应用程序

  1. flutter_local_notifications:^ 1.4.4 + 2
  2. android_alarm_manager:^ 0.4.5 + 11
  3. 提供者:^ 4.3.1
  4. http:^ 0.12.2
  5. shared_preferences:^ 0.5.8
  6. cached_network_image:^ 2.2.0 + 1
  7. reviews_slider:^ 1.0.5
  8. flutter_screenutil:^ 2.3.0
  9. scroll_to_index:^ 1.0.6

,它在调试版本中可以正常工作,但是当我创建发行版时,它会崩溃The message that I receive

,错误是

Build fingerprint: 'xiaomi/onc/onc:9/PKQ1.181021.001/V11.0.6.0.PFLMIXM:user/release-keys'
Revision: '0'
ABI: 'arm64'
pid: 7383, tid: 7383, name: ry.zonedelivery  >>> com.zonedelivery.zonedelivery <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: '[FATAL:flutter/shell/platform/android/platform_view_android_jni.cc(76)] Check failed: CheckException(env). 
'
    x0  0000000000000000  x1  0000000000001cd7  x2  0000000000000006  x3  0000000000000008
    x4  0000000000800000  x5  0000000000800000  x6  0000000000800000  x7  0000800000000000
    x8  0000000000000083  x9  f6d71a4470a7e267  x10 0000000000000000  x11 fffffffc7ffffbdf
    x12 0000000000000001  x13 0000000000000070  x14 0000000000000000  x15 00006c977aa9f8c0
    x16 0000007f993c42c0  x17 0000007f992f3bc4  x18 0000000000000010  x19 0000000000001cd7
    x20 0000000000001cd7  x21 0000007fcab9d588  x22 0000000000000002  x23 0000000000000095
    x24 0000007efbfc9f80  x25 0000007ef90fe440  x26 0000007efdeb2000  x27 0000007f18a1de00
    x28 0000007efbf87000  x29 0000007fcab9d570
    sp  0000007fcab9d530  lr  0000007f992e7084  pc  0000007f992e70ac
backtrace:
    #00 pc 00000000000220ac  /system/lib64/libc.so (abort+116)
    #01 pc 00000000002af058  /data/app/com.zonedelivery.zonedelivery-4d2RJrQKN4uoup8dF8morw==/lib/arm64/libflutter.so (offset 0x290000)
    #02 pc 00000000002a3828  /data/app/com.zonedelivery.zonedelivery-4d2RJrQKN4uoup8dF8morw==/lib/arm64/libflutter.so (offset 0x290000)
    #03 pc 00000000002a223c  /data/app/com.zonedelivery.zonedelivery-4d2RJrQKN4uoup8dF8morw==/lib/arm64/libflutter.so (offset 0x290000)
    #04 pc 00000000002dda94  /data/app/com.zonedelivery.zonedelivery-4d2RJrQKN4uoup8dF8morw==/lib/arm64/libflutter.so (offset 0x290000)
    #05 pc 00000000002b068c  /data/app/com.zonedelivery.zonedelivery-4d2RJrQKN4uoup8dF8morw==/lib/arm64/libflutter.so (offset 0x290000)
    #06 pc 00000000002b27dc  /data/app/com.zonedelivery.zonedelivery-4d2RJrQKN4uoup8dF8morw==/lib/arm64/libflutter.so (offset 0x290000)
    #07 pc 0000000000014ff8  /system/lib64/libutils.so (android::Looper::pollInner(int)+836)
    #08 pc 0000000000014c18  /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+60)
    #09 pc 0000000000127798  /system/lib64/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long, int)+44)
    #10 pc 0000000000df0f7c  /system/framework/arm64/boot-framework.oat (offset 0xa3d000) (android.media.MediaExtractor.seekTo [DEDUPED]+140)
    #11 pc 00000000017a7920  /system/framework/arm64/boot-framework.oat (offset 0xa3d000) (android.os.MessageQueue.next+240)
    #12 pc 0000000001f7efdc  /system/framework/arm64/boot-framework.oat (offset 0xa3d000) (android.os.Looper.loop+636)
    #13 pc 0000000000f29688  /system/framework/arm64/boot-framework.oat (offset 0xa3d000) (android.app.ActivityThread.main+664)
    #14 pc 000000000055704c  /system/lib64/libart.so (art_quick_invoke_static_stub+604)
    #15 pc 00000000000cfce8  /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+232)
    #16 pc 000000000045dcfc  /system/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104)
    #17 pc 000000000045f750  /system/lib64/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+1440)
    #18 pc 00000000003ef450  /system/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+52)
    #19 pc 000000000078eed4  /system/framework/arm64/boot-core-oj.oat (offset 0x2dc000) (java.lang.Class.getDeclaredMethodInternal [DEDUPED]+180)
    #20 pc 000000000247de18  /system/framework/arm64/boot-framework.oat (offset 0xa3d000) (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+136)
    #21 pc 000000000248a1b8  /system/framework/arm64/boot-framework.oat (offset 0xa3d000) (com.android.internal.os.ZygoteInit.main+2104)
    #22 pc 000000000055704c  /system/lib64/libart.so (art_quick_invoke_static_stub+604)
    #23 pc 00000000000cfce8  /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+232)
    #24 pc 000000000045dcfc  /system/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104)
    #25 pc 000000000045d95c  /system/lib64/libart.so (art::InvokeWithVarArgs(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+424)
    #26 pc 0000000000362d70  /system/lib64/libart.so (art::JNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+652)
    #27 pc 00000000000b287c  /system/lib

1 个答案:

答案 0 :(得分:1)

我意识到问题是R8收缩技术,因为它从 local Notification 包中删除了一些所需的代码,要解决该问题,您需要通过将其添加到proguard-rules文件中来保留所需的代码 他们的文档中提到了here