Android: Include external library with resources



  • Hello,

    I try to add the external library android-support-v7-mediarouter which works fine for deployment when I add the JAR file to the libs folder.

    The problem is that the resources are missing. I found the following statement on the internet:

    bq. You can't just include the jars. You need to add the android.support.v7.mediarouter project as a Android Library dependency. That way, the resources from the project will get merged into your own.
    Inside the mediarouter folder run android update lib-project -p . and then you can add it as a dependency.
    http://stackoverflow.com/questions/18182535/where-do-i-find-android-support-v7-mediarouter-rattr

    I added the libs as dependencies to build.gradle but it seems they are completely ignored:
    @dependencies {
    compile 'com.android.support:support-v4:21.0.3'
    compile 'com.android.support:mediarouter-v7:21.0.3'
    compile fileTree(dir: 'libs', include: ['*.jar'])
    }@

    bq. [echo] Resolving Dependencies for QtApp...
    [dependency] Library dependencies:
    [dependency] No Libraries

    I wonder how I would achieve the same with Qt Creator? The external libs that I can add seem to be limited to SO files.

    Thanks for any suggestions.
    Dan



  • Look at how to include Facebook SDK into Android Qt application:
    https://github.com/GMaxera/QtFacebook#prepare-facebook-sdk-for-android

    I think that you should do the same for your lib.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.