Flutter 集成百度地图后闪退问题排查记录

1、问题描述

APP集成百度地图后,开发者模式直接连接真机可以打开地图,打包成apk后安装,应用直接闪退

2、手机环境

验证了3个环境
a、Android 6.0
b、Android 9.0
c、Android 8.1

3、问题排查过程

真机USB线连接

image.png

选择Logcat,将日志级别选择未error,日志太多,或者用自定义的过滤规则
先清除日志,后迅速点击手机上的APP,观察日志

2020-02-26 15:06:53.357 13719-13719/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.jzfy.app4bom, PID: 13719
    java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.jzfy.app4bom-egS-0CmvXtrlPd6EZDOVCQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.jzfy.app4bom-egS-0CmvXtrlPd6EZDOVCQ==/lib/arm64, /data/app/com.jzfy.app4bom-egS-0CmvXtrlPd6EZDOVCQ==/base.apk!/lib/arm64-v8a, /system/lib64, /product/lib64]]] couldn't find "libflutter.so"
        at java.lang.Runtime.loadLibrary0(Runtime.java:1012)
        at java.lang.System.loadLibrary(System.java:1672)
        at io.flutter.view.FlutterMain.startInitialization(FlutterMain.java:161)
        at io.flutter.view.FlutterMain.startInitialization(FlutterMain.java:136)
        at io.flutter.app.FlutterApplication.onCreate(FlutterApplication.java:22)
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1162)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6717)
        at android.app.ActivityThread.access$2000(ActivityThread.java:273)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2020)
        at android.os.Handler.dispatchMessage(Handler.java:112)
        at android.os.Looper.loop(Looper.java:216)
        at android.app.ActivityThread.main(ActivityThread.java:7625)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)

发现需要监控的APP报出异常信息,这个很关键,有异常就是有线索,couldn't find "libflutter.so"
这个时候问度娘就可以了

4、解决办法

flutter build apk --target-platform=android-arm64

未明白具体的原因,临时先解决了问题,马克一下

你可能感兴趣的:(Flutter 集成百度地图后闪退问题排查记录)