1. 程式人生 > 其它 >Consider using CMake or ndk-build integration. For more information, go to

Consider using CMake or ndk-build integration. For more information, go to

技術標籤:androidandroid studiocmake

錯誤提示

Error: Your project contains C++ files but it is not using a supported native build system.
Consider using CMake or ndk-build integration. For more information, go to:
https://d.android.com/r/studio-ui/add-native-code.html
Alternatively, you can use the experimental plugin:

https://developer.android.com/r/tools/experimental-plugin.html

原因:

在 /app/src/main/ 下建立了 jni檔案,並建立了Android.mk檔案

檔案內容

LOCAL_CERTIFICATE := platform
LOCAL_CERTIFICATE := shared

make project 報錯

解決建議:在 build.gradle 中新增以下程式碼

android {
  ........

      sourceSets {
        main {
            jni.srcDirs = []
        }
    }
}