无法在Android Studio Emulator上安装APK文件

发布于 2025-02-03 17:48:42 字数 625 浏览 1 评论 0原文

我无法在Android Studio Emulator中安装APK文件(例如 Amazon APK )。我不断遵循错误

APK无法安装。 错误:install_failed_no_matching_abis:无法提取本机库,res = -113

我的模拟器正在运行:android 10.0 x86_64 on pixel 5 pixel 5

搜索时我发现错误发生了,我发现该错误发生在错误不同的架构(预计模拟器中的X86,但APK是ARM64)。

我尝试使用ARM64创建新的虚拟设备,但是即使尝试从Stacoverflow尝试了多个答案并继续获取后,我甚至无法启动该设备

AVD PIXEL_5_API_29_3的仿真过程已终止

有人可以帮助我找到确切的问题吗?

I am unable to install apk files in Android Studio emulator (e.g. Amazon APK). I keep getting following error

The APK failed to install.
Error: INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113

My emulator is running: Android 10.0 x86_64 on Pixel 5

On searching I found that the error occurs mainly due to different architecture (x86 in emulator is expected but apk is arm64).

I tried creating new virtual device with arm64, but I am not even able to start the device even after trying multiple answers from Stacoverflow and keep getting

The emulator process for avd pixel_5_api_29_3 has terminated

Can someone help me find the exact issue?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

几度春秋 2025-02-10 17:48:42

许多应用程序包含用C ++编写的库。 C ++代码将编译到.so文件,该文件每个硬件ABI(应用程序二进制接口)不同。当前的ABIS列表是:

armeabi
armeabiv-v7a
arm64-v8a
x86
x86-64
mips
mips-64

虽然64位CPU可能会运行编译到32位的库,但ARM CPU不会运行编译到Intel CPU的库,而英特尔CPU不会运行编译为ARM CPU的库。

如果您使用NDK编写C ++,则将其编译到ARM和X86,并且您可以在模拟器和真实设备上运行应用程序。

发布应用程序时,您可以故意删除X86库,这使得无法在模拟器上运行。因此,APK不会在模拟器上安装。它将在Intel缺少的本机库上丢弃错误。

A lot of app contains library written in c++. C++ code will be compiled to .so files which is different per hardware ABI (application binary interface). Current list of ABIs are:

armeabi
armeabiv-v7a
arm64-v8a
x86
x86-64
mips
mips-64

While 64 bits cpu may run a library compiled to 32 bits, an ARM cpu won't run a library compiled to intel cpu, and intel cpu won't run a library compiled to ARM cpu.

If you write c++ with ndk, it will compile to both arm and x86 and you can run your app on both emulator and real device.

When you publish your app, you can deliberately remove the x86 libraries, which makes it impossible to run on emulators. And therefore the apk won't install on emulator. It will throw error on native library missing for intel.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文