What is the reason for the error "Device supports x86, but APK only supports armeabi-v7a"
AndroidAndroid StudioAndroid 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,
then click Select Build Variant... and in 'Build Variants' window select x86Debug(or release)
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.
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:
- make sure that usb debugging is ON
- check your cable connection
- on notification bar check android system notification and touch it for change charging state to file transfer
- 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.