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

registerNatives failes when including Qt5 Library

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.14.2
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Windows 64bit, Android arm64-v8a
    • Platform/s:
      Android

      Description

      I have an Android .so Library, which worked in an Android Studio Java-Android Project when including it with copying the libQt5Core_xx.so files from the installation directory. After implementing some Bluetooth functionality i needed to include Qt5AndroidExtras and Qt5Bluetooth. But this does not work with the same Java-Android project.

      If i try to load the Qt5Bluetooth or the Qt5AndroidExtras shared objects in my Android Studio Project, i get the following Error:t

       

      A/QtBluetooth: Can't find class "org/qtproject/qt5/android/bluetooth/QtBluetoothBroadcastReceiver"
      A/QtBluetooth: registerNatives failed
      A/x.arsdk_dem: java_vm_ext.cc:570] JNI DETECTED ERROR IN APPLICATION: JNI NewGlobalRef called with pending exception java.lang.ClassNotFoundException: Didn't find class "org.qtproject.qt5.android.bluetooth.QtBluetoothBroadcastReceiver" on path: DexPathList[[zip file "/data/app/de.x.arsdk_demo-etFz8gXX3T_dIEbC299GQg==/base.apk"],nativeLibraryDirectories=[/data/app/de.x.arsdk_demo-etFz8gXX3T_dIEbC299GQg==/lib/arm64, /data/app/de.x.arsdk_demo-etFz8gXX3T_dIEbC299GQg==/base.apk!/lib/arm64-v8a, /system/lib64]] 
      A/x.arsdk_dem: java_vm_ext.cc:570] at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:196)
      A/x.arsdk_dem: java_vm_ext.cc:570] at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379) 
      A/x.arsdk_dem: java_vm_ext.cc:570] at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
      A/x.arsdk_dem: java_vm_ext.cc:570] at java.lang.String java.lang.Runtime.nativeLoad(java.lang.String, java.lang.ClassLoader, java.lang.Class) (Runtime.java:-2)
      A/x.arsdk_dem: java_vm_ext.cc:570] at java.lang.String java.lang.Runtime.nativeLoad(java.lang.String, java.lang.ClassLoader) (Runtime.java:1115)
      A/x.arsdk_dem: java_vm_ext.cc:570] at void java.lang.Runtime.loadLibrary0(java.lang.ClassLoader, java.lang.Class, java.lang.String) (Runtime.java:1069)
      A/x.arsdk_dem: java_vm_ext.cc:570] at void java.lang.Runtime.loadLibrary0(java.lang.Class, java.lang.String) (Runtime.java:1007)
      A/x.arsdk_dem: java_vm_ext.cc:570] at void java.lang.System.loadLibrary(java.lang.String) (System.java:1667)
      A/x.arsdk_dem: java_vm_ext.cc:570] at void de.x.arsdk_demo.MainActivity.<clinit>() (MainActivity.java:15)
      A/x.arsdk_dem: java_vm_ext.cc:570] at java.lang.Object java.lang.Class.newInstance() (Class.java:-2)
      A/x.arsdk_dem: java_vm_ext.cc:570] at android.app.Activity android.app.AppComponentFactory.instantiateActivity(java.lang.ClassLoader, java.lang.String, android.content.Intent) (AppComponentFactory.java:95)
      

      When including the Android Extras Library i get the following error:

      A/Qt: Can't find "org/qtproject/qt5/android/extras/QtNative" class
      

      with the same stack trace.

       

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            ablasche Alex Blasche
            Reporter:
            morsch Norman Mörsch
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes