android - error in configuring OpenCV. when i run the app it shows that i have cpp files but they are not using a supprted native build system -
while using opencv library getting error:
error:execution failed task ':app:compiledebugndk'. error: project contains c++ files not using supported native build system. consider using cmake or ndk-build integration stable android gradle plugin: https://developer.android.com/studio/projects/add-native-code.html or use experimental plugin: http://tools.android.com/tech-docs/new-build-system/gradle-experimental.`
when created jnilibs
folder shows me cpp folder , not when run app shows have cpp files not using supprted native build system
i able build opencv git (https://github.com/opencv/opencv/tree/3.1.0) using ndk's cmake yesterday.
export android_ndk=~/android-sdks/ndk-bundle cmake -gninja -dandroid_toolchain_name=clang -dandroid_abi=armeabi-v7a \ -dandroid_arm_neon=on -denable_neon=on -dandroid_stl=c++_static \ -dandroid_cpp_features="rtti exceptions" -dandroid_platform=android-9 \ -dbuild_android_examples=off -dbuild_docs=off -dbuild_fat_java_lib=off \ -dbuild_jasper=off -dbuild_openexr=off -dbuild_package=off \ -dbuild_perf_tests=off -dbuild_tests=off -dbuild_tiff=on \ -dbuild_with_debug_info=off -dbuild_opencv_apps=off -dbuild_opencv_java=off \ -dbuild_opencv_python2=off -dbuild_opencv_world=off \ -dcmake_c_flags_release="-os -dndebug -fvisibility=hidden -ffunction-sections -fstack-protector-all" \ -dcmake_cxx_flags_release="-os -dndebug -fvisibility=hidden -ffunction-sections -fstack-protector-all -fvisibility-inlines-hidden" \ -denable_precompiled_headers=off -dwith_eigen=off -dwith_jasper=off \ -dwith_openexr=off -dwith_tiff=on -dwith_tbb=on -dwith_cuda=off \ -dwith_cufft=off -dwith_webp=off -dcmake_build_with_install_rpath=on \ -dcmake_toolchain_file=$android_ndk/build/cmake/android.toolchain.cmake \ path/to/opencv
that's command line use, similar should work if you're building within android studio. i'm guessing don't need options, instructions given me.
unfortunately there's bug in ndk r13 cmake toolchain needed fixed first: https://github.com/android-ndk/ndk/issues/234. we're publish first beta ndk r14 have fix. shouldn't use betas production, if you're not planning ship right away should reach stable release in february.
Comments
Post a Comment