Solved Qt 5.8 for Android development: error platform android--1 on Windows 10
-
I can't select Android SDK version for the project.
Everything worked nicely before upgrading to Qt 5.7 and next Qt 5.8. I tried to reinstall Qt and Android SDK and NDK, but Qt still can't detect list of available Android SDK.
In logs I can see something like14:46:34: Starting: "C:\Qt\5.8\android_armv7\bin\androiddeployqt.exe" --input D:/BBSDK/workspace_qt/build-testProject-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug/android-libTabletki.so-deployment-settings.json --output D:/BBSDK/workspace_qt/build-testProject-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug/android-build --deployment bundled --android-platform android--1 --jdk "C:/Program Files/Java/jdk1.8.0_45" --gradle
As temporary solution I copied this string and manually replaced "android--1" to "android-22" then run it in windows command line
-
Investigation and solution.
On laptop Win10 Qt 5.7 seems to detect Android SDK fine.
I found that to detect Android SDK Qt runs 'android.bat list targets' , found from here http://www.cyberforum.ru/qt/thread1398784.html
android.bat can be found in AndroidSDK_folder/tools/
I tried to run this command manually and it fails with error something like... Please set ANDROID_SWT to point to the folder containing swt.jar for your platform. ...
I tried different solutions from stackoverflow, and one helped : add "C:\Windows\System32" to environment PATH variable. After this android.bat list targets command gives result and Qt can detect installed Android SDK correctly.