Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-114971

QAndroidBinder: implementation for native methods missing

    XMLWordPrintable

Details

    • Android
    • 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

        Activity

          People

            assam Assam Boudjelthia
            Chrisu Christian Bartsch
            Votes:
            6 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews