提示:
Installation failed with message INSTALL_FAILED_NO_MATCHING_ABIS.
It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.
WARNING: Uninstalling will remove the application data!
Do you want to uninstall the existing application?
但是模拟器压根就没有安装这个软件
报错:
$ adb shell pm uninstall package
DELETE_FAILED_INTERNAL_ERROR
Error while Installing APK
解决办法:在build.gradle文件中添加
splits {
abi {
enable true
reset()
include 'x86', 'armeabi-v7a','x86_64'
universalApk true
}
}
原因分析:
引入的部分第三方库,编译后只支持arm架构的机器,而我安装模拟器时为了提高模拟器性能(windows下),安装了x86架构的模拟器,导致无法安装。
模拟器换成arm的就可以解决。
x86的机器市场占有率很低,印象中只用过联想部分2.x的古老机子,部分安卓游戏模拟器,部分桌面版安卓os也是x86架构。如果app不对x86适配支持,就不用管它,换成arm模拟器就可以了。
如果要支持,添加以上代码就行了。studio会生成以上4个架构的对应安装包和一个通用包。
网友评论