Installing to real Android Device fails while compiling



  • Re: Installing to device failed due to invalid APK file.
    Re: https://forum.qt.io/topic/78330/problem-to-build-on-android-device/8

    ...
    Installing Android package to device.
    Running command "C:/ANDROID/platform-tools/adb.exe -s 0954dea3 install -r C:/QT3/Examples/Qt-5.8/widgets/graphicsview/build-collidingmice-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug/android-build//bin/QtApp-debug.apk"
    adb: error: cannot stat 'C:/QT3/Examples/Qt-5.8/widgets/graphicsview/build-collidingmice-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug/android-build//bin/QtApp-debug.apk': No such file or directory
    Installing to device failed!
    13:08:11: Der Prozess "C:/QT3/5.8/android_armv7/bin/androiddeployqt.exe" wurde mit dem Rückgabewert 16 beendet.
    13:08:11: Die für das Debuggen erforderlichen Dateien werden installiert.
    13:08:11: Paket-Deployment: Führe Kommando "C:/ANDROID/platform-tools/adb.exe -s 0954dea3 pull /system/bin/app_process32 C:/QT3/Examples/Qt-5.8/widgets/graphicsview/build-collidingmice-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug/app_process" aus.
    13:08:11: Paket-Deployment: Führe Kommando "C:/ANDROID/platform-tools/adb.exe -s 0954dea3 pull /system/lib/libc.so C:/QT3/Examples/Qt-5.8/widgets/graphicsview/build-collidingmice-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug/libc.so" aus.
    Fehler beim Erstellen/Deployment des Projekts collidingmice (Kit: Android für armeabi-v7a (GCC 4.9, Qt 5.8.0))
    Bei der Ausführung von Schritt "Deploy to Android device"
    13:08:11: Verstrichene Zeit: 00:03.
    ...

    I guess I dont have any APK, I have installed Android Studio and I downloaded several things. How can I tell Qt that it should use an APK, or is it not neccesary for compiling to a real device

    If you need the english log Version, I can change my system language and psot it again.

    Thanks in advance!



  • @KonradMD What is in this directory C:/QT3/Examples/Qt-5.8/widgets/graphicsview/build-collidingmice-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug/android-build//bin/?

    Is it possible it's just not building the debug version? Also there is a double slash in the path. This shouldn't make a difference though, just pointing it out in case it does in windows.

    When you build does it make your .apk file anywhere in your project? What does dir /s /a *.apk come up with in your project directory after you build?



  • In my setup the .apk file will be in ...-Debug/android-build/build/outputs/apk/. I don't understand why @KonradMD's setup tries to find it in android-build//bin/. Maybe it's a problem with Qt Creator settings or project settings, or the build system. What build system are you using?



  • Hi @ambershark thanks for your help!
    In the directory ......./androidbuild is just another folder libs, so there is no chance to access a folder bin, especially not with a double slash.
    So I guess its not converting it to an apk file, because the same code with MinGW for the desktop version works perfectly

    I dont get your last question completly, i am not into cmd lines commandos. But I guess it means I should search for an apk file?
    --> There is no *.apk file, and in the build is just the libs file.

    Does anyone have an idea what to do? Erasing everything and trying to reinstall android etc. It is strange because, with android studio I can deploy apk to the device, but not with qt.



  • @Eeli-K
    Thanks for your information, its always good to know where it should be to find a solution. :)))
    Strange, I firstly installed neccesitas, but then I read that its not supported anymore.

    My Build Systems are:
    Android for armeabi-v7a(GCC 4.9,Qt 5.8.0) ->compatible to my device
    Android for x86 (GCC 4.9, Qt 5.8.0)->useless I guess

    But i am also not sure how to build new ones, these are automaticly detected .
    My Nexus 7 shows: Android 6.0 ABI: armeabi-v7a armeabi

    Here the complete Compiler Output in english.

    14:03:53: Running steps for project collidingmice...
    14:03:53: Configuration unchanged, skipping qmake step.
    14:03:53: Starting: "C:\QT3\Tools\mingw530_32\bin\mingw32-make.exe"
    mingw32-make: Nothing to be done for 'first'.
    14:03:54: The process "C:\QT3\Tools\mingw530_32\bin\mingw32-make.exe" exited normally.
    14:03:54: Removing directory C:\QT3\Examples\Qt-5.8\widgets\graphicsview\build-collidingmice-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug\android-build
    14:03:54: Starting: "C:\QT3\Tools\mingw530_32\bin\mingw32-make.exe" "INSTALL_ROOT=C:\QT3\Examples\Qt-5.8\widgets\graphicsview\build-collidingmice-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug\android-build" install
    copy /y libcollidingmice.so C:\QT3\Examples\Qt-5.8\widgets\graphicsview\build-collidingmice-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug\android-build\libs\armeabi-v7a\libcollidingmice.so
    1 Datei(en) kopiert.
    14:03:55: The process "C:\QT3\Tools\mingw530_32\bin\mingw32-make.exe" exited normally.
    14:03:55: Skipping disabled step Build Android APK.
    14:03:55: Starting: "C:\QT3\5.8\android_armv7\bin\androiddeployqt.exe" --verbose --output C:/QT3/Examples/Qt-5.8/widgets/graphicsview/build-collidingmice-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug/android-build --no-build --input C:/QT3/Examples/Qt-5.8/widgets/graphicsview/build-collidingmice-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug/android-libcollidingmice.so-deployment-settings.json --deployment bundled --reinstall --device 0954dea3
    Generating Android Package
    Input file: C:/QT3/Examples/Qt-5.8/widgets/graphicsview/build-collidingmice-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug/android-libcollidingmice.so-deployment-settings.json
    Output directory: C:/QT3/Examples/Qt-5.8/widgets/graphicsview/build-collidingmice-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug/android-build/
    Application binary: C:/QT3/Examples/Qt-5.8/widgets/graphicsview/build-collidingmice-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug/libcollidingmice.so
    Android build platform: android-25
    Install to device: 0954dea3
    Detecting dependencies of application.
    Reading dependencies from C:/QT3/Examples/Qt-5.8/widgets/graphicsview/build-collidingmice-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug/libcollidingmice.so
    lib/libQt5Widgets.so
    lib/libQt5Gui.so
    lib/libQt5Core.so
    Reading dependencies from C:/QT3/5.8/android_armv7/lib/libQt5Widgets.so
    lib/libQt5Gui.so
    lib/libQt5Core.so
    Reading dependencies from C:/QT3/5.8/android_armv7/lib/libQt5Gui.so
    lib/libQt5Core.so
    Reading dependencies from C:/QT3/5.8/android_armv7/lib/libQt5Core.so
    Appending dependency: lib/libQt5Core.so
    Reading Android dependencies for Qt5Core
    Appending dependency: lib/libQt5Gui.so
    Reading Android dependencies for Qt5Gui
    Appending dependency from xml: plugins/platforms/android/libqtforandroid.so
    Appending dependency from xml: plugins/iconengines/libqsvgicon.so
    Appending dependency from xml: plugins/imageformats/libqgif.so
    Appending dependency from xml: plugins/imageformats/libqicns.so
    Appending dependency from xml: plugins/imageformats/libqico.so
    Appending dependency from xml: plugins/imageformats/libqjpeg.so
    Appending dependency from xml: plugins/imageformats/libqsvg.so
    Appending dependency from xml: plugins/imageformats/libqtga.so
    Appending dependency from xml: plugins/imageformats/libqtiff.so
    Appending dependency from xml: plugins/imageformats/libqwbmp.so
    Appending dependency from xml: plugins/imageformats/libqwebp.so
    Appending dependency: lib/libQt5Widgets.so
    Reading Android dependencies for Qt5Widgets
    Reading dependencies from C:/QT3/5.8/android_armv7/plugins/platforms/android/libqtforandroid.so
    lib/libQt5Gui.so
    lib/libQt5Core.so
    Reading dependencies from C:/QT3/5.8/android_armv7/plugins/platforms/android/libqtforandroid.so
    lib/libQt5Gui.so
    lib/libQt5Core.so
    Scanning for QML imports.
    Copying GNU STL library
    -- Copied C:/QT3/Examples/Qt-5.8/widgets/graphicsview/build-collidingmice-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug/android-build//libs/armeabi-v7a/libgnustl_shared.so
    Copying 15 dependencies from Qt into package.
    Installing Android package to device.
    Running command "C:/ANDROID/platform-tools/adb.exe -s 0954dea3 install -r C:/QT3/Examples/Qt-5.8/widgets/graphicsview/build-collidingmice-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug/android-build//bin/QtApp-debug.apk"
    adb: error: cannot stat 'C:/QT3/Examples/Qt-5.8/widgets/graphicsview/build-collidingmice-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug/android-build//bin/QtApp-debug.apk': No such file or directory
    Installing to device failed!
    14:03:57: The process "C:/QT3/5.8/android_armv7/bin/androiddeployqt.exe" exited with code 16.
    14:03:57: Pulling files necessary for debugging.
    14:03:57: Package deploy: Running command "C:/ANDROID/platform-tools/adb.exe -s 0954dea3 pull /system/bin/app_process32 C:/QT3/Examples/Qt-5.8/widgets/graphicsview/build-collidingmice-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug/app_process".
    14:03:57: Package deploy: Running command "C:/ANDROID/platform-tools/adb.exe -s 0954dea3 pull /system/lib/libc.so C:/QT3/Examples/Qt-5.8/widgets/graphicsview/build-collidingmice-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug/libc.so".
    Error while building/deploying project collidingmice (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.8.0))
    When executing step "Deploy to Android device"
    14:03:57: Elapsed time: 00:04.



  • @KonradMD said in Installing to real Android Device fails while compiling:

    1 Datei(en) kopiert.

    You still missed a line, thats still in german ;-)

    AnyWay, we'll have to check if an apk-file is actually created, if and why the remotedebuging fails, if the apk file is created is a different matter than.

    If you simply build the project does that work without problems?

    make sure to clean your project and to run qmake as well before building the app.

    if the build does not abort check on your harddisk the build-folder you specified if there is any file ending with 'apk'



  • Thanks @J-Hilk

    Thats true, but I changed my language-settings back to english, much easier :D

    Building works perfectly:

    15:41:52: Running steps for project collidingmice...
    15:41:52: Configuration unchanged, skipping qmake step.
    15:41:52: Starting: "C:\QT3\Tools\mingw530_32\bin\mingw32-make.exe"
    mingw32-make: Nothing to be done for 'first'.
    15:41:53: The process "C:\QT3\Tools\mingw530_32\bin\mingw32-make.exe" exited normally.
    15:41:53: Removing directory C:\QT3\Examples\Qt-5.8\widgets\graphicsview\build-collidingmice-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug\android-build
    15:41:53: Starting: "C:\QT3\Tools\mingw530_32\bin\mingw32-make.exe" "INSTALL_ROOT=C:\QT3\Examples\Qt-5.8\widgets\graphicsview\build-collidingmice-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug\android-build" install
    copy /y libcollidingmice.so C:\QT3\Examples\Qt-5.8\widgets\graphicsview\build-collidingmice-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug\android-build\libs\armeabi-v7a\libcollidingmice.so
    1 Datei(en) kopiert.
    15:41:54: The process "C:\QT3\Tools\mingw530_32\bin\mingw32-make.exe" exited normally.
    15:41:54: Skipping disabled step Build Android APK.
    15:41:54: Elapsed time: 00:02.

    These lib files which are mentioned in the Compile Output are there, so this step is working :)

    In the builddirectory are:
    folder:android-build
    JSON file: android-libcollidingmice.so-deployment-settings
    File: app_process
    So File: lib.so
    So FIle: libc.so
    Object File: main.obj
    file: makefile
    object file: mouse.obj
    c++ source: qrc_mice.cpp
    object file: qrd_mice.obj

    in the android build folder is:
    folder: libs
    in the libs folder is:
    folder: armeabi-v7a
    in the armeabi-v7a folder is:
    libcollidingmice.so

    So i need to research why the apk is not created, ist there any step before creating the apk in the creating sequence?



  • @KonradMD said in Installing to real Android Device fails while compiling:

    15:41:54: Skipping disabled step Build Android APK.

    The reason why there is no apk file seems obvious x)

    15:41:54: Skipping disabled step Build Android APK.
    

    that part is disabled.



  • This post is deleted!


  • Now I got another mistake :D but I alreasy read about the gradle problems in a QT Bug report, thanks a lot for your help, I will update you when I am further in my research :D


Log in to reply