I'm so confused. I cannot compile an apk app. This is what I've done:
Installed Qt with this image (I know it's rather old, I will update
it soon):
qt-windows-opensource-5.1.1-android-x86-win32-offline.exe
Downloaded Android SDK and NDK and added in Options > Android
Now there is a weird warning and no apk output:
Qt versions for architectures mips, arm, x86 are missing. To add the
Qt versions, select Options > Build & Run >Qt versions.
And this is the Build & Run page:
Update:
I followed these steps and the build process finished. But some errors appeared :
http://doc.qt.io/qtcreator/creator-mobile-app-tutorial.html
10:47:21: Running steps for project Quick_test...
10:47:21: Configuration unchanged, skipping qmake step.
10:47:21: Starting: "C:\Qt\Qt5.3.0\Tools\mingw482_32\bin\mingw32-make.exe"
mingw32-make: Nothing to be done for 'first'.
10:47:24: The process "C:\Qt\Qt5.3.0\Tools\mingw482_32\bin\mingw32-make.exe" exited normally.
10:47:24: Starting: "C:\Qt\Qt5.3.0\Tools\mingw482_32\bin\mingw32-make.exe" INSTALL_ROOT="C:\Users\rosta\Documents\Qt Projects\build-Quick_test-Android_for_armeabi_v7a_GCC_4_9_Qt_5_3_0-Release\android-build" install
The system cannot find the path specified.
The system cannot find the path specified.
Makefile:773: recipe for target 'install_target' failed
mingw32-make: *** [install_target] Error 1
10:47:27: The process "C:\Qt\Qt5.3.0\Tools\mingw482_32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project Quick_test (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.3.0))
When executing step 'Copy application data'
10:47:27: Elapsed time: ۰:۰۰:۰۶.
Related
I am trying to use QT to develop android apps. I am using Ubuntu 17.10 and my kit is
qt-opensource-linux-x64-android-5.7.1
NDK is android-ndk-r10e-linux-x86_64
SDK is from android-studio-ide-171.4443003-linux
I am able to build a sample code but trying to deploy I get the following error marked in bold
Generating Android Package
Input file: /home/prajosh/Project/cpp_study/test_1/build-test_1-Android_for_armeabi_v7a_GCC_4_9_Qt_5_7_1-Debug/android-libtest_1.so-deployment-settings.json
Output directory: /home/prajosh/Project/cpp_study/test_1/build-test_1-Android_for_armeabi_v7a_GCC_4_9_Qt_5_7_1-Debug/android-build/
Application binary: /home/prajosh/Project/cpp_study/test_1/build-test_1-Android_for_armeabi_v7a_GCC_4_9_Qt_5_7_1-Debug/libtest_1.so
Android build platform: android-27
**Install to device: No
Cannot find template directory /home/prajosh/Android/Sdk/tools/templates/gradle/wrapper
20:27:26: The process "/home/prajosh/Android/Qt5.7.1/5.7/android_armv7/bin/androiddeployqt" exited with code 3.
Error while building/deploying project test_1 (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.7.1))
When executing step "Build Android APK"**
20:27:26: Elapsed time: 00:00.
Tried installing gradle but gives me an error
**java: symbol lookup error: /usr/lib/jni/libnative-platform-curses.so: undefined symbol: tgetent**
Could not get a correct solution after searches. Could anyone kindly, please point me the mistake?
I'm tring to build the Qt Quick Demo - Calqlatr bundled with Qt for an android device w/ armeabi-v7 but i get a
[install_target] Error 129
looking at the detailed output it shows
[...]
14:48:09: The process "C:\Qtwdroid\Tools\mingw530_32\bin\mingw32-make.exe" exited normally.
14:48:09: Starting: "C:\Qtwdroid\Tools\mingw530_32\bin\mingw32-make.exe" "INSTALL_ROOT=C:/Qtwdroid/Examples/Qt-5.7/quick/demos/build-calqlatr-Android_for_armeabi_v7a_GCC_4_9_Qt_5_7_0-Release/android-build" install
0 [main] sh 2744 sync_with_child: child 6128(0x1A8) died before initialization with status code 0xC0000142
26 [main] sh 2744 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
Makefile:588: recipe for target 'install_target' failed
mingw32-make: *** [install_target] Error 129
14:48:11: The process "C:\Qtwdroid\Tools\mingw530_32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project calqlatr (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.7.0))
When executing step "Copy application data"
14:48:11: Elapsed time: 00:11.
i did followed these steps on the Qt Docs http://doc.qt.io/qt-5/androidgs.html the only difference is that i have jdk 1.8-102
The makefile is avaible in pastebin here: http://pastebin.com/rYyisieu
i did not find this error on the internet, i'm really lost
im new to the subject,
Thanks.
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 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.
I just installed necessitas on ubuntu 13.04 , on the package qtcreator , then i tried to compile the simplest project i could, which is a project just created, and even trying different AVDs with different APIs nothing changes.
It returns:
:-1: error: [install_target] Error 1 (ignored)
and
:-1: error: Can't copy gdbserver from '/home/federico/necessitas/android-ndk/prebuilt/android-arm/gdbserver/gdbserver' to '/home/federico/Android Projects/Hello-World/android/libs/armeabi/gdbserver'
Hope that this can help other people, because I didn't find anything on the web that really could help me.
Here is the compile output:
11:26:52: Running steps for project Hello-World...
11:26:52: Configuration unchanged, skipping qmake step.
11:26:52: Starting: "/usr/bin/make"
make: Nothing to be done for `first'.
11:26:52: The process "/usr/bin/make" exited normally.
11:26:52: Starting: "/usr/bin/make" 'INSTALL_ROOT=/home/federico/Android Projects/Hello-World/android' install
/bin/sh: 1: test: /home/federico/Android: unexpected operator
install -m 755 -p "libHello-World.so" "/home/federico/Android Projects/Hello-World/android/libs/armeabi/libHello-World.so"
install: cannot create regular file '/home/federico/Android Projects/Hello-World/android/libs/armeabi/libHello-World.so': No such file or directory
make: [install_target] Error 1 (ignored)
11:26:52: The process "/usr/bin/make" exited normally.
11:26:52: Copy Qt app & libs to Android package ...
Can't copy gdbserver from '/home/federico/necessitas/android-ndk/prebuilt/android-arm/gdbserver/gdbserver' to '/home/federico/Android Projects/Hello-World/android/libs/armeabi/gdbserver'
Error while building/deploying project Hello-World (kit: Android for arm (GCC 4.6, Qt 4.8.2))
When executing step 'Packaging for Android'
11:26:52: Elapsed time: 00:00.