I m trying to execute handtracking android app using bazel and when I run the build command I get this error :
can you help me fix it please
ERROR: C:/users/admin/mediapipe_repo/mediapipe/mediapipe/framework/formats/BUILD:251:24: C++ compilation of rule '//mediapipe/framework/formats:landmark_cc_proto' failed (Exit 1): clang fai
led: error executing command external/androidndk/ndk/toolchains/llvm/prebuilt/windows-x86_64/bin/clang -gcc-toolchain external/androidndk/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/w
indows-x86_64 -target ... (remaining 57 argument(s) skipped)
clang: error: no such file or directory: '/w'
clang: error: no such file or directory: '/D_USE_MATH_DEFINES'
clang: error: no such file or directory: '/std:c++17'
Target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/handtrackinggpu:handtrackinggpu failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 151.344s, Critical Path: 132.86s
INFO: 160 processes: 128 internal, 31 local, 1 worker.
FAILED: Build did NOT complete successfully
There is a note in the Mediapipe documentation:
Note: building MediaPipe Android apps is still not possible on native Windows. Please do this in WSL instead and see the WSL setup instruction in the next section.
This implies that what you are trying to do is currently not possible, sorry. See also this issue for other people in your situation.
Related
I am trying to follow a tutorial to build an Android app using Bazel as given here:
https://docs.bazel.build/versions/master/tutorial/android-app.html. The app is being built successfully with the command:
bazel build //src/main:app
However, when I try to run the app using the command bazel mobile-install //src/main:app the build is failing with the following error:
INFO: Analyzed target //src/main:app (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /Users/kanzashaikh/examples/android/tutorial/src/main/BUILD:1:15: Installing //src/main:app failed: (Exit 1): incremental_install failed: error executing command bazel-out/darwin-py2-opt-exec-2B5CBBC6/bin/external/bazel_tools/tools/android/incremental_install --output_marker bazel-out/darwin-fastbuild/bin/src/main/app_files/full_deploy_marker --dexmanifest ... (remaining 11 argument(s) skipped)
Traceback (most recent call last):
File "/private/var/tmp/_bazel_kanzashaikh/df06cea5303c222cca918b7a24c9d8ca/execroot/main/bazel-out/darwin-py2-opt-exec-2B5CBBC6/bin/external/bazel_tools/tools/android/incremental_install.runfiles/bazel_tools/tools/android/incremental_install.py", line 25, in
from concurrent import futures
ImportError: No module named concurrent
Target //src/main:app failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.311s, Critical Path: 0.19s
INFO: 3 processes: 3 internal.
FAILED: Build did NOT complete successfully
How to solve this issue?
It looks like bazel is using python2 (the py2 from darwin-py2-opt-exec-2B5CBBC6 from the file paths), but from concurrent import futures in incremental_install.py doesn't work in python2.
If you don't have python3 installed, try installing it and seeing if that fixes the problem.
If you do have python3 installed, then check your bazel version, older versions of bazel might be defaulting to python2.
I am trying to make an app for object detection using tensorflow and I am following the instructions as listed in this website:
https://www.skcript.com/svr/realtime-object-and-face-detection-in-android-using-tensorflow-object-detection-api/
But I have run into build errors.
I am making an android application for detecting objects using tensorflow API and I have followed all steps as mentioned in the above link. I am using Windows 10 for coding, not any Linux distro. I tried building the app using bazel but there are build errors.
Here's the command as instructed from the above website:
bazel build -c opt //tensorflow/contrib/android:libtensorflow_inference.so --crosstool_top=//external:android/crosstool --host_crosstool_top=#bazel_tools//tools/cpp:toolchain --cpu=armeabi-v7a
After running, it starts compiling and does 1069 processes, but after reaching 1068/1069 it displays the following:
ERROR: C:/sri/sritrain/tensorflow-master/tensorflow/contrib/android/BUILD:60:1: Linking of rule '//tensorflow/contrib/android:libtensorflow_inference.so' failed (Exit 1)
external/androidndk/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld: fatal error: bazel-out/armeabi-v7a-opt/bin/tensorflow/core/kernels/libandroid_tensorflow_kernels.lo: pread failed: Invalid argument
clang.exe: error: linker command failed with exit code 1 (use -v to see invocation)
Target //tensorflow/contrib/android:libtensorflow_inference.so failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 3148.512s, Critical Path: 443.26s
INFO: 1045 processes: 1045 local.
FAILED: Build did NOT complete successfully
I scoured through the internet and found a small modification so I typed:
bazel build -c opt //tensorflow/contrib/android:libtensorflow_inference.so --crosstool_top=//external:android/crosstool --host_crosstool_top=#bazel_tools//tools/cpp:toolchain --cpu=armeabi-v7a --cxxopt=-std=c++11
However this returns an error even before the previous command did:
ERROR: C:/sri/sritrain/tensorflow/tensorflow/contrib/android/BUILD:60:1: Linking of rule '//tensorflow/contrib/android:libtensorflow_inference.so' failed (Exit 1)
external/androidndk/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld: fatal error: bazel-out/armeabi-v7a-opt/bin/tensorflow/core/kernels/libandroid_tensorflow_kernels.lo: pread failed: Invalid argument
clang.exe: error: linker command failed with exit code 1 (use -v to see invocation)
Target //tensorflow/contrib/android:libtensorflow_inference.so failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 2787.155s, Critical Path: 244.57s
INFO: 795 processes: 795 local.
FAILED: Build did NOT complete successfully
It is supposed to create a .so file on my computer but it doesn't.
I SOLVED IT!
I found the problem was that i was using the ndk-bundle from under Android Studio's folder and it was the latest ndk. I downloaded an older ndk version android_ndk_r15c and ran the command:
bazel build -c opt //tensorflow/contrib/android:libtensorflow_inference.so --crosstool_top=//external:android/crosstool --host_crosstool_top=#bazel_tools//tools/cpp:toolchain --cpu=armeabi-v7a --cxxopt=-std=c++11
So the build was completed successfully!
I'm trying, on Debian 9.4 x64, to compiling static Python binaries for arm32.
I have initialy:
downloaded the "Gzipped source tarball" source file from:
https://www.python.org/downloads/release/python-365/
extracted source files in: /python3.6.5/
downloaded and extract "binutils-gold-2.29.1-16.1.armv7hl.rpm" by cmd line:
rpm -qlp /python3.6.5/binutils-gold-2.29.1-16.1.armv7hl.rpm
try to compile the binary with this following command:
./configure --build=arm --prefix="$PWD"/out LDFLAGS="-static -static-libgcc -Wl,--unresolved-symbols=ignore-all -Wl,--export-dynamic" CPPFLAGS=-static CXXFLAGS=-static CFLAGS="-Os -static" LDFLAGS=-static LD=ld.gold
And i get this errors:
/usr/bin/ld: BFD assertion (GNU Binutils for Debian) 2.28 as failed ../../bfd/elflink.c:14098
/usr/bin/ld: BFD (GNU Binutils for Debian) 2.28 internal error, aborting at ../../bfd/elf64-x86-64.c:6137 in elf_x86_64_finish_dynamic_symbol
/usr/bin/ld: Thanks to report this anomaly.
collect2: error: ld returned 1 exit status
Makefile:561 : the recipe for the "python" target has failed
-make: *** [python] Error 1
I'm trying to find how i could fix this error, but unfortunatly the support webpage on Python website isn't helpfull (https://wiki.python.org/moin/BuildStatically).
Finally, I would like to compile Python 3.6.5 for all processor platforms on which Android can run (arm32, aarm64, x86_x64, mips, mipsx64,...), to ultimately get a single binary file (i will repeat tasks for all other archs when i will have done with arm32).
So one file for each architectures cited, not multiple files/folders.
In a static way to avoid any dependencies with external libraries.
I chose to carry out the build operations, but if other less hazardous and simpler solutions exist i am taker.
NB: all cmd line has been made through LXTerminal on root session by default.
Thanks by advance for help.
I've heard a lot about Qt so I wanted to give it a try. Unfortunately I ran into a problem at the start..
First of all I set up the environment according to the offical qt guide: http://doc.qt.io/qt-5/androidgs.html
When I trying to build the "cellphone" example which is found on the Welcome page, I'm getting this error which helps me nearly nothing:
:-1: error: [qrc_cellphone.cpp] Error 1
This is the compile output:
20:23:41: Running steps for project cellphone...
20:23:41: Configuration unchanged, skipping qmake step.
20:23:41: Starting: "/usr/bin/make"
/opt/Qt/5.6/android_armv7/bin/rcc -name cellphone ../cellphone/cellphone.qrc -o qrc_cellphone.cpp
RCC: Error in '../cellphone/cellphone.qrc': Cannot find file '../../3rdparty/three.js'
Makefile:509: recipe for target 'qrc_cellphone.cpp' failed
make: *** [qrc_cellphone.cpp] Error 1
20:23:42: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project cellphone (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.6.0))
When executing step "Make"
20:23:42: Elapsed time: 00:00.
When I trying to create and build Qt Quick application I'm getting these two errors:
:-1: error: cannot find -lGL
:-1: error: collect2: error: ld returned 1 exit status
For this one the compile output:
20:26:01: Running steps for project QtQuickTest...
20:26:01: Configuration unchanged, skipping qmake step.
20:26:01: Starting: "/usr/bin/make"
g++ -Wl,-z,origin -Wl,-rpath,\$ORIGIN -Wl,-rpath,/opt/Qt/5.6/gcc_64/lib -o QtQuickTest main.o qrc_qml.o -L/opt/Qt/5.6/gcc_64/lib -lQt5Quick -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lGL -lpthread
/usr/bin/ld: cannot find -lGL
Makefile:198: recipe for target 'QtQuickTest' failed
collect2: error: ld returned 1 exit status
make: *** [QtQuickTest] Error 1
20:26:01: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project QtQuickTest (kit: Desktop Qt 5.6.0 GCC 64bit)
When executing step "Make"
20:26:01: Elapsed time: 00:00.
My os is kubuntu if it matters. What did I miss?
Thanks in advance!
Edit after user12345's answer:
Now at least the Quick project works for desktop. But I'm getting this error message when I'm trying to build for android:
BUILD FAILED
/home/nandor/Programs/android-sdk-linux/tools/ant/build.xml:649: The following error occurred while executing this line:
/home/nandor/Programs/android-sdk-linux/tools/ant/build.xml:694: null returned: 1
Total time: 0 seconds
Building the android package failed!
-- For more information, run this command with --verbose.
16:28:36: The process "/opt/Qt/5.6/android_armv7/bin/androiddeployqt" exited with code 14.
Error while building/deploying project QtQuickTest (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.6.0))
When executing step "Build Android APK"
However the cellphone built in example still giving the same error message. I don't know where should I get or find that ../../3rdparty/three.js file and why this isn't included in the project. Anyway I guess it's not related to the main question I guess however I'm happy if you can answer. :)
Edit 2:
These are the 648-650 lines in the build.xml:
<do-only-if-manifest-hasCode
elseText="hasCode = false. Skipping aidl/renderscript/R.java">
<echo level="info">Handling aidl files...</echo>
And 694:
proguardFile="${out.absolute.dir}/proguard.txt">
I feel we need to go step by step and try to resolve the errors that you are observing. I see that you are using the Qt 5.6.0, I will suggest you to update your Mesa Package on your Ubuntu machine by executing the below command:
sudo apt-get install libgl1-mesa-dev
This should resolve the sort of errors like below that you are observing:
/usr/bin/ld: cannot find -lGL
collect2: error: ld returned 1 exit status
The process "/usr/bin/make" exited with code 2.
After that try to clean and rebuild the desktop version, and see what you find.
Coming to your Android Build error:
My Guess will be that you might have set build settings of your android kit wrongly. I will suggest you to change the Android build SDK to android-23 as shown in the attached picture below:
I was having an error that is Camera not successful invoked on first try (click) so I tried this solution on stackoverflow Phonegap(3.0.0) Camera not successful on first try.
I followed the steps as mentioned in the answer removed android by cordova platform remove android then I run the second command cordova platform add android ;
Now when I use netbeans to run the cordova application on cordova android decvice this error occurs:
exec: ant debug -f "/var/www/mobile/platforms/android/build.xml"
[ 'ant debug -f "/var/www/mobile/platforms/android/build.xml"',
{ [Error: Command failed:
BUILD FAILED
/var/www/adt-bundle-linux-x86_64-20130917/sdk/tools/ant/build.xml:720: The following error occurred while executing this line:
/var/www/adt-bundle-linux-x86_64-20130917/sdk/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.
Total time: 8 seconds
] killed: false, code: 1, signal: null },
'Buildfile: /var/www/mobile/platforms/android/build.xml\n\n-set-mode-check:\n\n-set-debug-files:\n\n-check-env:\n [checkenv] Android SDK Tools Revision 22.3.0\n [checkenv]
.
.
.**LONG TEXT which I removed from the post **
.
\nBUILD FAILED\n/var/www/adt-bundle-linux-x86_64-20130917/sdk/tools/ant/build.xml:720:
The following error occurred while executing this line:\n/var/www/adt-bundle-linux-x86_64- 20130917/sdk/tools/ant/build.xml:734:
Compile failed; see the compiler error output for details.\n\nTotal time: 8 seconds\n' ]
Error executing "ant debug -f "/var/www/mobile/platforms/android/build.xml"":
BUILD FAILED
/var/www/adt-bundle-linux-x86_64-20130917/sdk/tools/ant/build.xml:720: The following error occurred while executing this line:
/var/www/adt-bundle-linux-x86_64-20130917/sdk/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.
Total time: 8 seconds
child_process.spawn(/var/www/mobile/platforms/android/cordova/build,[]) = 2
/usr/local/lib/node_modules/cordova/node_modules/q/q.js:126
throw e;
Error: An error occurred while building the android project.Error executing "ant debug -f "/var/www/mobile/platforms/android/build.xml"":
BUILD FAILED
/var/www/adt-bundle-linux-x86_64-20130917/sdk/tools/ant/build.xml:720: The following error occurred while executing this line:
/var/www/adt-bundle-linux-x86_64-20130917/sdk/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.
Total time: 8 seconds
at ChildProcess.<anonymous> (/usr/local/lib/node_modules/cordova/src/compile.js:65:22)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Socket.<anonymous> (child_process.js:948:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
/var/www/mobile/nbproject/build.xml:256: exec returned: 8
BUILD FAILED (total time: 4 minutes 36 seconds)
any idea about this problem?
I was having a similar issue. I ran ant debug -f "/path/to/project/build.xml" from a separate terminal. It displayed a more specific description of the error (which for me wast that there was a space in the project name). This answer also notes:
config.xml can't have a widget id with number as a first character
after a dot. For example: com.42myapp.test or com.myapp.42test won't
work as well as 42com.myapp.test. It will trigger an error from the
compiler.
I was facing similar issues when i started using the CLI to build apps using cordova and started checking the internet for solutions. While i was at it, i discovered the following things that may help you or anyone else facing the same problem can take some hints from this:
These are some very basic checks that you need to take
1. make sure you have all the required sdk's in place (ANT, Java, Android) and is available when you use these commands on the terminal/command $ ant $ java $ adt. if any of these commands are not found, then you need to get it installed or get the class paths fixed.
make sure your project path does not have spaces. i.e. do not have spaces or special characters in directory names. this issue seems to have been fixed on latest versions of cordova and phonegap, but either cases it is a good practice to follow as ant and java paths could be dependent on the folder names you make.
use -d or -v to get extra debug information on the build process to know where and what is causing the issue. $ cordova build android -d or $ cordova build android -v
Make sure you dont use "#" as the link attribute of author tag in the cordova config.xml on the root of the project. This expects the compiler to interpret a hexadecimal color and fails the build. (this was my problem)
Hope this helps.
er... Happy debugging??
Make sure your Ant is 1.8.0 or later version. Cordova 3.3 demands that.
In the past several days, I found that the conflicting files from Dropbox had a very long name. After renaming it, everything worked.