The emulator starts but the app doesn't



  • Hi,

    I get the following warning in the compile output

    Warning: Android platform 'android--1' does not exist in SDK.
    Cannot find template directory C:/Users/Mike/AppData/Local/Android/sdk/tools/templates/gradle/wrapper
    20:06:19: The process "C:\Qt\Qt5.6.2\5.6\android_armv7\bin\androiddeployqt.exe" exited with code 3.
    Error while building/deploying project untitled (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.6.2))
    When executing step "Build Android APK"

    The emulator starts but the app never starts and there is no icon for it.

    How can I get it to work?


  • Moderators

    Please try with Qt 5.9 and newest Qt Creator. Google recently completely changed the build tools, so if you have new Android SDK/NDK but older Qt Creator/Qt version, it might not work.

    Or maybe it's simply that your kit is not set up correctly. Check Qt Creator preferences, if Qt Version and Kit does not report any warnings/ errors (Qt Creator->Preferences->Build and run).



  • When I try to use Qt Creator 4.3.1 (Qt 5.9.1) and I select New Project > Qt Quick Application, on the right side the only supported platforms is Desktop. I added the path to JDK, SDK, and NDK in Qt Creator. I have a warning in Tools > Options > Devices > Android.

    Qt versions for 6 architecture are missing
    To ad the Qt versions, select Options > Build & Run > Qt Versions.

    So I installed Qt Creator 4.0.3( Qt 5.6.1) and when I select New Project > Qt Quick Application, on the right side the supported platforms are Android Device and Desktop. I added the path to JDK, SDK, and NDK in Qt Creator. I have a warning in Tools > Options > Devices > Android.

    Qt versions for 4 architecture are missing
    To ad the Qt versions, select Options > Build & Run > Qt Versions.

    I installed Android NDK, Revision 10e based on the recommendation from http://doc.qt.io/qt-5/androidgs.html

    I added the path to javac and apache ant's bin folders in the system variables. I also added ANT_HOME to the user variables.


  • Moderators

    @WhatIf Did you install Qt for Android?



  • qt-opensource-windows-x86-android-5.6.2 offline installers


  • Moderators

    @WhatIf I've found a workaround for that: see this post. There is also another, more hacky solution: modify your *.pro.user file and replace every occurrence (there will be 3) of
    "android--1" with an existing API from your SDK, for example: "android--23" - however, Qt Creator often reloads and saves the .user file, so this solution is very unstable.


Log in to reply
 

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