Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.2.0, 6.4.1, 6.5.0, 6.6.0
-
None
-
-
510cc564c (dev), 7f7fd8ce9 (6.6), c76c25da8 (tqtc/lts-6.5), 8bc4fa84b (tqtc/lts-6.2)
-
2023wk44FOQtforAndroid
Description
It seems the native implementations of the QtAndroidExtras module are missing in Qt 6.4.1.
Trying to create an Android service and use ServiceConnection with a custom QAndroidBinder implementation gives this error:
java.lang.UnsatisfiedLinkError: No implementation found for boolean org.qtproject.qt.android.extras.QtNative.onTransact(long, int, android.os.Parcel, android.os.Parcel, int) (tried Java_org_qtproject_qt_android_extras_QtNative_onTransact and Java_org_qtproject_qt_android_extras_QtNative_onTransact__JILandroid_os_Parcel_2Landroid_os_Parcel_2I)
Did the native implementations get lost when moving QtAndroidExtras into QtBase?
Implementations in 5.15: https://code.qt.io/cgit/qt/qtandroidextras.git/tree/src/androidextras/android/qjnionload.cpp?h=5.15
Missing somewhere here? https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/platform/android/qandroidextras.cpp?h=6.4.1
Workaround: I copied the implementation into my project and then it works.
extern "C" jboolean Java_org_qtproject_qt_android_extras_QtNative_onTransact(JNIEnv */*env*/, jclass /*cls*/, jlong id, jint code, jobject data, jobject reply, jint flags) { if (!id) return false; return reinterpret_cast<QAndroidBinder*>(id)->onTransact(code, QAndroidParcel(data), QAndroidParcel(reply), QAndroidBinder::CallType(flags)); }
Note: same is true for ServiceConnection::onServiceConnected/Disconnected.
Attachments
For Gerrit Dashboard: QTBUG-114971 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
515922,3 | Android: add missing extras native methods impls and registration | dev | qt/qtbase | Status: MERGED | +2 | 0 |
516076,3 | Android: add missing extras native methods impls and registration | 6.6 | qt/qtbase | Status: MERGED | +2 | 0 |
516984,2 | Android: add missing extras native methods impls and registration | tqtc/lts-6.5 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |
516990,3 | Android: add missing extras native methods impls and registration | tqtc/lts-6.2 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |