Android 在genymotion设备上安装应用程序,满足:“INSTALL_FAILED_CPU_ABI_INCOMPATIBLE”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20416216/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 02:49:52  来源:igfitidea点击:

Install app on genymotion device ,meet:“INSTALL_FAILED_CPU_ABI_INCOMPATIBLE”

androidsimulatorgenymotion

提问by topxebec

When I install my app on a genymotion simulater device,it can not be installed well,on console I got "INSTALL_FAILED_CPU_ABI_INCOMPATIBLE" I trid another app,it installed fine.I do not know why.

当我在 genymotion 模拟设备上安装我的应用程序时,它无法很好地安装,在控制台上我得到了“INSTALL_FAILED_CPU_ABI_INCOMPATIBLE”我尝试了另一个应用程序,它安装得很好。我不知道为什么。

回答by slvn

The application (certainly a game) must be ARM only. Genymotion is a x86 platform, so compile the application to target x86.

应用程序(当然是游戏)只能是 ARM。Genymotion 是 x86 平台,因此编译应用程序以针对 x86。

You may be able to install ARM support manually : http://forum.xda-developers.com/showthread.php?t=2528952

您可以手动安装 ARM 支持:http: //forum.xda-developers.com/showthread.php?t=2528952

回答by hylander0

If you are using IntelliJ it may be related to the project's default configuration. IntelliJ will assume, unless otherwise specified, that Native libraries will be stored in the Libsfolder. This is usually where developer store their JARlibraries. IntelliJ build process will package up the JARfile into the Native file folder in the APK.

如果您使用的是 IntelliJ,则可能与项目的默认配置有关。除非另有说明,否则 IntelliJ 将假定本机库将存储在该Libs文件夹中。这通常是开发人员存储他们的JAR库的地方。IntelliJ 构建过程会将JAR文件打包到 APK 中的 Native 文件夹中。

If you experiencing this problem, you can find a good How-to:

如果你遇到这个问题,你可以找到一个很好的方法

INSTALL_FAILED_CPU_ABI_INCOMPATIBLE Intellj

INSTALL_FAILED_CPU_ABI_INCOMPATIBLE Intellj

This helped to resolve the issue I had.

这有助于解决我遇到的问题。

回答by FuegoFro

You might want to check out my answer here:

您可能想在这里查看我的答案:

INSTALL_FAILED_CPU_ABI_INCOMPATIBLE on device using intellij

INSTALL_FAILED_CPU_ABI_INCOMPATIBLE 在设备上使用 Intellij

I know it's written for IntelliJ, but you could be running into a similar issue with Eclipse where it thinks that some normal Java files or jar libraries are native code and including it in the compiled APK. A quick way to find out is to open up the final APK (it's just a jar file, so most utilities should be able to decompress it) and make sure that the only things you see are META-INF, res, AndroidManifest.xml, classes.dex, and resources.arsc. It's possible that there are other valid files in a normal Java Android application, but in general if you see anything else in there, particularly a libsfolder, it's probably the result of the compilation process thinking that those other things are native libraries (compiled C/C++ code using the JNI).

我知道它是为 IntelliJ 编写的,但您可能会遇到与 Eclipse 类似的问题,它认为一些普通的 Java 文件或 jar 库是本机代码并将其包含在编译的 APK 中。一个快速的方法,找出是打开最后APK(它只是一个jar文件,所以大多数公用事业应该能够将其解压缩),并确保你看到的唯一的事情是META-INFresAndroidManifest.xmlclasses.dex,和resources.arsc。在普通的 Java Android 应用程序中可能还有其他有效文件,但一般来说,如果您在其中看到其他任何内容,尤其是libs文件夹,则可能是编译过程认为这些其他内容是本机库(编译的 C/使用 JNI 的 C++ 代码)。

If this is the case, you'll need to configure Eclipse to not interpret the Java libraries you're using as native code. Now, I don't personally use Eclipse so I don't know where the proper settings would be, but based off of thisanswer, it looks like Eclipse automatically assumes that the libsfolder in the root of your project contains native libraries. The easiest solution may be to move any Java libraries you are using into a different folder (such as libraries).

如果是这种情况,您需要将 Eclipse 配置为不将您使用的 Java 库解释为本机代码。现在,我个人不使用 Eclipse,所以我不知道正确的设置在哪里,但是根据这个答案,Eclipse 似乎自动假定libs项目根目录中的文件夹包含本机库。最简单的解决方案可能是将您正在使用的任何 Java 库移动到不同的文件夹(例如libraries)。

回答by ltzMaxwell

http://blog.iteedee.com/2014/02/android-install_failed_cpu_abi_incompatible-intellj/The INSTALL_FAILED_CPU_ABI_INCOMPATIBLE error is generated when you attempt to install an android application on a device with an unsupported CPU architecture. This error is usually related to the native libraries that are not packaged up for the device's CPU architecture (ie: x86, ARMv6, ARMv7, etc).

http://blog.iteedee.com/2014/02/android-install_failed_cpu_abi_incompatible-intellj/当您尝试在 CPU 架构不受支持的设备上安装 android 应用程序时,会生成 INSTALL_FAILED_CPU_ABI_INCOMPATIBLE 错误。此错误通常与未针对设备的 CPU 架构(即:x86、ARMv6、ARMv7 等)打包的本机库有关。

Now, if you have an application that doesn't use any native libraries or *.so file you might be scratching your head on this one. If you use IntelliJ IDEA IDE for your android development it might be packaging all of your related .JAR file in to the Native Library file location in your APK.

现在,如果您有一个不使用任何本机库或 *.so 文件的应用程序,您可能会在这个问题上摸不着头脑。如果您使用 IntelliJ IDEA IDE 进行 android 开发,它可能会将所有相关的 .JAR 文件打包到您的 APK 中的 Native Library 文件位置。

回答by Pawan

The cause of the same problem was different in my case.

在我的情况下,同一问题的原因是不同的。

I had added some dependency jars in /libsdirectory of my Android app project. One of these jars had exported library in jar format; i.e. a jar within a jar file. I've noticed that the apk created using jars with such structure are incompatible with x86 based devices (don't know why).

我在/libs我的 Android 应用程序项目的目录中添加了一些依赖 jar 。其中一个 jar 以 jar 格式导出库;即 jar 文件中的 jar。我注意到使用具有这种结构的 jar 创建的 apk 与基于 x86 的设备不兼容(不知道为什么)。