[SOLVED] Qt 5.2 - Beta : Deploying to Android
-
Hi all,
I've been trying recently to develop for Android using Qt ports for it. But I've been having problems while deploying to device ( http://qt-project.org/forums/viewthread/33592/ ) .
With the release of Qt 5.2 - Beta I decided to give it a try again. I still cannot deploy it to my device, but now I, at least, have some more meaningful error messages :
@20:56:47: Running steps for project accelbubble...
20:56:47: Configuration unchanged, skipping qmake step.
20:56:47: Starting: "/usr/bin/make"
make: Nothing to be done for `first'.
20:56:47: The process "/usr/bin/make" exited normally.
20:56:47: Removing directory /home/guilhermebrant/workspace/accelbubble/build-accelbubble-Android_for_armeabi_GCC_4_8_Qt_5_2_0-Release/android
20:56:47: Starting: "/usr/bin/make" INSTALL_ROOT=/home/guilhermebrant/workspace/accelbubble/build-accelbubble-Android_for_armeabi_GCC_4_8_Qt_5_2_0-Release/android install
install -m 755 -p "libaccelbubble.so" "/home/guilhermebrant/workspace/accelbubble/build-accelbubble-Android_for_armeabi_GCC_4_8_Qt_5_2_0-Release/android/libs/armeabi/libaccelbubble.so"
20:56:48: The process "/usr/bin/make" exited normally.
20:56:48: Starting: "/home/guilhermebrant/Qt5.2.0/5.2.0-beta1/android_armv5/bin/androiddeployqt" --input /home/guilhermebrant/workspace/accelbubble/build-accelbubble-Android_for_armeabi_GCC_4_8_Qt_5_2_0-Release/android-libaccelbubble.so-deployment-settings.json --output /home/guilhermebrant/workspace/accelbubble/build-accelbubble-Android_for_armeabi_GCC_4_8_Qt_5_2_0-Release/android --deployment bundled --install --ant /usr/bin/ant --android-platform android-10 --jdk /usr/lib/jvm/java-6-openjdk-amd64 --device 0123456789ABCDEF
20:56:48: Pulling files necessary for debugging.
20:56:48: Package deploy: Running command '/home/guilhermebrant/android-sdk-linux/platform-tools/adb -s 0123456789ABCDEF pull /system/bin/app_process /home/guilhermebrant/workspace/accelbubble/build-accelbubble-Android_for_armeabi_GCC_4_8_Qt_5_2_0-Release/app_process'.
20:56:48: Package deploy: Running command '/home/guilhermebrant/android-sdk-linux/platform-tools/adb -s 0123456789ABCDEF pull /system/lib/libc.so /home/guilhermebrant/workspace/accelbubble/build-accelbubble-Android_for_armeabi_GCC_4_8_Qt_5_2_0-Release/libc.so'.BUILD FAILED
/home/guilhermebrant/android-sdk-linux/tools/ant/build.xml:653: The following error occurred while executing this line:
/home/guilhermebrant/android-sdk-linux/tools/ant/build.xml:698: null returned: 1Total time: 6 seconds
Generating Android Package
Input file: /home/guilhermebrant/workspace/accelbubble/build-accelbubble-Android_for_armeabi_GCC_4_8_Qt_5_2_0-Release/android-libaccelbubble.so-deployment-settings.json
Output directory: /home/guilhermebrant/workspace/accelbubble/build-accelbubble-Android_for_armeabi_GCC_4_8_Qt_5_2_0-Release/android
Application binary: /home/guilhermebrant/workspace/accelbubble/build-accelbubble-Android_for_armeabi_GCC_4_8_Qt_5_2_0-Release/libaccelbubble.so
Android build platform: android-10
Install to device: 0123456789ABCDEF
[subant] No sub-builds to iterate on
Building the android package failed!
-- For more information, run this command with --verbose.
20:57:01: The process "/home/guilhermebrant/Qt5.2.0/5.2.0-beta1/android_armv5/bin/androiddeployqt" exited with code 14.
Error while building/deploying project accelbubble (kit: Android for armeabi (GCC 4.8, Qt 5.2.0))
When executing step 'Deploy to Android device'
20:57:01: Elapsed time: 00:14.@Can anybody help me out now?
Thanks in advance,
lgb. -
It can be the same error which I have had.
Download apache-ant(I have apache-ant-1.9.2) and oracle java JDK(my is jdk1.6.0_45) extract them somewhere and in QtCreator Settings -> Android, point "ant" and "JDK-Path" to the extracted folders.Here is how it look in my config:
!http://vip2006.net/android_qtcreator.jpg(QtCreator Android)!Don't forget to clean project and rebuild, maybe you will need to recreate android folder.
-
I'm also getting a "code 14" with Qt5.2-beta. Seems to compile okay it's the packaging where it falls down...
@
BUILD FAILED
C:\android\adt-bundle-windows-x86_64-20130917\sdk\tools\ant\build.xml:892: The following error occurred while executing this line:
C:\android\adt-bundle-windows-x86_64-20130917\sdk\tools\ant\build.xml:894: The following error occurred while executing this line:
C:\android\adt-bundle-windows-x86_64-20130917\sdk\tools\ant\build.xml:906: The following error occurred while executing this line:
C:\android\adt-bundle-windows-x86_64-20130917\sdk\tools\ant\build.xml:284: null returned: 2Total time: 16 seconds
Generating Android Package
Input file: [myprojectfilepath].so-deployment-settings.json
Output directory: [myprojectfilepath]
Application binary: [myprojectfilepath].so
Android build platform: android-18
Install to device: [mydeviceid]
[subant] No sub-builds to iterate on
[javac] Note: [myprojectfilepath]\bindings\QtActivity.java uses or overrides a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
Building the android package failed!
-- For more information, run this command with --verbose.
23:10:13: The process "C:\Qt\Qt5.2.0\5.2.0-beta1\android_armv7\bin\androiddeployqt.exe" exited with code 14.
Error while building/deploying project [myprojectname] (kit: Android for armeabi-v7a (GCC 4.8, Qt 5.2.0))
When executing step 'Deploy to Android device'
23:10:13: Elapsed time: 08:11.
@ -
Looks like it can't deploy because it can't build it:
@
BUILD FAILED
C:\android\adt-bundle-windows-x86_64-20130917\sdk\tools\ant\build.xml:892: The following error occurred while executing this line:
C:\android\adt-bundle-windows-x86_64-20130917\sdk\tools\ant\build.xml:894: The following error occurred while executing this line:
C:\android\adt-bundle-windows-x86_64-20130917\sdk\tools\ant\build.xml:906: The following error occurred while executing this line:
C:\android\adt-bundle-windows-x86_64-20130917\sdk\tools\ant\build.xml:284: null returned: 2
@You need to fix this first
-
I got the same error too.
And I found a strange correlation between the error of the first post and the level of android API setted into the project config.Essentialy, everytime I set an android level different from 14 and 17 I'll get that error.
If I set android level api to 14 or to 17 everything compiles and deploy without problems.Can you try and let me know if the same thing happens to you ??
-
Thanks - tried with Level 17 but no luck yet.
The code compiles fine so I've switched on verbose output for deployment (Projects Menu - Build&Run-Deploy Configurations) and on deployment it seems to be saying my package is named 'QtApp':
@"C:/android/adt-bundle-windows-x86_64-20130917/sdk/tools/android.bat" update project --path [myprojectpath] --target android-17 --name QtApp@
Also, later on the ant.bat parameters seem to refer to it as 'QtApp' (which is not the case):
@-setup:
[echo] Project Name: QtApp
[gettype] Project Type: Application
@I'm not sure where it gets this name from so am investigating this part.
-
I deleted the android directory where the package was being created. The package was then created again from scratch and the package now deploys. There must have been some Qt5.1.1 build files left in there.
-
Same error on Windows 8
-
I have the same problem.
My environment:
- Windows 8 64 bits
- Qt 5.2 beta, MinGW ( default binary from Qt site )
- AndroidSDK: x86_64 - 20130917
- AndroidNDK: r9 x86_64
- ApacheAnt: 1.9.2
Error:
00:22:16: Running steps for project HelloAndroid...
00:22:16: Configuration unchanged, skipping qmake step.
00:22:16: Starting: "D:\Qt\Qt5.2.0_android\Tools\mingw48_32\bin\mingw32-make.exe"
mingw32-make: Nothing to be done for 'first'.
00:22:16: The process "D:\Qt\Qt5.2.0_android\Tools\mingw48_32\bin\mingw32-make.exe" exited normally.
00:22:16: Starting: "D:\Qt\Qt5.2.0_android\Tools\mingw48_32\bin\mingw32-make.exe" INSTALL_ROOT="D:/build-HelloAndroid-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_0-Debug/android" install
cp -f "libHelloAndroid.so" "D:/build-HelloAndroid-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_0-Debug/android/libs/armeabi-v7a/libHelloAndroid.so"
00:22:17: The process "D:\Qt\Qt5.2.0_android\Tools\mingw48_32\bin\mingw32-make.exe" exited normally.
00:23:05: Starting: "D:\Qt\Qt5.2.0_android\5.2.0-beta1\android_armv7\bin\androiddeployqt.exe" --input D:/build-HelloAndroid-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_0-Debug/android-libHelloAndroid.so-deployment-settings.json --output D:/build-HelloAndroid-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_0-Debug/android --deployment bundled --install --ant D:/Android/ApacheAnt/bin/ant.bat --android-platform android-18 --jdk "D:/Program Files/Java/jdk1.7.0_45" --device emulator-5554
00:23:05: Pulling files necessary for debugging.
00:23:05: Package deploy: Running command 'D:/Android/AndroidSDK/sdk/platform-tools/adb.exe -s emulator-5554 pull /system/bin/app_process D:/build-HelloAndroid-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_0-Debug/app_process'.
00:23:06: Package deploy: Running command 'D:/Android/AndroidSDK/sdk/platform-tools/adb.exe -s emulator-5554 pull /system/lib/libc.so D:/build-HelloAndroid-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_0-Debug/libc.so'.BUILD FAILED
D:\Android\AndroidSDK\sdk\tools\ant\build.xml:892: The following error occurred while executing this line:
D:\Android\AndroidSDK\sdk\tools\ant\build.xml:894: The following error occurred while executing this line:
D:\Android\AndroidSDK\sdk\tools\ant\build.xml:906: The following error occurred while executing this line:
D:\Android\AndroidSDK\sdk\tools\ant\build.xml:284: null returned: 1Total time: 3 seconds
Generating Android Package
Input file: D:/build-HelloAndroid-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_0-Debug/android-libHelloAndroid.so-deployment-settings.json
Output directory: D:/build-HelloAndroid-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_0-Debug/android
Application binary: D:/build-HelloAndroid-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_0-Debug/libHelloAndroid.so
Android build platform: android-18
Install to device: emulator-5554
[subant] No sub-builds to iterate on
[javac] Note: D:\build-HelloAndroid-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_0-Debug\android\src\org\qtproject\qt5\android\bindings\QtActivity.java uses or overrides a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
Building the android package failed!
-- For more information, run this command with --verbose.
00:23:10: The process "D:\Qt\Qt5.2.0_android\5.2.0-beta1\android_armv7\bin\androiddeployqt.exe" exited with code 14.
Error while building/deploying project HelloAndroid (kit: Android for armeabi-v7a (GCC 4.8, Qt 5.2.0))
When executing step 'Deploy to Android device'
00:23:10: Elapsed time: 00:54. -
[quote author="yalnte" date="1382871438"]I deleted the android directory where the package was being created. The package was then created again from scratch and the package now deploys. There must have been some Qt5.1.1 build files left in there.[/quote]
Told you:
bq.
Don’t forget to clean project and rebuild, maybe you will need to recreate android folder. -
[quote author="AcerExtensa" date="1382950181"]
[quote author="yalnte" date="1382871438"]I deleted the android directory where the package was being created. The package was then created again from scratch and the package now deploys. There must have been some Qt5.1.1 build files left in there.[/quote]Told you:
bq.
Don’t forget to clean project and rebuild, maybe you will need to recreate android folder.[/quote]Is this an answer to my question?
Obviously I cleaned the Qt-Build directories. It did not work.
What do you mean by "Android directory"? -
Delete "android" directory... You have android folder in your project... delete it, it will be recreated by QtCreator with new build.xml
-
@AcerExtensa thanks for your reply
I deleted the entire "build-HelloAndroid-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_0-Debug" directory, this includes "android", but it did not work.
This is the directory tree:
build-HelloAndroid-Debug
build-HelloAndroid-Debug\android
build-HelloAndroid-Debug\android\bin
build-HelloAndroid-Debug\android\gen
build-HelloAndroid-Debug\android...
build-HelloAndroid-Debug\android\build.xml
build-HelloAndroid-Debug\android...
build-HelloAndroid-Debug... -
To get rid of build.xml errors, just delete android directory under your project and then ricompile it.
-
I've been able to deploy to an Android device of API Level 16, but not for Level 10.
The problem was that my project name contained a dash in its name (like hello-world, for instance). When generating the Java files to deploy for Android, Qt creates a package with the name of the project in it. This generates a compilation error, because dash is not allowed character in a Java Package name, but the error is not that transparent because it is in a Qt internal file. This bug should be resolved by Qt.
There may be other problems related to auto-generated code.
Not luck for API Level 10 yet, either on real devices nor on emulators.
-
The management of Android building with errors deriving from some files present into the android directory has been changed a lot from Qt 5.1 to Qt 5.2 RC1
So, my advice is to install Qt 5.2 RC1, remove any custom android files (like AndroidManifest.xml), remove the .pro.user made by previous Qt Creator, and re-try to build it for android.
Now, the new Qt creator give you a more meanigfull errors if something is wrong into the android specific setup. -
In my case I had the following error: "Error while building/deploying project analogclock (kit: Android for armeabi-v7a (GCC 4.8, Qt 5.2.1))
When executing step 'Deploy to Android device' ".The "androidqtdeploy" were not called for a unique and simple reason. My environment could not run 32bit command. I had to install : sudo apt-get install ia32-libs.
-
I used to get the same error on Qt 5.2.1, Windows 7 64-bit and Android SDK 4.0.3(API15) and this is how I solved the issue.
The example program 'analogclock' compiled with no error but it could not deploy because of this error, "androiddeployqt.exe exited with code 14."
@
-- For more information, run this command with --verbose.
13:57:37: The process "C:\Qt\Qt5.2.1.android\5.2.1\android_armv7\bin\androiddeployqt.exe" exited with code 14.
Error while building/deploying project analogclock (kit: Android for armeabi-v7a (GCC 4.8, Qt 5.2.1))
When executing step 'Deploy to Android device'
13:57:37: Elapsed time: 00:04.
@I noticed that an environmental variable ANT_HOME was set to C:\apache-ant-1.9.3". Just one quotation mark at the end, which was apparently wrong.
@ANT_HOME=C:\apache-ant-1.9.3"@
I actually installed 'Apache Ant' in "C:\apache-ant-1.9.3", but did not set this environmental variable. So, this was set by some process automatically to the wrong value.
I changed this variable, ANT_HOME from 'C:\apache-ant-1.9.3"' to 'C:\apache-ant-1.9.3' (removed the misplaced quotation mark). I restarted Qt Creator 3.0.1 and deployment of the same program went well.
@ANT_HOME=C:\apache-ant-1.9.3@
Analogclock now works on my Sony Tablet S!
P.S.
It also worked when I deleted this system variable. -
I have API 16 and I correctly do the android configuration but when compile my proyect (or example) it show the next build error:
BUILD FAILED
/home/pablo/Descargas/android-sdk-linux2/tools/ant/build.xml:653: The following error occurred while executing this line:
/home/pablo/Descargas/android-sdk-linux2/tools/ant/build.xml:659: Execute failed: java.io.IOException: Cannot run program “/home/pablo/Descargas/android-sdk-linux2/build-tools/19.1.0/aidl”: error=2, No such file or directory** at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041) at java.lang.Runtime.exec(Runtime.java:617) at org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:58) at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:428) at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:442) at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:628) at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:669) at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:495) at com.android.ant.AidlExecTask$AidlProcessor.process(AidlExecTask.java:102) at com.android.ant.MultiFilesTask.processFiles(MultiFilesTask.java:131) at com.android.ant.AidlExecTask.execute(AidlExecTask.java:203) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68) at com.android.ant.IfElseTask.execute(IfElseTask.java:120) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43Total time: 1 second
Generating Android Package Input file: /home/pablo/pryoectosfinal/build-prueba1-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Debug/android-libprueba1.so-deployment-settings.json Output directory: /home/pablo/pryoectosfinal/build-prueba1-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Debug/android-build Application binary: /home/pablo/pryoectosfinal/build-prueba1-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Debug/libprueba1.so Android build platform: android-16 Install to device: 4df703690c9fcf81
Buildfile: /home/pablo/pryoectosfinal/build-prueba1-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Debug/android-build/build.xml-set-mode-check:
-set-debug-files:
-check-env: [checkenv] Android SDK Tools Revision 23.0.2 [checkenv] Installed at /home/pablo/Descargas/android-sdk-linux2
-setup: [echo] Project Name: QtApp [gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 19.1.0 [echo] Resolving Build Target for QtApp…
[gettarget] Project Target: Android 4.1.2
[gettarget] API level: 16 [echo] ————— [echo] Creating output directories if needed… [mkdir] Created dir: /home/pablo/pryoectosfinal/build-prueba1-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Debug/android-build/bin [mkdir] Created dir: /home/pablo/pryoectosfinal/build-prueba1-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Debug/android-build/bin/res [mkdir] Created dir: /home/pablo/pryoectosfinal/build-prueba1-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Debug/android-build/bin/rsObj [mkdir] Created dir: /home/pablo/pryoectosfinal/build-prueba1-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Debug/android-build/bin/rsLibs [mkdir] Created dir: /home/pablo/pryoectosfinal/build-prueba1-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Debug/android-build/gen [mkdir] Created dir: /home/pablo/pryoectosfinal/build-prueba1-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Debug/android-build/bin/classes [mkdir] Created dir: /home/pablo/pryoectosfinal/build-prueba1-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Debug/android-build/bin/dexedLibs [echo] ————— [echo] Resolving Dependencies for QtApp…
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ————————— [echo] ————— [echo] Building Libraries with ‘debug’… [subant] No sub-builds to iterate on-code-gen:
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only. [echo] Handling aidl files… [aidl] Found 2 AIDL files. [aidl] Compiling 2 AIDL files.
Building the android package failed! — For more information, run this command with —verbose.
17:53:37: The process “/home/pablo/Qt5.3.1/5.3/android_armv7/bin/androiddeployqt” exited with code 14.
Error while building/deploying project prueba1 (kit: Android for armeabi-v7a (GCC 4.8, Qt 5.3.1))
When executing step ‘Deploy to Android device’
17:53:37: Elapsed time: 00:05. -
I do all of the post and the error continous, can someone help me?
thanks ;)