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

前端 未结 23 2354
悲哀的现实
悲哀的现实 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})
              }
          }
      }
      

提交回复
热议问题