How to set Android Target Architecture in Qt?
-
Recently, I upgraded the Qt version to 5.14.1. After the upgrade, when I try to deploy the application to a Android device, I get the following error message.
No Android arch set by the .pro file. Error while building/deploying project MedLogApp (kit: Android for (Clang Qt 5.14.1 for Android)) When executing step "Deploy to Android device"
How do I set the target Android architecture in Qt project file?
Note: The error message is there for the example applications provided by Qt -
Go to Project->Build panel and select the architectures you are interested in from the list.
If that does not work, regenerate templates (AndroidManifest etc.) with this new Qt version, then delete your old build directory, run qmake and rebuild the app.
-
Hi @sierdzio ,
I didn't find any option in Build>Panel to select the target architecture. I tried regenerating the templates. But this didn't work.
Qt Creator version : 4.9.0
After regenerating the template files,
contains(ANDROID_TARGET_ARCH,armeabi-v7a) { ANDROID_PACKAGE_SOURCE_DIR = \ $$PWD/android }
is added to the project file.
-
Update Qt Creator. Versions older than 4.11 won't build Qt packages for Android with Qt 5.14.x.
-
Hi @sierdzio
Dose Qt 5.14.x provides support to build APK wich support both
armeabi-v7a
&arm64-v8a
?In case if i want to build the APK supporting Both Architecture with single KIT, is it possible ?
if I want to avoid bundling 2 APK's in to one. -
@Pradeep-P-N said in How to set Android Target Architecture in Qt?:
Hi @sierdzio
Dose Qt 5.14.x provides support to build APK wich support both
armeabi-v7a
&arm64-v8a
?In case if i want to build the APK supporting Both Architecture with single KIT, is it possible ?
Yes. arm, arm64, x86 and x86_64 can all be bundled into a single package.
if I want to avoid bundling 2 APK's in to one.
With 5.14.x qmake will do this bundling for you automatically.
-
@Pradeep-P-N said in How to set Android Target Architecture in Qt?:
(Not sure if bundling is available in Qt 5.12.2 LTS).
It is not. Bundling was added in Qt 5.14 and UI for it in Qt Creator 4.11.
-
- Post your environment information (OS, Qt version, Qt Creator version)
- Are Android SDK & NDK installed and set up in Qt Creator?
- Have you selected the architecture in Projects->Build pane of Qt Creator?
- Is this a new project or some older one which you are porting to newer Qt version?