how update local aar package sources

前端 未结 6 1533
别那么骄傲
别那么骄傲 2021-02-03 20:36

I created two Android Studio applications. One of them is aar library. I used this aar library in second application. I added aar library by using File->New->New Module->Import

6条回答
  •  北海茫月
    2021-02-03 21:09

    Right now you're including the AAR through a project notation. Since an AAR is literally just a file, it should be included with the files notation instead.

    Assuming a folder structure like so:

    You could include the files with any of the following lines in the dependencies block of app/build.gradle:

      // include just my_library
      implementation files('libs/my_library.aar')
    
      // include just other_library
      implementation files("$rootDir/common/libs/other_library.aar")
    
      // include both libraries
      implementation files('libs/my_library.aar', "$rootDir/common/libs/other_library.aar")
    

    By the way, there's a reasonably complete list of supported dependency types at https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.dsl.DependencyHandler.html .

提交回复
热议问题