skip to Main Content

Trying to import .aar file into project but cannot find the option of import .jar/aar package inside the add new module.

2

Answers


  1. You must have a project-level "libs" folder. If you have this directory with .aar/.jar files, you can just add a new .aar/.jar file to this folder.

    If you don’t have this directory, see this answer

    But you can use this:

    implementation fileTree (dir: "libs", include: ["* .jar", "* .aar"])
    

    instead of adding a new file implementation to the gradle every time:

    implementation files('../libs/testaarfile.aar') 
    
    Login or Signup to reply.
  2. Copy your aar/jar file to module "libs" folder ( create "applibs" folder if not exist )
    and add this line to your module Build.gradle file:

    implementation files('libs/your_lib_name.aar')
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search