Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

unable to use libopencv_java4 in android studio with c++

After compilation it is problem to use new opencv 4.0 library in Android studio with c++. libopencv_java4.so (same problem with x86_64, arm7, arm8

send errors during compilation: error: undefined reference to 'cv::dnn::dnn4_v20181205::NMSBoxes(std: error: undefined reference to 'cv::CommandLineParser::CommandLineParser(int, cha opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::ba opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__

what is wrong dev version not working for android? missing compiled version for android i must compile my own library....

unable to use libopencv_java4 in android studio with c++

After compilation it is problem to use new opencv 4.0 library in Android studio with c++. libopencv_java4.so (same problem with x86_64, arm7, arm8

send errors during compilation: error: undefined reference to 'cv::dnn::dnn4_v20181205::NMSBoxes(std: error: undefined reference to 'cv::CommandLineParser::CommandLineParser(int, cha opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::ba opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__

what is wrong dev version not working for android? missing compiled version for android i must compile my own library....

unable to use libopencv_java4 libopencv_java4.so in android studio with c++

After compilation it is problem to use new opencv 4.0 library in Android studio with c++. libopencv_java4.so (same problem with x86_64, arm7, arm8

send errors during compilation: error: undefined reference to 'cv::dnn::dnn4_v20181205::NMSBoxes(std: error: undefined reference to 'cv::CommandLineParser::CommandLineParser(int, cha opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::ba opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__

what is wrong dev version not working for android? missing compiled version for android i must compile my own library....

unable to use libopencv_java4.so in android studio with c++

After compilation it is problem to use new opencv 4.0 library in Android studio with c++. c++, used new library libopencv_java4.so (same problem with x86_64, arm7, arm8arm8)

send errors during compilation: compilation in android studio project: error: undefined reference to 'cv::dnn::dnn4_v20181205::NMSBoxes(std: error: undefined reference to 'cv::CommandLineParser::CommandLineParser(int, cha opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::ba opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__

what is wrong dev version not working for android? missing compiled version for android i must compile my own library....

click to hide/show revision 5
None

updated 2018-12-14 04:24:41 -0600

berak gravatar image

unable to use libopencv_java4.so in android studio with c++

After compilation it is problem to use new opencv 4.0 library in Android studio with c++, used new library libopencv_java4.so (same problem with x86_64, arm7, arm8)

send errors during compilation in android studio project: project:

error: undefined reference to 'cv::dnn::dnn4_v20181205::NMSBoxes(std:
error: undefined reference to 'cv::CommandLineParser::CommandLineParser(int, cha
opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::ba
opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__

'cv::CommandLineParser::getByName(std::__

what is wrong dev version not working for android? missing compiled version for android i must compile my own library....

unable to use libopencv_java4.so in android studio with c++

After compilation it is problem to use new opencv 4.0 library in Android studio with c++, used new library libopencv_java4.so (same problem with x86_64, arm7, arm8)

send errors during compilation in android studio project:

error: undefined reference to 'cv::dnn::dnn4_v20181205::NMSBoxes(std:
error: undefined reference to 'cv::CommandLineParser::CommandLineParser(int, cha
opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::ba
opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__

what is wrong dev version not working for android? missing compiled version for android i must compile my own library....

unable to use libopencv_java4.so in android studio with c++

After compilation it is problem to use new opencv 4.0 library in Android studio with c++, used new library libopencv_java4.so (same problem with x86_64, arm7, arm8)

send errors during compilation in android studio project:

error: undefined reference to 'cv::dnn::dnn4_v20181205::NMSBoxes(std:
error: undefined reference to 'cv::CommandLineParser::CommandLineParser(int, cha
opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::ba
opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__

what is wrong dev version not working for android? missing compiled version for android i must compile my own library....

Full error list from android studio: Executing tasks: [clean, :app:assembleRelease]

Task :clean UP-TO-DATE

Task :app:externalNativeBuildCleanDebug Clean opencv2unity armeabi-v7a,test-lib armeabi-v7a Cleaning... 0 files. Clean test-lib arm64-v8a,opencv2unity arm64-v8a Cleaning... 0 files. Clean test-lib x86,opencv2unity x86 Cleaning... 0 files. Clean opencv2unity x86_64,test-lib x86_64 Cleaning... 0 files.

Task :app:externalNativeBuildCleanRelease Clean opencv2unity armeabi-v7a,test-lib armeabi-v7a Cleaning... 0 files. Clean test-lib arm64-v8a,opencv2unity arm64-v8a Cleaning... 0 files. Clean test-lib x86,opencv2unity x86 Cleaning... 0 files. Clean opencv2unity x86_64,test-lib x86_64 Cleaning... 0 files.

Task :app:clean Task :app:preBuild UP-TO-DATE Task :app:preReleaseBuild UP-TO-DATE Task :app:compileReleaseAidl NO-SOURCE Task :app:compileReleaseRenderscript Task :app:checkReleaseManifest Task :app:generateReleaseBuildConfig Task :app:generateReleaseResValues Task :app:generateReleaseResources Task :app:packageReleaseResources Task :app:processReleaseManifest Task :app:generateReleaseRFile Task :app:prepareLintJar UP-TO-DATE Task :app:generateReleaseSources Task :app:javaPreCompileRelease Task :app:compileReleaseJavaWithJavac Task :app:extractReleaseAnnotations Task :app:mergeReleaseConsumerProguardFiles UP-TO-DATE Task :app:mergeReleaseShaders Task :app:compileReleaseShaders Task :app:generateReleaseAssets Task :app:packageReleaseAssets Task :app:packageReleaseRenderscript NO-SOURCE Task :app:processReleaseJavaRes NO-SOURCE Task :app:transformResourcesWithMergeJavaResForRelease Task :app:transformClassesAndResourcesWithSyncLibJarsForRelease Task :app:generateJsonModelRelease UP-TO-DATE

Task :app:externalNativeBuildRelease Build opencv2unity x86_64 [1/2] Building CXX object ../../../cxx/release/x86_64/CMakeFiles/opencv2uni ty.dir/src/main/cpp/opencv2unity.cpp.o In file included from D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp\opencv2unity.cpp:39: D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/common.h:76:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ 1 warning generated. [2/2] Linking CXX shared library D:\a ndroidprojects\SimpleNativeLibrary\app\build\intermediates\cmake\release\obj\x86_64\libopencv2unity.so FAILED: cmd.exe /C "cd . && D:\androidsdk_cannary\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=x86_64-none-linux-android21 --gcc-toolchain=D:/androidsdk_cannary/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64 -fPIC --sysroot D:/androidsdk_cannary/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -stdlib=libc++ -O2 -DNDEBUG -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,libopencv2unity.so -o D:\androidprojects\SimpleNativeLibrary\app\build\intermediates\cmake\release\obj\x86_64\libopencv2unity.so ../../../cxx/release/x86_64/CMakeFiles/opencv2unity.dir/src/main/cpp/opencv2unity.cpp.o D:/androidprojects/SimpleNativeLibrary/app/src/main/jniLibs/x86_64/libopencv_java4.so -llog -latomic -lm && cd ." D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:169: error: undefined reference to 'cv::dnn::dnn4_v20181205::NMSBoxes(std::__ndk1::vector<cv::rect_<int>, std::__ndk1::allocator<cv::rect_<int> > > const&, std::__ndk1::vector<float, std::__ndk1::allocator<float=""> > const&, float, float, std::__ndk1::vector<int, std::__ndk1::allocator<int=""> >&, float, int)' D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:265: error: undefined reference to 'cv::CommandLineParser::CommandLineParser(int, char const* const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&)' ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void) const' .. /../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void) const' D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:272: error: undefined reference to 'cv::CommandLineParser::CommandLineParser(int, char const const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&)' D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:273: error: undefined reference to 'cv::CommandLineParser::about(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&)' D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:274: error: undefined reference to 'cv::CommandLineParser::has(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&) const' ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void) const' ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void*) const' clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed.

Task :app:externalNativeBuildRelease FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:externalNativeBuildRelease'.

    Build command failed. Error while executing process D:\androidsdk_cannary\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {--build D:\androidprojects\SimpleNativeLibrary\app.externalNativeBuild\cmake\release\x86_64 --target opencv2unity} [1/2] Building CXX object ../../../cxx/release/x86_64/CMakeFiles/opencv2unity.dir/src/main/cpp/opencv2unity.cpp.o In file included from D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp\opencv2unity.cpp:39:

    D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/common.h:76:1: warning: control reaches end of non-void function [-Wreturn-type]

    }

    ^

    1 warning generated.

    [2/2] Linking CXX shared library D:\androidprojects\SimpleNativeLibrary\app\build\intermediates\cmake\release\obj\x86_64\libopencv2unity.so FAILED: cmd.exe /C "cd . && D:\androidsdk_cannary\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=x86_64-none-linux-android21 --gcc-toolchain=D:/androidsdk_cannary/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64 -fPIC --sysroot D:/androidsdk_cannary/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -stdlib=libc++ -O2 -DNDEBUG -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,libopencv2unity.so -o D:\androidprojects\SimpleNativeLibrary\app\build\intermediates\cmake\release\obj\x86_64\libopencv2unity.so ../../../cxx/release/x86_64/CMakeFiles/opencv2unity.dir/src/main/cpp/opencv2unity.cpp.o D:/androidprojects/SimpleNativeLibrary/app/src/main/jniLibs/x86_64/libopencv_java4.so -llog -latomic -lm && cd ." D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:169: error: undefined reference to 'cv::dnn::dnn4_v20181205::NMSBoxes(std::__ndk1::vector<cv::rect_<int>, std::__ndk1::allocator<cv::rect_<int> > > const&, std::__ndk1::vector<float, std::__ndk1::allocator<float=""> > const&, float, float, std::__ndk1::vector<int, std::__ndk1::allocator<int=""> >&, float, int)'

    D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:265: error: undefined reference to 'cv::CommandLineParser::CommandLineParser(int, char const* const*, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&)'

    ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void*) const'

    ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void*) const'

    D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:272: error: undefined reference to 'cv::CommandLineParser::CommandLineParser(int, char const* const*, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&)'

    D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:273: error: undefined reference to 'cv::CommandLineParser::about(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&)'

    D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:274: error: undefined reference to 'cv::CommandLineParser::has(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&) const'

    ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void*) const'

    ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void*) const'

    clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)

    ninja: build stopped: subcommand failed.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/5.1-milestone-1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 5s 23 actionable tasks: 19 executed, 4 up-to-date

unable to use libopencv_java4.so in android studio with c++

After compilation it is problem to use new opencv 4.0 library in Android studio with c++, used new library libopencv_java4.so (same problem with x86_64, arm7, arm8)

send errors during compilation in android studio project:

error: undefined reference to 'cv::dnn::dnn4_v20181205::NMSBoxes(std:
error: undefined reference to 'cv::CommandLineParser::CommandLineParser(int, cha
opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::ba
opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__

what is wrong dev version not working for android? missing compiled version for android i must compile my own library....

Full error list from android studio: Executing tasks: [clean, :app:assembleRelease]

Task :clean UP-TO-DATE

Task :app:externalNativeBuildCleanDebug Clean opencv2unity armeabi-v7a,test-lib armeabi-v7a Cleaning... 0 files. Clean test-lib arm64-v8a,opencv2unity arm64-v8a Cleaning... 0 files. Clean test-lib x86,opencv2unity x86 Cleaning... 0 files. Clean opencv2unity x86_64,test-lib x86_64 Cleaning... 0 files.

Task :app:externalNativeBuildCleanRelease Clean opencv2unity armeabi-v7a,test-lib armeabi-v7a Cleaning... 0 files. Clean test-lib arm64-v8a,opencv2unity arm64-v8a Cleaning... 0 files. Clean test-lib x86,opencv2unity x86 Cleaning... 0 files. Clean opencv2unity x86_64,test-lib x86_64 Cleaning... 0 files.

Task :app:clean Task :app:preBuild UP-TO-DATE Task :app:preReleaseBuild UP-TO-DATE Task :app:compileReleaseAidl NO-SOURCE Task :app:compileReleaseRenderscript Task :app:checkReleaseManifest Task :app:generateReleaseBuildConfig Task :app:generateReleaseResValues Task :app:generateReleaseResources Task :app:packageReleaseResources Task :app:processReleaseManifest Task :app:generateReleaseRFile Task :app:prepareLintJar UP-TO-DATE Task :app:generateReleaseSources Task :app:javaPreCompileRelease Task :app:compileReleaseJavaWithJavac Task :app:extractReleaseAnnotations Task :app:mergeReleaseConsumerProguardFiles UP-TO-DATE Task :app:mergeReleaseShaders Task :app:compileReleaseShaders Task :app:generateReleaseAssets Task :app:packageReleaseAssets Task :app:packageReleaseRenderscript NO-SOURCE Task :app:processReleaseJavaRes NO-SOURCE Task :app:transformResourcesWithMergeJavaResForRelease Task :app:transformClassesAndResourcesWithSyncLibJarsForRelease Task :app:generateJsonModelRelease UP-TO-DATE

Task :app:externalNativeBuildRelease Build opencv2unity x86_64 [1/2] Building CXX object ../../../cxx/release/x86_64/CMakeFiles/opencv2uni ty.dir/src/main/cpp/opencv2unity.cpp.o In file included from D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp\opencv2unity.cpp:39: D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/common.h:76:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ 1 warning generated. [2/2] Linking CXX shared library D:\a ndroidprojects\SimpleNativeLibrary\app\build\intermediates\cmake\release\obj\x86_64\libopencv2unity.so FAILED: cmd.exe /C "cd . && D:\androidsdk_cannary\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=x86_64-none-linux-android21 --gcc-toolchain=D:/androidsdk_cannary/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64 -fPIC --sysroot D:/androidsdk_cannary/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -stdlib=libc++ -O2 -DNDEBUG -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,libopencv2unity.so -o D:\androidprojects\SimpleNativeLibrary\app\build\intermediates\cmake\release\obj\x86_64\libopencv2unity.so ../../../cxx/release/x86_64/CMakeFiles/opencv2unity.dir/src/main/cpp/opencv2unity.cpp.o D:/androidprojects/SimpleNativeLibrary/app/src/main/jniLibs/x86_64/libopencv_java4.so -llog -latomic -lm && cd ." D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:169: error: undefined reference to 'cv::dnn::dnn4_v20181205::NMSBoxes(std::__ndk1::vector<cv::rect_<int>, std::__ndk1::allocator<cv::rect_<int> > > const&, std::__ndk1::vector<float, std::__ndk1::allocator<float=""> > const&, float, float, std::__ndk1::vector<int, std::__ndk1::allocator<int=""> >&, float, int)' D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:265: error: undefined reference to 'cv::CommandLineParser::CommandLineParser(int, char const* const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&)' ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void) const' .. /../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void) const' D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:272: error: undefined reference to 'cv::CommandLineParser::CommandLineParser(int, char const const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&)' D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:273: error: undefined reference to 'cv::CommandLineParser::about(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&)' D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:274: error: undefined reference to 'cv::CommandLineParser::has(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&) const' ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void) const' ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void*) const' clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed.

Task :app:externalNativeBuildRelease FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:externalNativeBuildRelease'.

    Build command failed. Error while executing process D:\androidsdk_cannary\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {--build D:\androidprojects\SimpleNativeLibrary\app.externalNativeBuild\cmake\release\x86_64 --target opencv2unity} [1/2] Building CXX object ../../../cxx/release/x86_64/CMakeFiles/opencv2unity.dir/src/main/cpp/opencv2unity.cpp.o In file included from D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp\opencv2unity.cpp:39:

    D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/common.h:76:1: warning: control reaches end of non-void function [-Wreturn-type]

    }

    ^

    1 warning generated.

    [2/2] Linking CXX shared library D:\androidprojects\SimpleNativeLibrary\app\build\intermediates\cmake\release\obj\x86_64\libopencv2unity.so FAILED: cmd.exe /C "cd . && D:\androidsdk_cannary\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=x86_64-none-linux-android21 --gcc-toolchain=D:/androidsdk_cannary/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64 -fPIC --sysroot D:/androidsdk_cannary/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -stdlib=libc++ -O2 -DNDEBUG -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,libopencv2unity.so -o D:\androidprojects\SimpleNativeLibrary\app\build\intermediates\cmake\release\obj\x86_64\libopencv2unity.so ../../../cxx/release/x86_64/CMakeFiles/opencv2unity.dir/src/main/cpp/opencv2unity.cpp.o D:/androidprojects/SimpleNativeLibrary/app/src/main/jniLibs/x86_64/libopencv_java4.so -llog -latomic -lm && cd ." D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:169: error: undefined reference to 'cv::dnn::dnn4_v20181205::NMSBoxes(std::__ndk1::vector<cv::rect_<int>, std::__ndk1::allocator<cv::rect_<int> > > const&, std::__ndk1::vector<float, std::__ndk1::allocator<float=""> > const&, float, float, std::__ndk1::vector<int, std::__ndk1::allocator<int=""> >&, float, int)'

    D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:265: error: undefined reference to 'cv::CommandLineParser::CommandLineParser(int, char const* const*, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&)'

    ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void*) const'

    ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void*) const'

    D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:272: error: undefined reference to 'cv::CommandLineParser::CommandLineParser(int, char const* const*, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&)'

    D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:273: error: undefined reference to 'cv::CommandLineParser::about(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&)'

    D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:274: error: undefined reference to 'cv::CommandLineParser::has(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&) const'

    ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void*) const'

    ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void*) const'

    clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)

    ninja: build stopped: subcommand failed.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/5.1-milestone-1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 5s 23 actionable tasks: 19 executed, 4 up-to-date

unable to use libopencv_java4.so in android studio with c++

After compilation it is problem to use new opencv 4.0 library in Android studio with c++, c++ (cxx android studio 3.4 canary and 3.2 tested), used new library libopencv_java4.so (same problem with x86_64, arm7, arm8)

send errors during compilation in android studio project:

error: undefined reference to 'cv::dnn::dnn4_v20181205::NMSBoxes(std:
error: undefined reference to 'cv::CommandLineParser::CommandLineParser(int, cha
opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::ba
opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__

what is wrong dev version not working for android? missing compiled version for android i must compile my own library....

Full error list from android studio: Executing tasks: [clean, :app:assembleRelease]

Task :clean UP-TO-DATE

Task :app:externalNativeBuildCleanDebug Clean opencv2unity armeabi-v7a,test-lib armeabi-v7a Cleaning... 0 files. Clean test-lib arm64-v8a,opencv2unity arm64-v8a Cleaning... 0 files. Clean test-lib x86,opencv2unity x86 Cleaning... 0 files. Clean opencv2unity x86_64,test-lib x86_64 Cleaning... 0 files.

Task :app:externalNativeBuildCleanRelease Clean opencv2unity armeabi-v7a,test-lib armeabi-v7a Cleaning... 0 files. Clean test-lib arm64-v8a,opencv2unity arm64-v8a Cleaning... 0 files. Clean test-lib x86,opencv2unity x86 Cleaning... 0 files. Clean opencv2unity x86_64,test-lib x86_64 Cleaning... 0 files.

Task :app:clean Task :app:preBuild UP-TO-DATE Task :app:preReleaseBuild UP-TO-DATE Task :app:compileReleaseAidl NO-SOURCE Task :app:compileReleaseRenderscript Task :app:checkReleaseManifest Task :app:generateReleaseBuildConfig Task :app:generateReleaseResValues Task :app:generateReleaseResources Task :app:packageReleaseResources Task :app:processReleaseManifest Task :app:generateReleaseRFile Task :app:prepareLintJar UP-TO-DATE Task :app:generateReleaseSources Task :app:javaPreCompileRelease Task :app:compileReleaseJavaWithJavac Task :app:extractReleaseAnnotations Task :app:mergeReleaseConsumerProguardFiles UP-TO-DATE Task :app:mergeReleaseShaders Task :app:compileReleaseShaders Task :app:generateReleaseAssets Task :app:packageReleaseAssets Task :app:packageReleaseRenderscript NO-SOURCE Task :app:processReleaseJavaRes NO-SOURCE Task :app:transformResourcesWithMergeJavaResForRelease Task :app:transformClassesAndResourcesWithSyncLibJarsForRelease Task :app:generateJsonModelRelease UP-TO-DATE

Task :app:externalNativeBuildRelease Build opencv2unity x86_64 [1/2] Building CXX object ../../../cxx/release/x86_64/CMakeFiles/opencv2uni ty.dir/src/main/cpp/opencv2unity.cpp.o In file included from D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp\opencv2unity.cpp:39: D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/common.h:76:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ 1 warning generated. [2/2] Linking CXX shared library D:\a ndroidprojects\SimpleNativeLibrary\app\build\intermediates\cmake\release\obj\x86_64\libopencv2unity.so FAILED: cmd.exe /C "cd . && D:\androidsdk_cannary\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=x86_64-none-linux-android21 --gcc-toolchain=D:/androidsdk_cannary/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64 -fPIC --sysroot D:/androidsdk_cannary/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -stdlib=libc++ -O2 -DNDEBUG -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,libopencv2unity.so -o D:\androidprojects\SimpleNativeLibrary\app\build\intermediates\cmake\release\obj\x86_64\libopencv2unity.so ../../../cxx/release/x86_64/CMakeFiles/opencv2unity.dir/src/main/cpp/opencv2unity.cpp.o D:/androidprojects/SimpleNativeLibrary/app/src/main/jniLibs/x86_64/libopencv_java4.so -llog -latomic -lm && cd ." D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:169: error: undefined reference to 'cv::dnn::dnn4_v20181205::NMSBoxes(std::__ndk1::vector<cv::rect_<int>, std::__ndk1::allocator<cv::rect_<int> > > const&, std::__ndk1::vector<float, std::__ndk1::allocator<float=""> > const&, float, float, std::__ndk1::vector<int, std::__ndk1::allocator<int=""> >&, float, int)' D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:265: error: undefined reference to 'cv::CommandLineParser::CommandLineParser(int, char const* const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&)' ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void) const' .. /../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void) const' D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:272: error: undefined reference to 'cv::CommandLineParser::CommandLineParser(int, char const const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&)' D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:273: error: undefined reference to 'cv::CommandLineParser::about(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&)' D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:274: error: undefined reference to 'cv::CommandLineParser::has(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&) const' ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void) const' ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void*) const' clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed.

Task :app:externalNativeBuildRelease FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:externalNativeBuildRelease'.

    Build command failed. Error while executing process D:\androidsdk_cannary\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {--build D:\androidprojects\SimpleNativeLibrary\app.externalNativeBuild\cmake\release\x86_64 --target opencv2unity} [1/2] Building CXX object ../../../cxx/release/x86_64/CMakeFiles/opencv2unity.dir/src/main/cpp/opencv2unity.cpp.o In file included from D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp\opencv2unity.cpp:39:

    D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/common.h:76:1: warning: control reaches end of non-void function [-Wreturn-type]

    }

    ^

    1 warning generated.

    [2/2] Linking CXX shared library D:\androidprojects\SimpleNativeLibrary\app\build\intermediates\cmake\release\obj\x86_64\libopencv2unity.so FAILED: cmd.exe /C "cd . && D:\androidsdk_cannary\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=x86_64-none-linux-android21 --gcc-toolchain=D:/androidsdk_cannary/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64 -fPIC --sysroot D:/androidsdk_cannary/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -stdlib=libc++ -O2 -DNDEBUG -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,libopencv2unity.so -o D:\androidprojects\SimpleNativeLibrary\app\build\intermediates\cmake\release\obj\x86_64\libopencv2unity.so ../../../cxx/release/x86_64/CMakeFiles/opencv2unity.dir/src/main/cpp/opencv2unity.cpp.o D:/androidprojects/SimpleNativeLibrary/app/src/main/jniLibs/x86_64/libopencv_java4.so -llog -latomic -lm && cd ." D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:169: error: undefined reference to 'cv::dnn::dnn4_v20181205::NMSBoxes(std::__ndk1::vector<cv::rect_<int>, std::__ndk1::allocator<cv::rect_<int> > > const&, std::__ndk1::vector<float, std::__ndk1::allocator<float=""> > const&, float, float, std::__ndk1::vector<int, std::__ndk1::allocator<int=""> >&, float, int)'

    D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:265: error: undefined reference to 'cv::CommandLineParser::CommandLineParser(int, char const* const*, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&)'

    ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void*) const'

    ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void*) const'

    D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:272: error: undefined reference to 'cv::CommandLineParser::CommandLineParser(int, char const* const*, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&)'

    D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:273: error: undefined reference to 'cv::CommandLineParser::about(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&)'

    D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:274: error: undefined reference to 'cv::CommandLineParser::has(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&) const'

    ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void*) const'

    ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void*) const'

    clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)

    ninja: build stopped: subcommand failed.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/5.1-milestone-1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 5s 23 actionable tasks: 19 executed, 4 up-to-date

unable to use libopencv_java4.so in android studio with c++

After compilation it is problem to use new opencv 4.0 library in Android studio with c++ (cxx (clang++.exe android studio 3.4 canary and 3.2 tested), used new library libopencv_java4.so (same problem with x86_64, arm7, arm8)

send errors during compilation in android studio project:

error: undefined reference to 'cv::dnn::dnn4_v20181205::NMSBoxes(std:
error: undefined reference to 'cv::CommandLineParser::CommandLineParser(int, cha
opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::ba
opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__

what is wrong dev version not working for android? missing compiled version for android i must compile my own library....

Full error list from android studio: Executing tasks: [clean, :app:assembleRelease]

Task :clean UP-TO-DATE

Task :app:externalNativeBuildCleanDebug Clean opencv2unity armeabi-v7a,test-lib armeabi-v7a Cleaning... 0 files. Clean test-lib arm64-v8a,opencv2unity arm64-v8a Cleaning... 0 files. Clean test-lib x86,opencv2unity x86 Cleaning... 0 files. Clean opencv2unity x86_64,test-lib x86_64 Cleaning... 0 files.

Task :app:externalNativeBuildCleanRelease Clean opencv2unity armeabi-v7a,test-lib armeabi-v7a Cleaning... 0 files. Clean test-lib arm64-v8a,opencv2unity arm64-v8a Cleaning... 0 files. Clean test-lib x86,opencv2unity x86 Cleaning... 0 files. Clean opencv2unity x86_64,test-lib x86_64 Cleaning... 0 files.

Task :app:clean Task :app:preBuild UP-TO-DATE Task :app:preReleaseBuild UP-TO-DATE Task :app:compileReleaseAidl NO-SOURCE Task :app:compileReleaseRenderscript Task :app:checkReleaseManifest Task :app:generateReleaseBuildConfig Task :app:generateReleaseResValues Task :app:generateReleaseResources Task :app:packageReleaseResources Task :app:processReleaseManifest Task :app:generateReleaseRFile Task :app:prepareLintJar UP-TO-DATE Task :app:generateReleaseSources Task :app:javaPreCompileRelease Task :app:compileReleaseJavaWithJavac Task :app:extractReleaseAnnotations Task :app:mergeReleaseConsumerProguardFiles UP-TO-DATE Task :app:mergeReleaseShaders Task :app:compileReleaseShaders Task :app:generateReleaseAssets Task :app:packageReleaseAssets Task :app:packageReleaseRenderscript NO-SOURCE Task :app:processReleaseJavaRes NO-SOURCE Task :app:transformResourcesWithMergeJavaResForRelease Task :app:transformClassesAndResourcesWithSyncLibJarsForRelease Task :app:generateJsonModelRelease UP-TO-DATE

Task :app:externalNativeBuildRelease Build opencv2unity x86_64 [1/2] Building CXX object ../../../cxx/release/x86_64/CMakeFiles/opencv2uni ty.dir/src/main/cpp/opencv2unity.cpp.o In file included from D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp\opencv2unity.cpp:39: D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/common.h:76:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ 1 warning generated. [2/2] Linking CXX shared library D:\a ndroidprojects\SimpleNativeLibrary\app\build\intermediates\cmake\release\obj\x86_64\libopencv2unity.so FAILED: cmd.exe /C "cd . && D:\androidsdk_cannary\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=x86_64-none-linux-android21 --gcc-toolchain=D:/androidsdk_cannary/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64 -fPIC --sysroot D:/androidsdk_cannary/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -stdlib=libc++ -O2 -DNDEBUG -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,libopencv2unity.so -o D:\androidprojects\SimpleNativeLibrary\app\build\intermediates\cmake\release\obj\x86_64\libopencv2unity.so ../../../cxx/release/x86_64/CMakeFiles/opencv2unity.dir/src/main/cpp/opencv2unity.cpp.o D:/androidprojects/SimpleNativeLibrary/app/src/main/jniLibs/x86_64/libopencv_java4.so -llog -latomic -lm && cd ." D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:169: error: undefined reference to 'cv::dnn::dnn4_v20181205::NMSBoxes(std::__ndk1::vector<cv::rect_<int>, std::__ndk1::allocator<cv::rect_<int> > > const&, std::__ndk1::vector<float, std::__ndk1::allocator<float=""> > const&, float, float, std::__ndk1::vector<int, std::__ndk1::allocator<int=""> >&, float, int)' D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:265: error: undefined reference to 'cv::CommandLineParser::CommandLineParser(int, char const* const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&)' ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void) const' .. /../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void) const' D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:272: error: undefined reference to 'cv::CommandLineParser::CommandLineParser(int, char const const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&)' D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:273: error: undefined reference to 'cv::CommandLineParser::about(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&)' D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:274: error: undefined reference to 'cv::CommandLineParser::has(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&) const' ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void) const' ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void*) const' clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed.

Task :app:externalNativeBuildRelease FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:externalNativeBuildRelease'.

    Build command failed. Error while executing process D:\androidsdk_cannary\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {--build D:\androidprojects\SimpleNativeLibrary\app.externalNativeBuild\cmake\release\x86_64 --target opencv2unity} [1/2] Building CXX object ../../../cxx/release/x86_64/CMakeFiles/opencv2unity.dir/src/main/cpp/opencv2unity.cpp.o In file included from D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp\opencv2unity.cpp:39:

    D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/common.h:76:1: warning: control reaches end of non-void function [-Wreturn-type]

    }

    ^

    1 warning generated.

    [2/2] Linking CXX shared library D:\androidprojects\SimpleNativeLibrary\app\build\intermediates\cmake\release\obj\x86_64\libopencv2unity.so FAILED: cmd.exe /C "cd . && D:\androidsdk_cannary\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=x86_64-none-linux-android21 --gcc-toolchain=D:/androidsdk_cannary/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64 -fPIC --sysroot D:/androidsdk_cannary/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -stdlib=libc++ -O2 -DNDEBUG -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,libopencv2unity.so -o D:\androidprojects\SimpleNativeLibrary\app\build\intermediates\cmake\release\obj\x86_64\libopencv2unity.so ../../../cxx/release/x86_64/CMakeFiles/opencv2unity.dir/src/main/cpp/opencv2unity.cpp.o D:/androidprojects/SimpleNativeLibrary/app/src/main/jniLibs/x86_64/libopencv_java4.so -llog -latomic -lm && cd ." D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:169: error: undefined reference to 'cv::dnn::dnn4_v20181205::NMSBoxes(std::__ndk1::vector<cv::rect_<int>, std::__ndk1::allocator<cv::rect_<int> > > const&, std::__ndk1::vector<float, std::__ndk1::allocator<float=""> > const&, float, float, std::__ndk1::vector<int, std::__ndk1::allocator<int=""> >&, float, int)'

    D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:265: error: undefined reference to 'cv::CommandLineParser::CommandLineParser(int, char const* const*, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&)'

    ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void*) const'

    ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void*) const'

    D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:272: error: undefined reference to 'cv::CommandLineParser::CommandLineParser(int, char const* const*, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&)'

    D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:273: error: undefined reference to 'cv::CommandLineParser::about(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&)'

    D:\androidprojects\SimpleNativeLibrary\app\src\main\cpp/opencv2unity.cpp:274: error: undefined reference to 'cv::CommandLineParser::has(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&) const'

    ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void*) const'

    ../../../../src/main/cpp/include\opencv2/core/utility.hpp:897: error: undefined reference to 'cv::CommandLineParser::getByName(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char="">, std::__ndk1::allocator<char> > const&, bool, cv::Param, void*) const'

    clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)

    ninja: build stopped: subcommand failed.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/5.1-milestone-1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 5s 23 actionable tasks: 19 executed, 4 up-to-date