Update module created from local aar

安稳与你 提交于 2019-12-03 11:01:22
Raphael Royer-Rivard

I thought that importing a aar file as a module was the only solution to include a local aar file, but it seems that it can be done easily by simulating a repository with a flat directory.

In your project gradle file in the allprojects.repositories tag, add the following :

flatDir {
    dirs 'libs'
}

In your app module, make sure you have a libs folder with the aar file in it. Then add the compile line in the dependencies tag of your app module gradle file.

dependencies {
    compile 'package:name:version@aar'
}

Now, when you update the aar file in your libs directory, your app will use the updated version of your library.

Note:

  • In compile 'package:name:version@aar', name is physical file name of the library. For example lib-debug or lib-release etc.
  • version and package can be found in AndroidManifest.xml inside .aar file. (How to open .aar file?)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!