My NDK project fails to compile with a CPU architecture-related issue

后端 未结 2 939
遇见更好的自我
遇见更好的自我 2020-12-01 21:41

Can someone explain why I get this errors please?

Build command failed.


Error while executing process C:\\Users\\Kevin\\Desktop\\Android\\Sdk\\ndk-bundle\\         


        
2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-01 22:17

    Most likely, you have NDK r17 installed, which does not support armeabi anymore. Your gradle plugin is not aware of this recent change. You must upgrade: in build.gradle, you should have

    buildscript { dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
    } }
    

    and in gradle/wrapper/gradle-wrapper.properties

    distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
    

    But even after upgrade, your build.gradle most likely lacks the abiFilters statement, and therefore your project build is slower and APK larger than necessary.

    You probably only need on ABI in your APK,

    android { defaultConfig { ndk {
        abiFilters 'armeabi-v7a'
    } } }
    

提交回复
热议问题