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

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

Leave a Comment