Qt Sensors Qml compile error - android

I am looking at the example application for the Qt Sensors that comes with qt and I've complied it on windows with no errors, but as soon as I try to put it onto my android I get this compile error.
10:41:51: Running steps for project qmlqtsensors...
10:41:51: Configuration unchanged, skipping qmake step.
10:41:51: Starting: "C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\mingw32-make.exe"
mingw32-make: Nothing to be done for 'first'.
10:41:52: The process "C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\mingw32-make.exe" exited normally.
10:41:52: Removing directory C:\Qt\Qt5.2.1\5.2.1\android_x86\examples\sensors\build-qmlqtsensors-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_1-Release\android-build
10:41:52: Starting: "C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\mingw32-make.exe" INSTALL_ROOT="C:\Qt\Qt5.2.1\5.2.1\android_x86\examples\sensors\build-qmlqtsensors-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_1-Release\android-build" install
copy /y "libqmlqtsensors.so" "C:\Qt\Qt5.2.1\5.2.1\android_x86\examples\sensors\build-qmlqtsensors-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_1-Release\android-build\libs\armeabi-v7a\libqmlqtsensors.so"
1 file(s) copied.
The full path of C:C:\Qt\Qt5.2.1\5.2.1\android_x86\examples\sensors\build-qmlqtsensors-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_1-Release\android-build\Qt\Qt5.2.1\5.2.1\android_armv7\examples\qtsensors\qmlqtsensors is too long.
makefile:873: recipe for target 'install_app' failed
mingw32-make: *** [install_app] Error 1
10:41:53: The process "C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project qmlqtsensors (kit: Android for armeabi-v7a (GCC 4.8, Qt 5.2.1))
When executing step 'Copy application data'
10:41:53: Elapsed time: 00:02.
I've looked on google with no avail. Can anyone help me with this problem please?

It seems the error or at least one of them is because the path to your file qmlqtsensors is too long.
The full path of C:C:\Qt\Qt5.2.1\5.2.1\android_x86\examples\sensors\build-qmlqtsensors-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_1-Release\android-build\Qt\Qt5.2.1\5.2.1\android_armv7\examples\qtsensors\qmlqtsensors is too long.
Try to compile and run your project at a different location with a shorter path.

I get the error on this example (and had the same on previous examples some while ago).
My problem turned out to be that when the Makefile is generated, it generates 'wrong' code. It generates stuff like:
mkdir C:$(INSTALL_ROOT)/........
which is fine if $(INSTALL_ROOT) evaluates to a relative path but in fact it resolved to an absolute path, that is:
mkdir C:C:/Qt/.......
So simply edited the Makefile replacing all occurrences of 'C:$(INSTALL_ROOT)' with '$(INSTALL_ROOT)'. It worked for me and hopefully you too.

Related

Error when building Qt5.13.2 from source on Windows for Android

I have a problem while trying to build Qt 5.13.2 from source for Android.
I have used PowerShell on Windows 10.
Before configure command I have set JDK_ROOT path:
set "JDK_ROOT=C:\Program Files\Java\jdk1.8.0_241\bin
This configure command is executed successfully:
..\src\qt5\configure -prefix E:\Qt\Static\Qt5.13.2Android -platform win32-g++ -opengl es2 -xplatform android-clang -android-sdk C:\Users\user\AppData\Local\Android\Sdk -android-ndk C:\Users\user\AppData\Local\Android\Sdk\ndk\21.3.6528147 -nomake tests -nomake examples -opensource -confirm-license
After this I execute:
mingw32-make -j4
and shortly after start the build stops with this output at the end:
del ..\..\..\lib\libQt5Bootstrap.a 2>NUL
ar -rc ..\..\..\lib\libQt5Bootstrap.a #object_script.libQt5Bootstrap.Release
mingw32-make[4]: Leaving directory 'E:/Qt/Static/build-android/qtbase/src/tools/bootstrap'
mingw32-make[3]: Leaving directory 'E:/Qt/Static/build-android/qtbase/src/tools/bootstrap'
mingw32-make[2]: Leaving directory 'E:/Qt/Static/build-android/qtbase/src'
mingw32-make[1]: *** [Makefile:51: sub-src-make_first] Error 2
mingw32-make[1]: Leaving directory 'E:/Qt/Static/build-android/qtbase'
mingw32-make: *** [Makefile:87: module-qtbase-make_first] Error 2
Any suggestion or idea why build stops? Thanks in advance.
UPDATE: Same happens with Qt 5.14.2 and Qt 5.12.5
The documentation for make says that the-j option tells it to divide up the work into multiple "jobs" that run in parallel. That is helpful because it completes faster that way. But the output becomes more confusing as each job writes to the same console and you can't easily tell which output comes from which job. So when you get a compile error, it's often hard to find what the error message actually is. So when I get an error, I usually remove the -j option so that the output stays sequential and I can actually read it.
Note: You wrote in the comments that simply removing this option allowed qt to compile successfully, so that's why I'm writing this as an answer. But I really don't know why that would help. Maybe there's something that was getting compiled out of order with the multiple jobs. Anyway, I'm glad this answer helped you.

android studio, c++, windows, filename too long

I'm building c++ application for android using Android Studio 2.3.3. Build fails with error:
Fatal error: can't create
CMakeFiles/kore.dir/C_/ab/android-native-build/Sources/src/banan/server/serverData/ServerCompound_banan_server_serverdata_ListValue_IdInt_banan_server_serverdata_ServerCompound_serverdata_ServerAchieve.cpp.o:
No such file or directory clang++.exe: error: assembler command failed
with exit code 1 (use -v to see invocation)
The directory in which this file should be created exists and some other files were successfully created there.
I think this is because of path is too long. I've seen such messages previously and moving project to another directory with shorter path have solved the issue. But now I've already done this.
shorter your project location because path maximum 256 char long is accepted.

Android build error (Slim7.1) because of ALSA

Totally new to ROM building! Trying to build slim for the LG K20 Plus TP260 (MSM8917)
I've downloaded LG's source and have tried to assimilate it into Slim's source (basically merging everything but the frameworks folder) and am now trying to build.
But this is the Ninja error I get:
ninja: Entering directory `.'
ninja: error: '/home/android/Desktop/cheap_android_love/out/target/product/generic_arm64/obj/KERNEL_OBJ/usr', needed by '/home/android/Desktop/cheap_android_love/out/target/product/generic_arm64/obj/SHARED_LIBRARIES/libtinyalsa_intermediates/mixer.o', missing and no known rule to make it
build/core/ninja.mk:151: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
I've checked the directory, and the "obj" folder doesn't even exist, so this error seems impossible to me... What files do I need to look at?
After changes to BoardConfig.mk and Kernel.mk makefiles regarding target kernel config and target source, everything goes together fine!

Setup Qt environment for android development

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:

Android build Error on OSX 10.8.5: cp: the -R and -r options may not be specified together

I'm trying to compile Android FS, on OSX 10.8.5, and I'm getting an error that seems related to the fact that the build is being done on OSX.
I did all the brew installations and the compilation is being done on a case-sensitive FS,
yet I'm getting the following:
target arm C++: libwebrtc_apm <= out/target/product/generic/obj/STATIC_LIBRARIES/libwebrtc_apm_intermediates/proto/external/webrtc/src/modules/audio_processing/test/unittest.pb.cc
Symlink: out/target/product/generic/system/vendor/lib/libbltsville_cpu.so -> ./libbltsville_ticpu.so
Symlink: out/target/product/generic/system/vendor/lib/libbltsville_ticpu.so -> ./libbltsville_ticpu.2.1.0.0.so
Install: out/host/darwin-x86/bin/minigzip
cp: the -R and -r options may not be specified together.
make: * [out/target/product/generic/system/vendor/lib/libbltsville_ticpu.so] Error 1
make: * Deleting file `out/target/product/generic/system/vendor/lib/libbltsville_ticpu.so'
make: * Waiting for unfinished jobs....
Any ideas?
I know that -R can solve this issue, but the build is being done by scripts and it'll be very hard to change all the spots where -avr will be -avR!!
I'm looking for a way to replace the cp command to a more linux like command....
So I got an answer for this conundrum:
The Makefile & main.mk located in build/core
Are the rogue files that made the trouble, hope this'll help someone.

Categories

Resources