I am having gradle error
lucie961 opened this issue · 2 comments
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':simple_edge_detection:externalNativeBuildDebug'.
Build command failed.
Error while executing process C:\Users\darkb\AppData\Local\Android\sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {--build D:\android projects\flutter project\doc_scanner - Copy\flutter-simple-edge-detection-master\android.cxx\cmake\debug\armeabi-v7a --target native_edge_detection}
[1/4] Building CXX object CMakeFiles/native_edge_detection.dir/cd22b464858e457690eabce6d879f05a/ios/Classes/image_processor.cpp.o
[2/4] Building CXX object CMakeFiles/native_edge_detection.dir/cd22b464858e457690eabce6d879f05a/ios/Classes/native_edge_detection.cpp.o
[3/4] Building CXX object CMakeFiles/native_edge_detection.dir/cd22b464858e457690eabce6d879f05a/ios/Classes/edge_detector.cpp.o
FAILED: C:\Users\darkb\AppData\Local\Android\Sdk\ndk\22.0.7026061\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=armv7-none-linux-androideabi16 --gcc-toolchain=C:/Users/darkb/AppData/Local/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=C:/Users/darkb/AppData/Local/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Dnative_edge_detection_EXPORTS -I../../../../../include -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security -frtti -fexceptions -std=c++11 -O0 -fno-limit-debug-info -fPIC -MD -MT CMakeFiles/native_edge_detection.dir/cd22b464858e457690eabce6d879f05a/ios/Classes/image_processor.cpp.o -MF CMakeFiles\native_edge_detection.dir\cd22b464858e457690eabce6d879f05a\ios\Classes\image_processor.cpp.o.d -o CMakeFiles/native_edge_detection.dir/cd22b464858e457690eabce6d879f05a/ios/Classes/image_processor.cpp.o -c "D:\android projects\flutter project\doc_scanner - Copy\flutter-simple-edge-detection-master\ios\Classes\image_processor.cpp"
In file included from D:\android projects\flutter project\doc_scanner - Copy\flutter-simple-edge-detection-master\ios\Classes\image_processor.cpp:1:
D:\android projects\flutter project\doc_scanner - Copy\flutter-simple-edge-detection-master\ios\Classes/image_processor.hpp:1:10: fatal error: 'opencv2/opencv.hpp' file not found
#include <opencv2/opencv.hpp>
^~~~~~~~~~~~~~~~~~~~
1 error generated.
FAILED: C:\Users\darkb\AppData\Local\Android\Sdk\ndk\22.0.7026061\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=armv7-none-linux-androideabi16 --gcc-toolchain=C:/Users/darkb/AppData/Local/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=C:/Users/darkb/AppData/Local/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Dnative_edge_detection_EXPORTS -I../../../../../include -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security -frtti -fexceptions -std=c++11 -O0 -fno-limit-debug-info -fPIC -MD -MT CMakeFiles/native_edge_detection.dir/cd22b464858e457690eabce6d879f05a/ios/Classes/edge_detector.cpp.o -MF CMakeFiles\native_edge_detection.dir\cd22b464858e457690eabce6d879f05a\ios\Classes\edge_detector.cpp.o.d -o CMakeFiles/native_edge_detection.dir/cd22b464858e457690eabce6d879f05a/ios/Classes/edge_detector.cpp.o -c "D:\android projects\flutter project\doc_scanner - Copy\flutter-simple-edge-detection-master\ios\Classes\edge_detector.cpp"
In file included from D:\android projects\flutter project\doc_scanner - Copy\flutter-simple-edge-detection-master\ios\Classes\edge_detector.cpp:1:
D:\android projects\flutter project\doc_scanner - Copy\flutter-simple-edge-detection-master\ios\Classes/edge_detector.hpp:1:10: fatal error: 'opencv2/opencv.hpp' file not found
#include <opencv2/opencv.hpp>
^~~~~~~~~~~~~~~~~~~~
1 error generated.
FAILED: C:\Users\darkb\AppData\Local\Android\Sdk\ndk\22.0.7026061\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=armv7-none-linux-androideabi16 --gcc-toolchain=C:/Users/darkb/AppData/Local/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=C:/Users/darkb/AppData/Local/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Dnative_edge_detection_EXPORTS -I../../../../../include -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security -frtti -fexceptions -std=c++11 -O0 -fno-limit-debug-info -fPIC -MD -MT CMakeFiles/native_edge_detection.dir/cd22b464858e457690eabce6d879f05a/ios/Classes/native_edge_detection.cpp.o -MF CMakeFiles\native_edge_detection.dir\cd22b464858e457690eabce6d879f05a\ios\Classes\native_edge_detection.cpp.o.d -o CMakeFiles/native_edge_detection.dir/cd22b464858e457690eabce6d879f05a/ios/Classes/native_edge_detection.cpp.o -c "D:\android projects\flutter project\doc_scanner - Copy\flutter-simple-edge-detection-master\ios\Classes\native_edge_detection.cpp"
In file included from D:\android projects\flutter project\doc_scanner - Copy\flutter-simple-edge-detection-master\ios\Classes\native_edge_detection.cpp:2:
D:\android projects\flutter project\doc_scanner - Copy\flutter-simple-edge-detection-master\ios\Classes/edge_detector.hpp:1:10: fatal error: 'opencv2/opencv.hpp' file not found
#include <opencv2/opencv.hpp>
^~~~~~~~~~~~~~~~~~~~
1 error generated.
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
BUILD FAILED in 5s
Exception: Gradle task assembleDebug failed with exit code 1
I also had this error when I built for Android the readme instructions were just a little wrong. If you look at the error
D:\android projects\flutter project\doc_scanner - Copy\flutter-simple-edge-detection-master\ios\Classes/edge_detector.hpp:1:10: fatal error: 'opencv2/opencv.hpp' file not found
it is looking for the opencv.hpp file, that exists in the package you downloaded from the web site, you just need to put it in the place your build script is asking for.
Thank you @natebgurutech. So it seems to be related to putting the opencv related files in the correct directories. If problem perists, please open a new issue and I will investigate.