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

和自甴很熟 提交于 2019-11-27 05:20:30

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'
} } }

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!