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

QJniObject cannot find class in 6.2

    XMLWordPrintable

Details

    • Android
    • 2021wk24PO2

    Description

      Note: This ticket's content has been moved from QTBUG-84382, and it has been originally reported by aqadir.

      Tring to call a function inside java file from main.cpp, which is extending org.qtproject.qt.android.bindings.QtActivity. My java file is under android/src/<package-name> folder.

      In version 5.1, used to call like below:

      QAndroidJniObject jClass = QAndroidJniObject("poc/dialogue/Hello", "(Landroid/app/Activity;)V",
                                                                                   QtAndroid::androidActivity().object<jobject>());
      jClass.callMethod<void>("showDialogue");

       

      In preview version 6.2, trying to call like below:

      QJniObject jClass = QJniObject("poc/dialogue/Hello", "(Landroid/app/Activity;)V",                                       QtAndroidPrivate::activity());

      jClass.callMethod<void>("showDialogue");

       

      It throws the below error in 6.2 but was working fine in 5.1. Can you please guide the correct way?

      W System.err: java.lang.ClassNotFoundException: Didn't find class "poc.dialogue.Hello" on path: DexPathList[[],nativeLibraryDirectories=[/system/lib64, /product/lib64]]

      Attachments

        Issue Links

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

          Activity

            People

              assam Assam Boudjelthia
              assam Assam Boudjelthia
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes