Qt 5.12 (Beta) + Android (Clang) = App Crash
I'm really glad that Qt 5.12 will (finally) supports Clang toolchain for Android targets. Trying current beta version, compilation on my Windows 10 machine goes smoothly as silk, however deployed apps ingloriously crash with the following error.
E AndroidRuntime: FATAL EXCEPTION: qtMainLoopThread E AndroidRuntime: Process: org.qtproject.example.mousearea, PID: 25359 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__emutls_get_address"
Same result with different configurations:
- SDK version: 26.1.1 (latest)
- NDKs: 10e,15c, 16b, 17c
- android APIs: 22, 23, 27, 28
- different target devices (phones)
In here ist says
Note: If your Qt version is earlier than v5.9, use the SDK tools package v25.2.5 or earlier.
Not sure if ot makes sense to have the most recent sdk version even if it does not explicit say so.
If I understand correctly, my Qt is > 5.9, therefore SDK tools > 25.2.5 should be fine .
Pablo J. Rogina
Checked there, but the group seems quite inactive...
I finally managed to fix the problem. App doesn't crash when compiled with NDK16b!
- install Android Studio (if not already installed)
- download NDK16b and extract it to any location (in my case 'D:\sdk\android-ndk-r16b')
- start Qt Creator
- select menu Tools > Options > Devices, tab Android
- set proper android SDK paths:
- click OK
- open your project (.pro)
- Important! Delete folder containing previous (shadow) build (see path under 'Build directory'):
- under Projects (left bar) > Build & Run, activate Android configuration
- compile & run
Great! Thanks for your feedback
I've got the similar problem when changing the Qt from 5.11.1 to 5.12.0
It seems like crashed when the Android App start openning.
After some tracing, I finally found that, the reason is, the App hasn't got the permissions of reading&writing local extra storage. After I add the according permissions mannualy (in system management) , the App runs OK.
The 'permission' also can be added by this way below:
This post is deleted!