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

前端 未结 23 2196
悲哀的现实
悲哀的现实 2020-12-13 01:36

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 m

相关标签:
23条回答
  • 2020-12-13 01:52

    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})
              }
          }
      }
      
    0 讨论(0)
  • 2020-12-13 01:55

    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!!!

    0 讨论(0)
  • 2020-12-13 01:55

    The code below worked for me:

    ndk {
         abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86'
    }
    
    0 讨论(0)
  • 2020-12-13 01:55

    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.

    0 讨论(0)
  • 2020-12-13 01:57

    Restarting device solved problem for me (React-native)

    0 讨论(0)
  • 2020-12-13 01:57

    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.

    0 讨论(0)
提交回复
热议问题