Important: Please read the Qt Code of Conduct -

Third party jar to use with qt5 for android

  • Hello

    I am trying to load jar library which is described here "AN_233_Java_D2xx_for_Android_API_User_Manual.pdf":

    I am using Qt5.1.1

    This is sample of code and corresponding debug printout
    jclass Intent = environment->FindClass("android/content/Intent");
    qDebug() << "Intent" << Intent;
    jclass Activity = environment->FindClass("android/app/Activity");
    qDebug() << "Activity" << Activity;
    jclass D2xxManager = environment->FindClass("com/ftdi/j2xx/D2xxManager");
    qDebug() << "D2xxManager" << D2xxManager;
    jclass FtDeviceInfoListNode = environment->FindClass("com/ftdi/j2xx/D2xxManager$FtDeviceInfoListNode");
    qDebug() << "FtDeviceInfoListNode" << FtDeviceInfoListNode;
    e = virtualMachine->DetachCurrentThread();

    D/Qt (17677): ../androjqt/main.cpp:53 (int main(int, char**)): Intent 0x1d200011
    D/Qt (17677): ../androjqt/main.cpp:55 (int main(int, char**)): Activity 0x1d200015
    D/Qt (17677): ../androjqt/main.cpp:58 (int main(int, char**)): D2xxManager 0x0
    D/Qt (17677): ../androjqt/main.cpp:60 (int main(int, char**)): FtDeviceInfoListNode 0x0
    E/AndroidRuntime(17677): FATAL EXCEPTION: Thread-398
    E/AndroidRuntime(17677): java.lang.NoClassDefFoundError: com/ftdi/j2xx/D2xxManager$FtDeviceInfoListNode
    E/AndroidRuntime(17677): at Method)
    E/AndroidRuntime(17677): Caused by: java.lang.NoClassDefFoundError: com/ftdi/j2xx/D2xxManager
    E/AndroidRuntime(17677): ... 1 more
    E/AndroidRuntime(17677): Caused by: java.lang.ClassNotFoundException: com.ftdi.j2xx.D2xxManager
    E/AndroidRuntime(17677): at dalvik.system.BaseDexClassLoader.findClass(BaseDex

    Here i see that finding classes in general is working, but my important library can't be found.
    I have the two jar files in project/android/libs

    I haven't built qt from sources, it is from official binary distribution.

    Am i doing something wrong?
    Where is some documentation about loading third party jar libraries?

    Thank you for any help

Log in to reply