Error: Target id 'android--1' is not valid.



  • Hi All,

    I am trying to build application on Android device using QT 5.4.2.
    I have done everything but I still get errors:

    Application Output:
    16:37:01: Starting: "C:\Qt\5.4\android_armv7\bin\androiddeployqt.exe" --input C:/Android/src/build-untitled2-Android_for_armeabi_v7a_GCC_4_8_Qt_5_4_2-Debug/android-libuntitled2.so-deployment-settings.json --output C:/Android/src/build-untitled2-Android_for_armeabi_v7a_GCC_4_8_Qt_5_4_2-Debug/android-build --deployment bundled --android-platform android--1 --jdk "C:/Program Files/Java/jdk1.8.0_45" --ant C:/Android/apache-ant-1.9.4/bin/ant.bat
    Error: Target id 'android--1' is not valid. Use 'android.bat list targets' to get the target ids.
    Generating Android Package
    Input file: C:/Android/src/build-untitled2-Android_for_armeabi_v7a_GCC_4_8_Qt_5_4_2-Debug/android-libuntitled2.so-deployment-settings.json
    Output directory: C:/Android/src/build-untitled2-Android_for_armeabi_v7a_GCC_4_8_Qt_5_4_2-Debug/android-build/
    Application binary: C:/Android/src/build-untitled2-Android_for_armeabi_v7a_GCC_4_8_Qt_5_4_2-Debug/libuntitled2.so
    Android build platform: android--1
    Install to device: No
    Buildfile: build.xml does not exist!
    Build failed
    Warning: Android platform 'android--1' does not exist in SDK.
    Building the android package failed!
    -- For more information, run this command with --verbose.
    16:38:36: The process "C:\Qt\5.4\android_armv7\bin\androiddeployqt.exe" exited with code 14.
    Error while building/deploying project untitled2 (kit: Android for armeabi-v7a (GCC 4.8, Qt 5.4.2))
    When executing step "Build Android APK"
    16:38:36: Elapsed time: 01:50.

    General Messages:
    The system cannot find the path specified.
    The system cannot find the path specified.

    I have done steps from https://www.youtube.com/watch?v=_nkhlhBwkjk

    I installed JDK, NDK, SDK, ANT.

    I set up variables:
    My PATH:
    PATH=C:\Qt\Tools\QtCreator\bin;C:\Qt\5.4\android_armv7\bin;C:\Android\AndroidSDK\platforms;C:\Andr
    oid\AndroidSDK\platform-tools;C:\Android\AndroidSDK\tools;C:\Program Files\Java\jdk1.8.0_45\bin;C:\Q
    t\5.4\mingw491_32\bin;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\Wi
    ndowsPowerShell\v1.0;C:\Program Files (x86)\Microsoft Office\Office14;C:\Program Files (x86)\Enterp
    rise Vault\EVClient;C:\Program Files (x86)\Microsoft Office\Office14;C:\Program Files\Symantec\Work
    space Virtualization;C:\Program Files (x86)\QuickTime\QTSystem;C:\Program Files\Lenovo\Fingerprint
    Manager Pro;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Program Files
    Microsoft SQL Server\110\Tools\Binn;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0;C:\Progra
    m Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Perforce;C:\Android\apache-ant-1.9.4\b
    in;C:\ProgramData\Oracle\Java\javapath

    ANDROID_NDK_ROOT=C:\Android\android-ndk-r9d
    tried also with android-ndk-r10e
    ANDROID_SDK_ROOT=C:\Android\AndroidSDK
    ANT_HOME=C:\Android\apache-ant-1.9.4

    I have installed android-22 platform.

    But I am not able to compile android application on LG G3.
    It does not work also (no device detected) using AVD.

    Also there is no platform listed in:
    project_name->Projects->Build Steps->Build Android APK->Build Android APK
    There is blank list and unable to set anything.

    Could you please help?



  • I solved the issue but I am not sure what is the root cause.

    I edited the file %name%.pro.user located in project directory and changed:

    android--1 to android-22

    Closed the project and open again.
    Sometimes there is needed to repeat above steps again or more.

    Hope this may help for somebody.

    Thanks.



  • @nagardd The root cause is described here: http://www.cyberforum.ru/qt/thread1398784.html

    (in short, when android.bat fails to return (the list of the platforms) in 10 seconds, it is aborted, and the list of the platforms is not generated)



  • Hello All,
    I am getting the same build error: Warning: Android platform 'android--1' does not exist in SDK. The Android Build SDK pull down menu is always empty. I tried editing my project file to change android--1 to something valid, but it hasn't worked. Also, I get this same error with all examples as well. Could you tell me how to fix this? Thanks.



  • Hi, everyone! I have met this problem too.My operation system is ubuntu 14.04 64bit.When i install libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386, and delete three files in ~/.config:QtProject Trolltech.conf QtProject.conf, then i reinstall the qt, it work.I hope it will help you.


Log in to reply
 

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