Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Android development on MacOS with Qt Creator 4.9.2?
ThanksForTheHelp last edited by ThanksForTheHelp
I am on MacOS running Qt Creator 4.9.2 based on QT 5.12.4 (Clang 10) 64 bit. What I've installed. Everything besides JDK was installed using Android Studio.
JDK 8u221 (using JDK 12 resulted in Qt Creator not finding SDK platform install) Android 9.+ (Q) Android SDK Build-Tools Android Emulator (29.0.11) Android SDK Platform-tools (29.0.1) Android SDK Tools (26.1.1) Intel x86 HAXM Install (7.5.1) NDK (20.0.5594570)
I can create a x86_64 android stack example project without errors, but when I build and run the default project I get a pop-up window entitled "Select Android Device". There is only one device available and it is in the "incompatible" category.
The error in this windows is: ABI is incompatible, device supports ABIs: x86. (OpenGL enabled)
The issue: I cannot build and run android projects on x86_64 because there are no compatible devices. How do I solve this?
Initializing deployment to Android device/simulator Error while building/deploying project untitled (kit: Android for x86_64 (Clang Qt 5.13.0 for Android x86_64)) When executing step "Deploy to Android device"
What I've tried: 'ANDROID_TARGET_ARCH=default/armeabi-v7a" in my project build settings. No difference.
Edit: I followed the qt documentation and it clearly states You must download and install the latest Android NDK and SDK, hence why I downloaded the latest versions of SDK and NDK.
Hi @thanksforthehelp and welcome
Did you during Qt installation, select the correct precompiled Qt libs for android ? there should be 3, IIRC; armv7 armv8 and x86
During the installation of Qt I selected EVERYTHING besides ios and Qt 3D, so my guess is Yes.
you should reconsider this! that's like 50-60 gb of storages that may be largely unused.
maybe it's better now, the Installer get an overhaul recently.
anyway, on the
rightleft side of QtCreator go into the BuildSettings page and enable /switch to the correct android kit that you need
Well... I need x86_64 since I am going to develop my app for a Samsung Galaxy S10? Wouldn't switching kits to, for example armeabi-v7a, a problem?
@thanksforthehelp are you sure its a 64 bit x86 architecture?
Because as far as I know, those do not come precompiled, only the 32 bit one.
So you would have to build Qt yourself for that one.
From the looks of it on this website it seems as if Galaxy S10 and S10+ both have 64 bit processors. My guess is that I need x86_64 development for that. I can have x86 but wouldn't that be inefficient and sloppy?
please check your device settings to make sure :)
I can have x86 but wouldn't that be inefficient and sloppy?
32 bit apps run fine on 64 bit systems, in 90% of all cause you won't notice or measure a difference
My guess is that I need x86_64 development for that
No, Galaxy S10 and S10+ have ARM CPUs, not x86.
As @J-Hilk shows you need ARM64-v8a
Instruction Sets: arm64-v8a
Kernel Architecture: aarch64
CPU Architecture: ARMv8-A
Does that mean 32 bit? I sure as heck looks like 64 since it doesn't say 32
@thanksforthehelp CPU supports 64bit, but is able to execute 32bit as far as I know. Just like Windows/Linux on 64bit machines.
I know 64 bit computer are able to execute and run 32 bit programs. The issue, as far as I can understand, is that 32 bit programs tend to be a bit slower since they do not utilise the whole CPU or something. Even if the difference is, for example, 90% performance I do not want 32 bit build because I need and want as fast, secure and stable as possible.
well there you have it, select your
Qt for Android ARM64-v8akit
and you should be good to go
I managed to solve the initial error:
Initializing deployment to Android device/simulator Error while building/deploying project untitled (kit: Android for x86_64 (Clang Qt 5.13.0 for Android x86_64)) When executing step "Deploy to Android device"``` by opening Android Studio -> SDK Manger -> Tick Show Package Details -> Install Android 9.+ (Q) with Atom_64 -> apply -> install. Now when I compile a Google Pixel 2 XL pops up when I run but no app is created. There are errors in the 'Issues' tab:
:-1: error: error: cannot find -lc++
:-1: error: linker command failed with exit code 1 (use -v to see invocation)
ThanksForTheHelp last edited by ThanksForTheHelp
Selecting Qt for Android ARM64-v8a does not compile. There are no supported ABIs for that on my computer nor in the SDK manager...
Edit: Entering the AVD Manager and changing the architecture of my default phone emulator mirror/profile on other images ATM to nougat 25 for arm64-v8a target build android 7.1.1, despite me having android 9.0, lets try it out
ah @thanksforthehelp different error :) would have been good to know from the beginning x)
error comes from the ndk 20 despite what the docs says, that isn't quite without issues. But fixable, like the thread describes.
It is still trying to boot the first emulation on the new architecture. I get a warning though: "Running a x86 based AVD is 10x faster". It is still trying to boot it after 5 minutes...
"Running a x86 based AVD is 10x faster"
Yes, for testing in VM on PC it is better to use x86 based AVD as it is way slower to emulate complete different CPU (ARM on x86).
@jsulm so I should deploy for x86 but then when I have my prototype complete I build it with arm? Should the final product, besides the binary files, work the same and be the same?
@thanksforthehelp Yes, exactly. But you should still test on a ARM based phone/emulator sometimes :-)
After switching to x86 and applying the fix to remove the new compiler errors mentioned above I get a fully running emulation of android. When does my program actually boot? Have selected android x86 project, stacked, but nothing happens after the phone boots up...
Never mind! The program starts after about 1 minute 30 seconds, I just have to wait without pressing the emulated screen/phone