[SOLVED] Qt 5.2 - Beta : Deploying to Android
-
[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... -
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 ;) -
I tried to do it and the error continous. I think the error it can be the aidl.
[quote author="IvanZuy" date="1407993752"]I had the same error code 14.
The solution was simple:
@sudo apt-get install ant@[/quote] -
I have Qt 5.5.1 on my Mac OS 10.11.3 with QtCreator 3.6.0. I have same issue with target android build SDK 17 and below. Changing target SDK to 18 and above solved problem. But I need Target Android version 14.
I found that there is a problem on AndroidManifest.xml file for me. It has "layoutDirection" in "configChanges" attribute. So I removed that and problem solved :)
I suggest you to re-read errors carefully. It will guid you to solving problems.
"error: Error: String types not allowed (at 'configChanges' with value 'orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation')."