What is the reason for the error "Device supports x86, but APK only supports armeabi-v7a"

AndroidAndroid Studio

Android Problem Overview


I am playing around with Android Studio by testing some projects out from GitHub and when I try to emulate the apk, it does not let me choose an emulator.

It tells me:

> Device supports x86, but APK only supports armeabi-v7a

Why does it do this?

Android Solutions


Solution 1 - Android

I had the same problem, I checkout the build.gradle from module:app. It turns out that there's a such config:

    ndk {
        abiFilters "armeabi-v7a", "x86"
    }

when I commented all out, everything worked fine.

I was trying to deal with the React Native Android project.

Solution 2 - Android

Turn off USB debugging and turn it back on the hardware device.

Solution 3 - Android

In Android Studio, select the Build menu,

enter image description here

then click Select Build Variant... and in 'Build Variants' window select x86Debug(or release)

enter image description here

PS: Im using Android Studio 2.3 on Mac

Solution 4 - Android

On Linux: File > Invalidate Cache / Restart On phone: Instead Charge this device change to Transfer photos (PTP)

Solution 5 - Android

I had the similar issue and I've resolved it by adding "x86" value to the "abiFilters" list like below -

[Open build.gradle(Module: app) file ] and search for "ndk" in deafultSection and add "x86" to it!

ndk {
            abiFilters "armeabi", "armeabi-v7a", "x86"
        }

Hope it helps!!!

Solution 6 - Android

In my case of Linux machine adb devices showed

List of devices attached 
44b194f5	no permissions

Then restarted the adb server

sudo adb kill-server

and then

sudo adb start-server

then connect your device turn Debugging on and type

adb devices
List of devices attached 
44b194f5    device

Finally was able to run on the device

Solution 7 - Android

You need to reconnect your device and try to turn off/on the developer options.

See Enable developer options and debugging

Solution 8 - Android

In my case my app use some native libraries. Each platform requires the corresponding libs to be built.

So the native lib of x86(or any other) platform is not generated.You must have add an abifilter somewhere:

There are several places where abi filters can be specified:

  • Application.mk add the platform you need like this:

     APP_ABI := armeabi armeabi-v7a x86
    
  • build.gradle

    find abiFilters, and add platform you need like this:

     abiFilters   "armeabi","armeabi-v7a","x86"
    

Solution 9 - Android

The code below worked for me:

ndk {
     abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86'
}

Solution 10 - Android

> Device supports x86, but APK only supports armeabi-v7a)

Sounds like you used an x86 image in the emulator.

Create a separate one. Choose "other images" tab to find arm devices, if you have to.

Or, run on an actual device. The repo you listed is meant to run on a Raspberry Pi 3 / ODroid, I think.

Solution 11 - Android

Can confirm, toggling USB debugging off/on in Developer Options resolved the issue. Maybe even cancel the "Select Deployment Target" window in Android Studio and try to run the app again after toggling USB debugging.

Solution 12 - Android

For me it worked my changing the cable option from

-> Charge Only. 

To

-> Transfer file.

Solution 13 - Android

Just go to device Settings >> Developer Options >> Restore Default Settings then enable USB debugging

Solution 14 - Android

On my physical device, I started getting this. The fix was to go into Developer Settings and turn off and on USB debugging.

Solution 15 - Android

If you use Ubuntu:

  1. make sure that usb debugging is ON
  2. check your cable connection
  3. on notification bar check android system notification and touch it for change charging state to file transfer
  4. now go terminal and type: adb devices after run this command adb restart and your device show in list

Solution 16 - Android

adb kill-server

adb start-server

Its working for me on windows OS.

Solution 17 - Android

Test your code on real phone. If you have still same issue,then import your code again and before this you should update your SDK and create a new emulator with ARM system image.

Solution 18 - Android

Many times this means that you have not granted your laptop/computer access to your device. Take a look at your device and click the "Allow Access" button as well as the debugging permissions.

Solution 19 - Android

Running an AVD using the x86 processor is 10x faster than using the ARM emulator, but most of the time you are only compiling your APK for ARM. To have faster emulation runs using an x86 AVD I had to do the following (for a Cocos2d-x project):

  • app/jni/Android.mk

     APP_ABI := armeabi-v7a:x86
    
  • gradle.properties

     PROP_APP_ABI=armeabi-v7a:x86
    
  • app/build.gradle

     android {
         ...
         defaultConfig {
             ...
             ndk {
                 abiFilters = []
                 abiFilters.addAll(PROP_APP_ABI.split(':').collect{it as String})
             }
         }
     }
    

Solution 20 - Android

Restarting device solved problem for me (React-native)

Solution 21 - Android

It happened to me to after updating the Android Studio. In my case, it happened because of the build setting is not automatically configured into x86Debug-x86. Just change it by opening Build>>Select Build Variant>> Change the build variant option from armeabi-v7a into x86Debug-x86 or whatever you need in the emulator.

Solution 22 - Android

Try enabling Unknown Sources from Security Options. It worked for me.

Solution 23 - Android

i see this

If you’re using CMake for your builds, then check the file \proj.android\gradle.properties, and update the PROP_APP_ABI to include the builds for x86, or alternatively, you could just use the armeabi-v7a or arm64-v8a Android images.

Example: PROP_APP_ABI=armeabi-v7a:arm64-v8a:x86

If you’re not using cmake, then look in \proj.android\app\jni\Application.mk in case you need to change the ABI setting in there.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAlexander IbarraView Question on Stackoverflow
Solution 1 - AndroidBruce LeeView Answer on Stackoverflow
Solution 2 - AndroidNickView Answer on Stackoverflow
Solution 3 - AndroidrafahoroView Answer on Stackoverflow
Solution 4 - AndroidrudicjovanView Answer on Stackoverflow
Solution 5 - AndroidRoopesh ReddyView Answer on Stackoverflow
Solution 6 - AndroidSachin K PissayView Answer on Stackoverflow
Solution 7 - AndroidshizhenView Answer on Stackoverflow
Solution 8 - AndroidyaoView Answer on Stackoverflow
Solution 9 - AndroidC-lio GarciaView Answer on Stackoverflow
Solution 10 - AndroidOneCricketeerView Answer on Stackoverflow
Solution 11 - AndroidVal GeyvandovView Answer on Stackoverflow
Solution 12 - AndroidSushil ChaudharyView Answer on Stackoverflow
Solution 13 - AndroidIman MarashiView Answer on Stackoverflow
Solution 14 - Androidsvguerin3View Answer on Stackoverflow
Solution 15 - Androidmohsen khaliliView Answer on Stackoverflow
Solution 16 - Androidsiddhartha shankarView Answer on Stackoverflow
Solution 17 - AndroidAdiView Answer on Stackoverflow
Solution 18 - AndroidNVAView Answer on Stackoverflow
Solution 19 - AndroidSoothView Answer on Stackoverflow
Solution 20 - AndroidO. BorcuhinView Answer on Stackoverflow
Solution 21 - AndroidRico ValentinoView Answer on Stackoverflow
Solution 22 - AndroidSathish SubramaniView Answer on Stackoverflow
Solution 23 - AndroidDavidUpsView Answer on Stackoverflow