Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

[android] external library breaks qt paths



  • Hello,
    By just adding this library in gradle, it looks like path to qt libs changed.

    When the app executed, I got this error :

    E Qt      : Can't create main activity
    E Qt      : java.io.FileNotFoundException: /data/app/com.mycompany.app-ph87IItPlMaBr0irWgjd5Q==/lib/arm64/libplugins_bearer_libqandroidbearer.so (No such file or directory)
    E Qt      : 	at java.io.FileInputStream.open0(Native Method)
    E Qt      : 	at java.io.FileInputStream.open(FileInputStream.java:200)
    E Qt      : 	at java.io.FileInputStream.<init>(FileInputStream.java:150)
    E Qt      : 	at java.io.FileInputStream.<init>(FileInputStream.java:103)
    E Qt      : 	at org.qtproject.qt5.android.bindings.QtLoader.createBundledBinary(QtLoader.java:380)
    E Qt      : 	at org.qtproject.qt5.android.bindings.QtLoader.extractBundledPluginsAndImports(QtLoader.java:448)
    E Qt      : 	at org.qtproject.qt5.android.bindings.QtLoader.startApp(QtLoader.java:575)
    E Qt      : 	at org.qtproject.qt5.android.bindings.QtActivityLoader.onCreate(QtActivityLoader.java:183)
    E Qt      : 	at org.qtproject.qt5.android.bindings.QtActivity.onCreateHook(QtActivity.java:266)
    E Qt      : 	at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:273)
    E Qt      : 	at android.app.Activity.performCreate(Activity.java:7009)
    E Qt      : 	at android.app.Activity.performCreate(Activity.java:7000)
    E Qt      : 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
    E Qt      : 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
    E Qt      : 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
    E Qt      : 	at android.app.ActivityThread.-wrap11(Unknown Source:0)
    E Qt      : 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
    E Qt      : 	at android.os.Handler.dispatchMessage(Handler.java:106)
    E Qt      : 	at android.os.Looper.loop(Looper.java:164)
    E Qt      : 	at android.app.ActivityThread.main(ActivityThread.java:6494)
    E Qt      : 	at java.lang.reflect.Method.invoke(Native Method)
    E Qt      : 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
    E Qt      : 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
    

    Path should be /lib/arm/libplugins_bearer_libqandroidbearer.so instead of /lib/arm64/libplugins_bearer_libqandroidbearer.so

    This append only when I add OpenTok in build.gradle :

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.opentok.android:opentok-android-sdk:2.14.0'
    }
    

    I guess OpenTok has its own libs dir, but then how I can make both works together ?

    Thanks



  • Solved by adding this line in build.gradle

    android {
        ...
        defaultConfig {
            ...
            ndk.abiFilters = ['armeabi-v7a']
        }
    }
    

Log in to reply