Important: Please read the Qt Code of Conduct -

How to add aar Android libraries?

  • I need to use Google Firebase. After installing the Android SDK, it appears on the extras directories like a various aar files.

    After reading [](link url), I've created a file and put these inside:


    In every of these directories, I've unzipped the aar file.

    When compile the QT project, the APK generated doesn't contains any of these files, and the application crash because can't found required classes.

  • Do you have "Use Gradle" checked under Projects > Build > Build Android APK settings?

    I had a similar issue and that ended up resolving it for me. When I switched to a newer Qt version, I had to re-check that setting and it found the classes as expected.

  • @Carmoneer Yes, it's checked.
    Please, could you put your and show how is your tree directory? and, on the library directory, have you unzipped the aar? Have you put anything on the pro file?

  • I don't know how much this will help you. My project was working with straight lib project folders, not .aar files. Since you unpacked the .aar files, they should have a similar structure as a lib project folder. You'll likely have to do some tweaking/trail & error to get it to work. Below is the basis of how I was able to get it work.

    Note(): There is likely a less kludgy way of doing this, but this I found to work on Qt 5.6.0 and haven't looked back.

     |  +-bin
     |  +-...
     |  +-libs <-- did not work when placing project lib folder itself  in 'libs' folder
     |     +-.jarFiles
     |  +-src   
     |     +-com/my/app
     |     |
     |     +-myLib   <-- lib project folder(s) inside src
     |     |  +-src/main
     |     |     +-java/com/app
     |     |     | files
     |     |     +-res
     |     |     |  +-res files
     |     |     +-AndroidManifest.xml
     |     |  +-build.gradle
     |  +-AndroidManifest.xml
     |  +-build.gradle
    # Project target.
    PRO File
    Nothing added to .pro file pertaining to the lib project folder added.

    This isn't exactly the issue your facing, but hopefully this helps to steer you in the right direction. Take care and good luck!

  • Finally it worked for me modifying the build.gradle file and simply adding the dependencie:

    dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile ''

    Also, I've deleted the directories referenced on the and the file. Thanks a lot!!

Log in to reply