android NDK 平台不支持 ABI [armeabi, mips] [英] ABIs [armeabi, mips] are not supported for platform android NDK

查看:33
本文介绍了android NDK 平台不支持 ABI [armeabi, mips]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的项目中使用 JNI 代码和 abiFilters 如下

I am using JNI code in my project with abiFilters like below

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.intel.hellojni"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        externalNativeBuild {
            cmake {
                cppFlags ""
            }
        }
        ndk {
            abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    externalNativeBuild {
        cmake {
            path "CMakeLists.txt"
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:+'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

它在一个系统中运行良好,但在将代码移动到另一个系统后,显示以下导入错误,我已经检查了新创建的项目,它出现了相同的错误

it's working fine in one system but after moving a code to other system,it show below error for import,i have checked with new created project it shoes the same error

ABIs [armeabi, mips] are not supported for platform. Supported ABIs are [armeabi-v7a, arm64-v8a, x86, x86_64].

Build command failed.
Error while executing process F:\sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HC:\Users\Intel\Downloads\TestJNI\app -BC:\Users\Intel\Downloads\TestJNI\app\.externalNativeBuild\cmake\debug\armeabi -DANDROID_ABI=armeabi -DANDROID_PLATFORM=android-15 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Intel\Downloads\TestJNI\app\build\intermediates\cmake\debug\obj\armeabi -DCMAKE_BUILD_TYPE=Debug -DANDROID_NDK=F:\sdk\ndk-bundle -DCMAKE_CXX_FLAGS= -DCMAKE_TOOLCHAIN_FILE=F:\sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=F:\sdk\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja}
 (include)   CMakeLists.txt 
Open File
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

如果我像下面那样删除 armeabimips 那么它就可以工作了

if I remove armeabi and mips like below then it's working

ndk {
       abiFilters "armeabi-v7a", "x86"
}

我已经为 android studio 安装了 CMake 和 NDK.

I have already installed CMake and NDK for android studio.

推荐答案

正如消息所说,NDK 不再支持这些 ABI.这在 NDK r17 变更日志中提到:

As the message says, those ABIs are no longer supported by the NDK. This is mentioned in the NDK r17 changelog:

已删除对 ARMv5 (armeabi)、MIPS 和 MIPS64 的支持.尝试构建这些 ABI 中的任何一个都会导致错误.

Support for ARMv5 (armeabi), MIPS, and MIPS64 has been removed. Attempting to build any of these ABIs will result in an error.

正如其他人所说,没有大量设备可以从针对这些 ABI 中的任何一个中受益.

As others have said, there are not a significant number of devices out there that benefit from targeting any of these ABIs.

这篇关于android NDK 平台不支持 ABI [armeabi, mips]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆