NDK - problems after GNUSTL has been removed from the NDK (revision r18)

前端 未结 3 614
谎友^
谎友^ 2020-12-03 20:07

Today I updated my Android Studio NDK to the most recent release 18.0.5002713. After the successful installation process I tried to rerun my app but was not abl

3条回答
  •  情歌与酒
    2020-12-03 20:38

    As @Michael already suggested you can rebuild the OpenCV with libc++.

    To do it:

    cd $OPENCV_SRC
    mkdir build
    cd build
    cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_DIR/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_STL=c++_static  -DCMAKE_BUILD_TYPE=Release -DANDROID_NATIVE_API_LEVEL=android-24 ..
    make install
    cd install #the sdk will be here...
    

    NOTE: tested with "opencv-3.4.1" + ndk18


    Edited by @shizhen

    Verified on macOS, should add .. after cmake command to make below error disappear.

    CMake Error: The source directory "/opencv-3.4.1/build"does not appear to contain CMakeLists.txt.

    Updated as below:

    cd $OPENCV_SRC
    mkdir build
    cd build
    cmake .. -DCMAKE_TOOLCHAIN_FILE=$ANDROID_DIR/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_STL=c++_static  -DCMAKE_BUILD_TYPE=Release -DANDROID_NATIVE_API_LEVEL=android-24 
    make install
    cd install #the sdk will be here...
    

提交回复
热议问题