问题描述
我有一个使用本地ARM共享库( .so
)的小型应用程序.使用Genymotion时,我可以成功安装ARM转换包(只需删除ZIP文件即可),并且该应用程序可以在基于x86的模拟器上正常运行.
I have a small application that uses a native ARM shared library (.so
). When using Genymotion, I can successfuly install the ARM translation package (just by dropping the ZIP file) and the app runs fine on a x86-based emulator.
现在,我需要在无头linux服务器中运行相同的应用程序,Genymotion不支持该服务器.我下载了官方的Google模拟器和相应的系统映像.从zip存档中提取文件并上传到/system
分区后,我可以运行 houdini --version
,但是该应用程序将无法安装( INSTALL_FAILED_NO_MATCHING_ABIS 代码>).
Now I have the need to run the same app in a headless linux server, which is not supported by Genymotion. I downloaded the official google emulator and corresponding system image. After extracting the files from zip archive and uploading to /system
partition, I can run houdini --version
, however the application won't install (INSTALL_FAILED_NO_MATCHING_ABIS
).
您能指导我如何在官方Google x86模拟器上运行包含ARM库的应用吗?
Can you please guide me how to run the app which contains ARM library on the official google x86 emulator?
推荐答案
houdini --version的输出是什么?
What is the output of houdini --version ?
在安装应用程序时,PackageManager会检查应用程序的ABI(apk .so文件中包含哪些库)和系统的ABI(系统支持的库类型)
When you install applications PackageManager checks ABI of the app(which libraries are contained in the apk .so files) and the ABI of the system (which type of libraries system supports)
如果您运行 getprop |grep -i abi
getprop | grep -i abi
[ro.product.cpu.abi]: [x86]
[ro.product.cpu.abilist]: [x86,armeabi-v7a,armeabi]
[ro.product.cpu.abilist32]: [x86,armeabi-v7a,armeabi]
[ro.product.cpu.abilist64]: []
在此输出中,系统支持x86,armeabi-v7a和armeabi类型的32位.so文件.
In this output, the system supports 32 bit .so files of x86, armeabi-v7a and armeabi type.
请在您的设备上检查此输出.在此输出中最有可能不会提及armeabi.
Please check this output on your device. Most probably there will be no mention of armeabi in this output.
因此,当PackageManager尝试安装ARM应用并检查不支持此ABI时,它将引发 INSTALL_FAILED_NO_MATCHING_ABIS
错误.
So when PackageManager tries to install ARM app and checks that this ABI is not supported, it throws INSTALL_FAILED_NO_MATCHING_ABIS
error.
因此,您将必须修复系统ABI.编辑/system/build.prop
文件,以在 ro.product.cpu.abilist和ro.product.cpu.abilist32
中添加ARM支持.如果您运行的是64位Android,则必须更改这些行.
So you will have to fix the system ABIs.Edit the file /system/build.prop
to add ARM support, in ro.product.cpu.abilist and ro.product.cpu.abilist32
.If you are running 64 bit Android, you will have to change these lines.
ro.product.cpu.abilist=x86_64,x86,arm64-v8a,armeabi-v7a,armeabi
ro.product.cpu.abilist32=x86,armeabi-v7a,armeabi
ro.product.cpu.abilist64=x86_64,arm64-v8a
这篇关于在官方的Android仿真器上安装ARM Translation(libhoudini)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!