Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
286 views
in Technique[技术] by (71.8m points)

android - INSTALL_FAILED_CPU_ABI_INCOMPATIBLE on device using intellij

I've seen some questions about this, but none with real answers nor details. Here is my case:

I have an application that uses Google Maps API v2 which works just fine. Recently I found out that I cannot get it installed on this not ARM-based device.

In order to nail down the problem I'm working with Google Maps samples provided with the SDK (sdkextrasgooglegoogle_play_servicessamples)

which gives me the same error message at install time:

Failure [INSTALL_FAILED_CPU_ABI_INCOMPATIBLE]

I get this message only on a real device using Intellij (12.1.1)

It works fine using both Eclipse on real device and using Intellij on the Emulator configured with CPU: Intel Atom (x86)

Any help would be highly appreciated!

UPDATE

As expected, same thing happens with Android Studio

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

By default, IntelliJ assumes that the libs folder in the root of an Android module contains native libraries, even if it just holds jars. Thus, it packages the APK making it look like these are native libraries. I just had a similar issue where my application had no native code and would work on the default emulator, but got the ABI warning when installing on the Genymotion emulator. To fix this, tell IntelliJ (or Android Studio) that your libraries are not native code:

  1. Open File -> Project Structure.
  2. Click Modules on the left side of the window.
  3. For each Android module, expand the dropdown and select the Android subitem.
  4. In the Structure tab on the right, delete contents of the Native libs directory field (you can leave it blank).
  5. Once you've done this for each Android module in the project and applied the changes, you may need to rebuild your project for the changes to take place by choosing Build -> Rebuild Project from IntelliJ's global menu.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...