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

后端 未结 2 926
遇见更好的自我
遇见更好的自我 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'
    } } }
    
    0 讨论(0)
  • 2020-12-01 22:29

    I got this error recently - the cause was a mystery and still is. I reinstalled everything, but I could not get my project to Clean.

    In the end I manually deleted the app/build and app/.externalNativeBuild folders, and the project rebuilt fine, and I was then able to run Clean without errors again.

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