Targeting SDK Android Q results in Failed to finalize session : INSTALL_FAILED_INVALID_APK: Failed to extract native libraries, res=-2

问题: Once I switch my target api to 'Q' I cannot install the APK on Android Q Emulator. I get error: Failed to finalize session : INSTALL_FAILED_INVALID_APK: Failed to ext...

问题:

Once I switch my target api to 'Q' I cannot install the APK on Android Q Emulator. I get error:

Failed to finalize session : INSTALL_FAILED_INVALID_APK: Failed to extract native libraries, res=-2

Android Studio (v3.3.2) recommends I uninstall apk first. I tried uninstalling apk and I still get the same error. App work if I downgrade target api to 28.


回答1:

This happens because of native libraries. You need to turn of extractNativeLibs in your Application Tag on AndroidManifest.xml

<application
        android:allowBackup="false"
        android:label="@string/app_name"
        android:extractNativeLibs="false"
...
>

If you are using adb to install the apk try adding -t flag

adb install -t <path-to-apk>
  • 发表于 2019-03-17 04:37
  • 阅读 ( 1223 )
  • 分类:sof

条评论

请先 登录 后评论
不写代码的码农
小编

篇文章

作家榜 »

  1. 小编 文章
返回顶部
部分文章转自于网络,若有侵权请联系我们删除