Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [SOLVED] Qt 5.2 - Beta : Deploying to Android
QtWS25 Last Chance

[SOLVED] Qt 5.2 - Beta : Deploying to Android

Scheduled Pinned Locked Moved Mobile and Embedded
23 Posts 11 Posters 34.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    fpelliccioni
    wrote on last edited by
    #11

    [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"?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      AcerExtensa
      wrote on last edited by
      #12

      Delete "android" directory... You have android folder in your project... delete it, it will be recreated by QtCreator with new build.xml

      God is Real unless explicitly declared as Integer.

      1 Reply Last reply
      0
      • F Offline
        F Offline
        fpelliccioni
        wrote on last edited by
        #13

        @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...

        1 Reply Last reply
        0
        • A Offline
          A Offline
          AlterX
          wrote on last edited by
          #14

          To get rid of build.xml errors, just delete android directory under your project and then ricompile it.

          Qt Ambassador
          Real-time cooperative teams: http://www.softairrealfight.net
          Free Real-time network platform sdk: https://github.com/AlterX76/Solomon

          https://codereview.qt-project.org/...

          1 Reply Last reply
          0
          • L Offline
            L Offline
            lgb3
            wrote on last edited by
            #15

            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.

            1 Reply Last reply
            0
            • GianlucaG Offline
              GianlucaG Offline
              Gianluca
              wrote on last edited by
              #16

              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.

              1 Reply Last reply
              0
              • X Offline
                X Offline
                xric
                wrote on last edited by
                #17

                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.

                1 Reply Last reply
                0
                • R Offline
                  R Offline
                  ryocchin
                  wrote on last edited by
                  #18

                  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.

                  1 Reply Last reply
                  0
                  • P Offline
                    P Offline
                    Pablitogrillo
                    wrote on last edited by
                    #19

                    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:43

                    Total 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.

                    1 Reply Last reply
                    0
                    • P Offline
                      P Offline
                      Pablitogrillo
                      wrote on last edited by
                      #20

                      I do all of the post and the error continous, can someone help me?
                      thanks ;)

                      1 Reply Last reply
                      0
                      • I Offline
                        I Offline
                        IvanZuy
                        wrote on last edited by
                        #21

                        I had the same error code 14.
                        The solution was simple:
                        @sudo apt-get install ant@

                        1 Reply Last reply
                        0
                        • P Offline
                          P Offline
                          Pablitogrillo
                          wrote on last edited by
                          #22

                          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]

                          1 Reply Last reply
                          0
                          • S Offline
                            S Offline
                            seyed
                            wrote on last edited by
                            #23

                            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')."

                            1 Reply Last reply
                            0

                            • Login

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Groups
                            • Search
                            • Get Qt Extensions
                            • Unsolved