Android Studio CMake Error: Build Command failed

前端 未结 9 1434
孤独总比滥情好
孤独总比滥情好 2020-12-15 20:21

I\'m running into an Error when I open a new project in Android Studio from the Code Samples (Hello JIN). When the Project is opened the following:

Build com         


        
9条回答
  •  感动是毒
    2020-12-15 21:01

    I encountered this problem because I set the wrong path of native-lib.cpp. After changing

    add_library(native-lib SHARED native-lib.cpp)
    

    to

    add_library(native-lib SHARED src/main/jni/native-lib.cpp)
    

    it worked again.

    By the way, this is part of my project's structure.

    CMakeLists.txt
    src
     |__main
          |___jni
               |___native-lib.cpp
    

提交回复
热议问题