Include AAR dependency in Android Library Project

前端 未结 4 1913
北荒
北荒 2021-02-06 10:16

In my Android Studio Gradle project I use several libraries, whereas one library should use a local AAR file as dependency. I used the popular solution to include the AAR file a

4条回答
  •  抹茶落季
    2021-02-06 10:18

    I wanted to add my AAR file to my library project. I had to add this to the gradle of my library project

    implementation(files("libs/sublibrary.aar"))
    

    where my 'libs' folder is located at myLibraryName/libs.

    I also had to add the following to the gradle of my Main project

    implementation(files("../myLibraryName/libs/sublibrary.aar"))
    

    Then I synced and it worked.

提交回复
热议问题