Unable to run the project in Linux Mint
mlopez0 opened this issue · 3 comments
Hi Guys.
I hope someone can give me a hand to fix this issue.
I'm using Linux Mint, following along the tutorial I download the OpenCV packs and extract them into the project directory as described.
When I use flutter run I get the following error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':simple_edge_detection:externalNativeBuildDebug'.
> Build command failed.
Error while executing process /home/linuxUser/Android/Sdk/cmake/3.6.4111459/bin/cmake with arguments {--build /home/linuxUser/Desktop/flutter-simple-edge-detection/android/.cxx/cmake/debug/armeabi-v7a --target native_edge_detection}
[1/4] Building CXX object CMakeFiles/native_edge_detection.dir/home/linuxUser/Desktop/flutter-simple-edge-detection/ios/Classes/native_edge_detection.cpp.o
[2/4] Building CXX object CMakeFiles/native_edge_detection.dir/home/linuxUser/Desktop/flutter-simple-edge-detection/ios/Classes/edge_detector.cpp.o
[3/4] Building CXX object CMakeFiles/native_edge_detection.dir/home/linuxUser/Desktop/flutter-simple-edge-detection/ios/Classes/image_processor.cpp.o
FAILED: /home/linuxUser/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=armv7-none-linux-androideabi16 --gcc-toolchain=/home/linuxUser/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/home/linuxUser/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-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/home/linuxUser/Desktop/flutter-simple-edge-detection/ios/Classes/native_edge_detection.cpp.o -MF CMakeFiles/native_edge_detection.dir/home/linuxUser/Desktop/flutter-simple-edge-detection/ios/Classes/native_edge_detection.cpp.o.d -o CMakeFiles/native_edge_detection.dir/home/linuxUser/Desktop/flutter-simple-edge-detection/ios/Classes/native_edge_detection.cpp.o -c /home/linuxUser/Desktop/flutter-simple-edge-detection/ios/Classes/native_edge_detection.cpp
In file included from /home/linuxUser/Desktop/flutter-simple-edge-detection/ios/Classes/native_edge_detection.cpp:2:
In file included from /home/linuxUser/Desktop/flutter-simple-edge-detection/ios/Classes/edge_detector.hpp:1:
In file included from ../../../../../include/opencv2/opencv.hpp:52:
In file included from ../../../../../include/opencv2/core.hpp:52:
In file included from ../../../../../include/opencv2/core/cvdef.h:183:
In file included from /snap/flutter/current/usr/include/c++/8/limits:42:
In file included from /snap/flutter/current/usr/include/x86_64-linux-gnu/c++/8/bits/c++config.h:508:
In file included from /snap/flutter/current/usr/include/x86_64-linux-gnu/c++/8/bits/os_defines.h:39:
In file included from /snap/flutter/current/usr/include/features.h:448:
/snap/flutter/current/usr/include/x86_64-linux-gnu/gnu/stubs.h:7:11: fatal error: 'gnu/stubs-32.h' file not found
# include <gnu/stubs-32.h>
^~~~~~~~~~~~~~~~
1 error generated.
FAILED: /home/linuxUser/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=armv7-none-linux-androideabi16 --gcc-toolchain=/home/linuxUser/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/home/linuxUser/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-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/home/linuxUser/Desktop/flutter-simple-edge-detection/ios/Classes/edge_detector.cpp.o -MF CMakeFiles/native_edge_detection.dir/home/linuxUser/Desktop/flutter-simple-edge-detection/ios/Classes/edge_detector.cpp.o.d -o CMakeFiles/native_edge_detection.dir/home/linuxUser/Desktop/flutter-simple-edge-detection/ios/Classes/edge_detector.cpp.o -c /home/linuxUser/Desktop/flutter-simple-edge-detection/ios/Classes/edge_detector.cpp
In file included from /home/linuxUser/Desktop/flutter-simple-edge-detection/ios/Classes/edge_detector.cpp:1:
In file included from /home/linuxUser/Desktop/flutter-simple-edge-detection/ios/Classes/edge_detector.hpp:1:
In file included from ../../../../../include/opencv2/opencv.hpp:52:
In file included from ../../../../../include/opencv2/core.hpp:52:
In file included from ../../../../../include/opencv2/core/cvdef.h:183:
In file included from /snap/flutter/current/usr/include/c++/8/limits:42:
In file included from /snap/flutter/current/usr/include/x86_64-linux-gnu/c++/8/bits/c++config.h:508:
In file included from /snap/flutter/current/usr/include/x86_64-linux-gnu/c++/8/bits/os_defines.h:39:
In file included from /snap/flutter/current/usr/include/features.h:448:
/snap/flutter/current/usr/include/x86_64-linux-gnu/gnu/stubs.h:7:11: fatal error: 'gnu/stubs-32.h' file not found
# include <gnu/stubs-32.h>
^~~~~~~~~~~~~~~~
1 error generated.
FAILED: /home/linuxUser/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=armv7-none-linux-androideabi16 --gcc-toolchain=/home/linuxUser/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/home/linuxUser/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-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/home/linuxUser/Desktop/flutter-simple-edge-detection/ios/Classes/image_processor.cpp.o -MF CMakeFiles/native_edge_detection.dir/home/linuxUser/Desktop/flutter-simple-edge-detection/ios/Classes/image_processor.cpp.o.d -o CMakeFiles/native_edge_detection.dir/home/linuxUser/Desktop/flutter-simple-edge-detection/ios/Classes/image_processor.cpp.o -c /home/linuxUser/Desktop/flutter-simple-edge-detection/ios/Classes/image_processor.cpp
In file included from /home/linuxUser/Desktop/flutter-simple-edge-detection/ios/Classes/image_processor.cpp:1:
In file included from /home/linuxUser/Desktop/flutter-simple-edge-detection/ios/Classes/image_processor.hpp:1:
In file included from ../../../../../include/opencv2/opencv.hpp:52:
In file included from ../../../../../include/opencv2/core.hpp:52:
In file included from ../../../../../include/opencv2/core/cvdef.h:183:
In file included from /snap/flutter/current/usr/include/c++/8/limits:42:
In file included from /snap/flutter/current/usr/include/x86_64-linux-gnu/c++/8/bits/c++config.h:508:
In file included from /snap/flutter/current/usr/include/x86_64-linux-gnu/c++/8/bits/os_defines.h:39:
In file included from /snap/flutter/current/usr/include/features.h:448:
/snap/flutter/current/usr/include/x86_64-linux-gnu/gnu/stubs.h:7:11: fatal error: 'gnu/stubs-32.h' file not found
# include <gnu/stubs-32.h>
^~~~~~~~~~~~~~~~
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 4s
Using google I searched for fatal error: 'gnu/stubs-32.h' file not found
I followed almost all solutions that I found on stackOverflow:
sudo apt-get install libc6-dev-i38
export LIBRARY_PATH=/usr/lib/$(gcc -print-multiarch)
export C_INCLUDE_PATH=/usr/include/$(gcc -print-multiarch)
export CPLUS_INCLUDE_PATH=/usr/include/$(gcc -print-multiarch)
sudo apt-get install g++-multilib
sudo apt-get install libc6-dev
But the issue persist.
I also created an small c program like this:
#include <stdio.h>
# include <gnu/stubs-32.h>
int main(){
printf("Hello");
return 0;
}
And I was able to run it.
I have dual boot in my Computer, I test the app on Windows and I was able to run the project, but I need it up and Running in Linux. Any ideas?
Thanks in advance.
Well, that's strange. I'm having it run on Linux (Ubuntu 20.04.2 LTS).
Just to rule out errors connected to copying the opencv files in the correct paths: do you get the same error when you freshly clone the repo and do nothing else (no copying of opencv files)?
@mlopez0
Are there any updates? Have you managed to make it run?
Well, that's strange. I'm having it run on Linux (Ubuntu 20.04.2 LTS).
Just to rule out errors connected to copying the opencv files in the correct paths: do you get the same error when you freshly clone the repo and do nothing else (no copying of opencv files)?
No, I get a error related to "missing files"
@mlopez0
Are there any updates? Have you managed to make it run?
I didn't manage to make it run, which was really strange, also I switched from Linux to Mac.
So, somehow I fixed the issue 🤣