Important: Please read the Qt Code of Conduct -

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 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.

    I added the libs as dependencies to build.gradle but it seems they are completely ignored:
    @dependencies {
    compile ''
    compile ''
    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.

  • Look at how to include Facebook SDK into Android Qt application:

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

Log in to reply