如何将自己的 github 分叉库导入 android studio [英] how to import your own github forked library into android studio

查看:27
本文介绍了如何将自己的 github 分叉库导入 android studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 GitHub 上找到了一个不错的开放库,我使用 Gradle 依赖项将它导入到我的 Android Studio 项目中,但后来我意识到我需要对其进行一些修改.

I found a nice open library on GitHub, I imported it into my Android Studio project using Gradle dependencies, but then I realized I need to make little modifications on it.

所以我在我的 GitHub 上分叉了这个库,完成了修改并请求了一个拉取请求,但我不能等到他们批准并将我的修改与原始代码合并.

So I forked the library on my GitHub, done the modifications and asked for a pull request, but I can't wait until they approve and merge my modifications with the original code.

有没有办法使用依赖项将我的分叉库(在我的 Github 中)导入我的 Android Studio 项目,而不是原始库?

Is there a way to use dependencies to import my forked library (in my Github) into my Android Studio project, rather than the original library?

推荐答案

我知道这是一个老帖子,但是对于有类似问题的人来说,如果你只是想改变一个库并在你的项目中使用它,您可以下载 lib 代码,对其进行更改并作为模块导入到您的项目中:

I know that this is an old post, but for someone with similar problem, if you simply want a way to change a lib and use it in your project, you can download the lib code, change it and import into your project as a module:

  1. 在 Android Studio 中打开您的项目
  2. 下载库(使用 Git 或 zip 存档解压缩)
  3. 转到文件 > 新建 > 导入模块并将库作为模块导入
  4. 在项目视图中右键单击您的应用并选择打开模块设置"
  5. 点击依赖项"标签,然后点击+"按钮
  6. 选择模块依赖"
  7. 选择导入的模块
  8. 打开您的 build.gradle 文件并检查该模块是否列在依赖项下.

这篇关于如何将自己的 github 分叉库导入 android studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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