Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
Qt Creator 4.15.0
-
None
-
-
a2b6dba0bcec4675cbc5c951cfb112296e65d4e4 (qt-creator/tqtc-qt-creator/5.0)
-
2021wk36POAndroid&Mobile
Description
Steps to reproduce
1) Clone qtscxml repository: git clone git://code.qt.io/qt/qtscxml.git
2) Open the qtscxml toplevel CMakeLists.txt in QtCreator, select Android kit (arm & debug build in my case).
3) Enable building of examples (Projects tab => Build pane => set QT_BUILD_EXAMPLES=ON) and hit “Apply configuration changes” button below.
4) Select an example on the Projects => Run => Run Configuration. For example “pinball” or whatever, as long a plugin is not selected (see later).
5) Click “build” button and build.
6) At the end of the build (after 100%) there is an error:
No target architecture defined in json file.. The process "/Users/juha.vuolle/qts/6/host_dev_build/qtbase/bin/androiddeployqt" exited with code 2. Error while building/deploying project QtScxml (kit: Android Qt 6.2.0 (android_arm_dev_build) Clang arm64-v8a) When executing step "Build Android APK"
This is the error this bug is about. There are two related behaviours into this error, depending on the action on step #4 above.
- If an executable application is selected in the “Run configuration”, the real .json file can be found and the hack / workaround below can be done.
- If a plugin is selected, the build directory will not contain a .json file that would work.
Some analysis
The error message comes from androiddeployqt, it tries to find "architectures" keyword from a .json file, but it contains a "target-architecture" keyword instead. By grepping qt-creator source, which creates these .json files, this is not wrong per se - it generates .json files with 2 different keywords. I did not investigate why, but I assume it is as it should.
All in all since the real .json files are there, I think they are just looked up from the wrong place.
The dirty workaround / hack
Open terminal and go to the build directory of the project and copy all android deployment .json files to root of the build folder:
….arm64_v8a-Debug > find . -name "android*.json" |xargs -I FILE cp FILE .
Then go back to QtCreator and build again => no error.
Attachments
Issue Links
- relates to
-
QTBUG-105133 [REG 6.3.1] Androiddeployqt doesn't find rcc and qmlimportscanner
- Closed
-
QTBUG-94264 When building for Android, instead of an apk, just .so is built
- Closed