当前位置:   article > 正文

Installation failed with message INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries_failed to extract native libraries, res=-113

failed to extract native libraries, res=-113

在模拟器上运行项目出现:

  1. Installation failed with message INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113.
  2. It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then
  3. re-installing.
  4. WARNING: Uninstalling will remove the application data!
  5. Do you want to uninstall the existing application?

翻译:

  1. 安装失败并显示消息INSTALL_FAILED_NO_MATCHING_ABIS:无法提取本机库,res = -113
  2. 可以通过卸载apk的现有版本(如果存在)然后重新安装来解决此问题。
  3. 警告:卸载将删除应用程序数据!
  4. 您要卸载现有的应用程序吗?

模拟器上经常出现,原因是我应用使用了原生库(NDK,Native Lib),这些库的编译目标通常是arm架构的cpu,在x86上运行就会报这样的错误。

解决办法:

  1. android {
  2. compileSdkVersion 26
  3. defaultConfig {
  4. applicationId "com.example.a86131.ocd"
  5. minSdkVersion 21
  6. targetSdkVersion 26
  7. versionCode 1
  8. versionName "1.0"
  9. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  10. }
  11. buildTypes {
  12. release {
  13. minifyEnabled false
  14. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  15. }
  16. }
  17. splits {
  18. abi {
  19. enable true
  20. reset()
  21. include 'armeabi', 'x86', 'armeabi-v7a','x86_64', 'arm64-v8a'
  22. universalApk true
  23. }
  24. }
  25. ···
  26. }

在Module的build.gradle里面增加split{}这一段代码即可。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/代码探险家/article/detail/921084
推荐阅读
相关标签
  

闽ICP备14008679号