请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

打包的apk安装后无法打开

老师你好,我打包为apk后,安装在手机上,始终打不开,不知道这个是为啥,在打包时提示这个错误

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformNativeLibsWithMergeJniLibsForRelease'.
More than one file was found with OS independent path 'lib/armeabi-v7a/libapp.so'

然后我就在packagingOptions增加了exclude

    packagingOptions{
        // 确保app与asr_plugin都依赖的libflutter.so merge时不冲突
        pickFirst 'lib/x86_64/libflutter.so'
        pickFirst 'lib/x86/libflutter.so'
        pickFirst 'lib/arm64-v8a/libflutter.so'
        exclude 'lib/armeabi-v7a/libflutter.so'
        exclude 'lib/armeabi-v7a/libapp.so'
        exclude 'lib/arm64-v8a/libapp.so'
    }

打包后我发现apk中并未有v7的so图片描述
这是哪里配置错了吗,麻烦帮我看看,谢谢

正在回答

1回答

按照这个配置下:https://git.imooc.com/coding-321/flutter_trip/src/master/android/app/build.gradle#L71

packagingOptions {
// 确保app与asr_plugin都依赖的libflutter.so libapp.so merge时不冲突@https://github.com/card-io/card.io-Android-SDK/issues/186#issuecomment-427552552
pickFirst 'lib/x86_64/libflutter.so'
pickFirst 'lib/x86_64/libapp.so'
pickFirst 'lib/x86/libflutter.so'
pickFirst 'lib/arm64-v8a/libflutter.so'
pickFirst 'lib/arm64-v8a/libapp.so'
pickFirst 'lib/armeabi-v7a/libapp.so'
}


1 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信