Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Android: dlopen failed: libqtforandroid.so crash on certain device.
I have and Android app, which is crashing during startup only on one certain device: Huawei Tablet AGS2-W09. How can I further examinate, what's causing the error, if I haven't got physical access to device?
Qt version: 5.12.3 .
07-01 10:53:09.327 6135 6156 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: file offset for the library "/data/data/pl.domain.appname/qt-reserved-files/plugins/platforms/android/libqtforandroid.so" >= file size: 0 >= 0 07-01 10:53:09.327 6135 6156 E AndroidRuntime: at java.lang.Runtime.load0(Runtime.java:928) 07-01 10:53:09.327 6135 6156 E AndroidRuntime: at java.lang.System.load(System.java:1624) 07-01 10:53:09.327 6135 6156 E AndroidRuntime: at org.qtproject.qt5.android.QtNative$2.run(QtNative.java:183) 07-01 10:53:09.327 6135 6156 E AndroidRuntime: at org.qtproject.qt5.android.QtThread$2.run(QtThread.java:87) 07-01 10:53:09.327 6135 6156 E AndroidRuntime: at org.qtproject.qt5.android.QtThread$1.run(QtThread.java:61) 07-01 10:53:09.327 6135 6156 E AndroidRuntime: at java.lang.Thread.run(Thread.java:784) 07-01 10:53:09.330 1184 1922 W ActivityManager: Force finishing activity pl.domain.appname/.AppActivity
The error says that the lib is either not there or empty. This is what you need to check.
@jsulm Corrupted library is pretty obvious. Does it really matter, if it's missing or empty?
I am more interested in why same build works on some devices, but not on others? Could the library in package be compatible only with one SoC architecture (like v7a), and fails on other (v8)? Is it problem with my code, my build and Gradle files, or something inside Qt?
Does it really matter, if it's missing or empty?
Looks like it does, as it is being loaded at runtime using dlopen.
Different (incompatible) architecture can be a problem as well.
"Is it problem with my code, my build and Gradle files, or something inside Qt?" - no, it rather looks like corrupted/missing lib or maybe a lib for incompatible architecture.
There is kirin 659 inside this tablet, which supports v7a. Moreover, I just realized, application was working fine on this device earlier. So, problem lies somewhere in my own code. I just have no idea, how to track it down. Tomorrow, I will try reproduce it inside Samsung Remote test lab, or AWS device farm. Then update/reinstall Qt, and move commit by commit from project beginning, to find out corrupted code.
Btw, is it possible, to make in Qt application supporting multiple ABI inside one apk?