Android NDK module not compiling (MIPS and MIPS64 are no longer supported) [duplicate]

梦想与她 提交于 2019-12-24 19:08:09

问题


I'm getting this output on Mac when I try to compile an Android module with native C++ code after update to latest NDK (android-ndk-r17-darwin).

CMake Error at /Users/user1/Library/Android/sdk/ndk- 
bundle/build/cmake/android.toolchain.cmake:312 (message):
Invalid Android ABI: armeabi.  (armeabi is no longer supported.  Use
armeabi-v7a.)
Call Stack (most recent call first):
/Users/user1/Library/Android/sdk/cmake/3.6.4111459/share/cmake- 
3.6/Modules/CMakeDetermineSystem.cmake:98 (include) CMakeLists.txt
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error at /Users/user1/Library/Android/sdk/ndk- 
bundle/build/cmake/android.toolchain.cmake:312 (message):
Invalid Android ABI: mips.  (MIPS and MIPS64 are no longer 
supported.)
Call Stack (most recent call first):
/Users/user1/Library/Android/sdk/cmake/3.6.4111459/share/cmake- 
3.6/Modules/CMakeDetermineSystem.cmake:98 (include)
CMakeLists.txt
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
CMake Error at /Users/user1/Library/Android/sdk/ndk- 
bundle/build/cmake/android.toolchain.cmake:312 (message):
Invalid Android ABI: mips64.  (MIPS and MIPS64 are no longer 
supported.)
Call Stack (most recent call first):
/Users/user1/Library/Android/sdk/cmake/3.6.4111459/share/cmake- 
3.6/Modules/CMakeDetermineSystem.cmake:98 (include)
CMakeLists.txt
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

I've already tried this solution but didn't work. The only solution was to return to the previous NDK.

Project is working fine with the previous version of NDK (android-ndk-r16b-darwin)

Anyone facing the same problem?


回答1:


Here is the solution: https://developer.android.com/studio/build/configure-apk-splits

Known Issue: If you are using Android Plugin for Gradle 3.0.1 or lower with NDK r17 or higher, you may get the following error: Error:ABIs [mips64, armeabi, mips] are not supported for platform. That's because older versions of the plugin still include the unsupported ABIs by default when you build per-ABI APKs. To resolve this issue, either update to the latest version of the plugin, or, in your app's build.gradle file, reset the plugin's default list of ABIs and include only the supported ABIs you want, as shown below:

So or add this to your build.gradle:

defaultConfig {
    // some of your code here
    splits {
        abi {
            ...
            reset()
            include "x86", "armeabi-v7a", "armeabi-v8a", "x86_64"
        }
    }
}

or just update to use the latest Gradle plugin.



来源:https://stackoverflow.com/questions/50387234/android-ndk-module-not-compiling-mips-and-mips64-are-no-longer-supported

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