如何不复制在Android Studio中的一个库项目引用? [英] How to reference without copying a library project on Android Studio?

查看:377
本文介绍了如何不复制在Android Studio中的一个库项目引用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是的,我到处都可以学习如何从一个项目,将复制库项目做一个模块。但是,这是没有好,因为在库项目的改变能够对使用它的每一个项目被复制。所以,我怎么可以参考它这是一个动态的方式在项目外的一个文件夹?

Yes, everywhere I can learn how to make a module from a project that will copy the library project. But that's no good, since a change in the library project would have to be replicated on every project that uses it. So, how can I reference it from a folder that's outside the project in a dynamic way?

推荐答案

明白了:
在项目中,去settings.gradle并声明是这样的:

包括:LibReferenceName
项目(':LibReferenceName')PROJECTDIR =新的文件(settingsDir,'../relativePath/toThe/libraryModule/fromTheProject')

而在需要的库的模块,包括它的的build.gradle是这样的:

编制项目(路径:':LibReferenceName')

And at the modules that requires the library, include something like this in the build.gradle of it: compile project(path: ':LibReferenceName')

您也不能使用settingsDir,只是把该项目的绝对路径。

You can also not use settingsDir and just put the absolute path of the project.

这篇关于如何不复制在Android Studio中的一个库项目引用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆