Can't Build or Run any projects for Android



  • When I click Run, the AVD runs okay, but Qt can't deploy the app to the Android virtual device.

    Also when I click Build, I expect an APK file, but Instead I get a folder full of various source and resource files.

    Here's the Compile Output:
    @10:42:38: The process "/usr/bin/make" exited normally.
    10:42:38: Starting: "/usr/bin/make" INSTALL_ROOT=/Volumes/iSpace/USERs/Radium/Qt5.3.1/Examples/Qt-5.3/enginio/quick/build-todos-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Release/android-build install
    install -m 755 -p "libtodos.so" "/Volumes/iSpace/USERs/Radium/Qt5.3.1/Examples/Qt-5.3/enginio/quick/build-todos-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Release/android-build/libs/armeabi-v7a/libtodos.so"
    10:42:38: The process "/usr/bin/make" exited normally.
    10:42:39: Starting: "/Volumes/iSpace/USERs/Radium/Qt5.3.1/5.3/android_armv7/bin/androiddeployqt" --input /Volumes/iSpace/USERs/Radium/Qt5.3.1/Examples/Qt-5.3/enginio/quick/build-todos-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Release/android-libtodos.so-deployment-settings.json --output /Volumes/iSpace/USERs/Radium/Qt5.3.1/Examples/Qt-5.3/enginio/quick/build-todos-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Release/android-build --deployment bundled --install --ant ant --android-platform android-15 --jdk /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home --sign /Volumes/iSpace/USERs/Radium/Development_Tools/android_release.keystore xomputer --storepass baba88 --keypass zaza88 --device emulator-5554
    10:42:39: Pulling files necessary for debugging.
    10:42:39: Package deploy: Running command '/Volumes/iSpace/USERs/Radium/Development_Tools/android-sdk-macosx/platform-tools/adb -s emulator-5554 pull /system/bin/app_process /Volumes/iSpace/USERs/Radium/Qt5.3.1/Examples/Qt-5.3/enginio/quick/build-todos-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Release/app_process'.
    10:42:39: Package deploy: Running command '/Volumes/iSpace/USERs/Radium/Development_Tools/android-sdk-macosx/platform-tools/adb -s emulator-5554 pull /system/lib/libc.so /Volumes/iSpace/USERs/Radium/Qt5.3.1/Examples/Qt-5.3/enginio/quick/build-todos-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Release/libc.so'.
    sh: ant: command not found
    Building the android package failed!
    -- For more information, run this command with --verbose.
    Generating Android Package
    Input file: /Volumes/iSpace/USERs/Radium/Qt5.3.1/Examples/Qt-5.3/enginio/quick/build-todos-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Release/android-libtodos.so-deployment-settings.json
    Output directory: /Volumes/iSpace/USERs/Radium/Qt5.3.1/Examples/Qt-5.3/enginio/quick/build-todos-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Release/android-build
    Application binary: /Volumes/iSpace/USERs/Radium/Qt5.3.1/Examples/Qt-5.3/enginio/quick/build-todos-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Release/libtodos.so
    Android build platform: android-15
    Install to device: emulator-5554
    10:42:42: The process "/Volumes/iSpace/USERs/Radium/Qt5.3.1/5.3/android_armv7/bin/androiddeployqt" exited with code 14.
    Error while building/deploying project todos (kit: Android for armeabi-v7a (GCC 4.8, Qt 5.3.1))
    When executing step 'Deploy to Android device'
    10:42:42: Elapsed time: 00:12.@



  • [quote author="Radium1988" date="1403936256"][...]

    sh: ant: command not found
    [/quote]

    I'm not sure if ant is supposed to be included in the Android SDK, NDK, or the Qt install. Presumably one of those is incomplete. Maybe installing a copy externally will solve the problem.



  • Installed ant:
    @MacBook-Pro:~ Radium$ ant -version
    Apache Ant(TM) version 1.9.4 compiled on April 29 2014@

    But still Qt can't deploy to AVD:
    @19:45:36: The process "/usr/bin/make" exited normally.
    19:45:36: Starting: "/usr/bin/make" INSTALL_ROOT=/Volumes/iSpace/USERs/Radium/Qt5.3.1/Examples/Qt-5.3/enginio/quick/build-todos-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Release/android-build install
    install -m 755 -p "libtodos.so" "/Volumes/iSpace/USERs/Radium/Qt5.3.1/Examples/Qt-5.3/enginio/quick/build-todos-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Release/android-build/libs/armeabi-v7a/libtodos.so"
    19:45:36: The process "/usr/bin/make" exited normally.
    19:46:07: Starting: "/Volumes/iSpace/USERs/Radium/Qt5.3.1/5.3/android_armv7/bin/androiddeployqt" --input /Volumes/iSpace/USERs/Radium/Qt5.3.1/Examples/Qt-5.3/enginio/quick/build-todos-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Release/android-libtodos.so-deployment-settings.json --output /Volumes/iSpace/USERs/Radium/Qt5.3.1/Examples/Qt-5.3/enginio/quick/build-todos-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Release/android-build --deployment bundled --install --ant ant --android-platform android-15 --jdk /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home --device emulator-5554
    19:46:07: Pulling files necessary for debugging.
    19:46:07: Package deploy: Running command '/Volumes/iSpace/USERs/Radium/Development_Tools/android-sdk-macosx/platform-tools/adb -s emulator-5554 pull /system/bin/app_process /Volumes/iSpace/USERs/Radium/Qt5.3.1/Examples/Qt-5.3/enginio/quick/build-todos-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Release/app_process'.
    19:46:07: Package deploy: Running command '/Volumes/iSpace/USERs/Radium/Development_Tools/android-sdk-macosx/platform-tools/adb -s emulator-5554 pull /system/lib/libc.so /Volumes/iSpace/USERs/Radium/Qt5.3.1/Examples/Qt-5.3/enginio/quick/build-todos-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Release/libc.so'.
    sh: ant: command not found
    Building the android package failed!
    -- For more information, run this command with --verbose.
    Generating Android Package
    Input file: /Volumes/iSpace/USERs/Radium/Qt5.3.1/Examples/Qt-5.3/enginio/quick/build-todos-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Release/android-libtodos.so-deployment-settings.json
    Output directory: /Volumes/iSpace/USERs/Radium/Qt5.3.1/Examples/Qt-5.3/enginio/quick/build-todos-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Release/android-build
    Application binary: /Volumes/iSpace/USERs/Radium/Qt5.3.1/Examples/Qt-5.3/enginio/quick/build-todos-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Release/libtodos.so
    Android build platform: android-15
    Install to device: emulator-5554
    19:46:11: The process "/Volumes/iSpace/USERs/Radium/Qt5.3.1/5.3/android_armv7/bin/androiddeployqt" exited with code 14.
    Error while building/deploying project todos (kit: Android for armeabi-v7a (GCC 4.8, Qt 5.3.1))
    When executing step 'Deploy to Android device'
    19:46:11: Elapsed time: 00:38.@

    #######################

    BY THE WAY: please tell me how to build APK files



  • Radium1988,
    have you set up Ant path in settings of Android configuration?
    !https://yadi.sk/i/OmbGmrEyVTu9J (It is here (but I have got russian interface).)!



  • Okay I setup Ant path right now, but I'm still having problems :(

    Here's the screenshot for my Android configurations:
    http://i58.tinypic.com/24v5w04.jpg

    And here's the pastebin of the complete compile output:
    http://pastebin.com/ArknQA8y

    Please help this is giving me a severe headache :(



  • bq.
    BUILD FAILED
    /Volumes/iSpace/USERs/Radium/Development_Tools/android-sdk-macosx/tools/ant/build.xml:484: SDK does not have any Build Tools installed.

    May be once more test Android requirements http://qt-project.org/doc/qt-5/androidgs.html and reinstall sdk (only setup ADT bundle) http://developer.android.com/sdk/index.html#download



  • Downloaded and set the path to ADT bundle,
    but again...

    http://pastebin.com/raTZGSni

    Please notice:
    I was able to accidentally and by pure luck deploy to AVD once, but I'm not able to reproduce the incident again at all.
    And also I can't find any APK files after build.



  • APK must locate in /Volumes/iSpace/USERs/Radium/Qt5.3.1/Examples/Qt-5.3/quick/scenegraph/build-simplematerial-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_1-Release/android-build/bin

    Try other example (for ex. /Volumes/iSpace/USERs/Radium/Qt5.3.1/Examples/Qt-5.3/widgets/painting/basicdrawing).



  • Did as you said, basicdrawing is deploying successfully, many thanks!
    You saved me from the headache :D

    My questions:

    1. Are some of the examples not compatible with Android? If yes, what makes a project not compatible with Android?

    2. I deployed the Release version, but I only found the debug APK in the directory you mentioned.

    3. Widgets in designer for Android seem too limited and few, are there any importable third party widgets more similar to native android for Qt Creator?

    4. When I click "build", no APK is generated, I have to click Run to get an APK, why is it so? Run is very slow, is there any faster way to generate APK without running the program?

    5. With each Run, even when the last AVD is still open, a new instance of AVD will start. how can I prevent this and just use the last AVD?

    ###########################

    BY THE WAY

    I connected my android phone via usb, and tried deploying onto it, and fortunately every example runs smooth and successfully onto my phone.

    However I checked the APK files sizes on my phone, and they were between 8 to 28 megabytes!!
    I created a new empty project and deployed it, but even the empty project is 7 megabytes in size!
    Are these debug APKs that are fat and big?
    How can I generate the smaller release version APKs?



  • Radium1988,

    although I've been programming for a long time but my experience in Qt is just 2 months. So I can only reply to some of your questions. Maybe someone more experienced in Qt will read this thread and will answer your other questions.

    bq. 1. Are some of the examples not compatible with Android? If yes, what makes a project not compatible with Android?

    It is quite possible. Some components have not been ported to Android yet (Qt have been supporting Android since the 5th version). For example positioning have been working on Android since 5.3 version.

    bq. 3. Widgets in designer for Android seem too limited and few, are there any importable third party widgets more similar to native android for Qt Creator?

    I don't know. I did not find. For now I am using original Qt widgets and writting my own widgets.

    bq. 5. With each Run, even when the last AVD is still open, a new instance of AVD will start. how can I prevent this and just use the last AVD?

    I have it is different. If one AVD is already open, then new instance does not start.

    bq. However I checked the APK files sizes on my phone, and they were between 8 to 28 megabytes!! I created a new empty project and deployed it, but even the empty project is 7 megabytes in size!
    Are these debug APKs that are fat and big?

    APK is zip archive. There are Qt libraries, Ministro and other java classes (+ gdb server for debug and maybe additional plugins) in archive.

    Unfortunately I can't give more detailed answers.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.