how to import your own github forked library into android studio

前端 未结 5 1924
不思量自难忘°
不思量自难忘° 2021-02-01 19:12

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.

5条回答
  •  隐瞒了意图╮
    2021-02-01 20:16

    I think the accepted answer is outdated. There is actually a really easy way to do this nowadays: jitpack.io

    All you need to do is.

    1. add in your root build.gradle at the end of allprojects repositories:

      allprojects { repositories { ... maven { url 'https://jitpack.io' } } }

    2. Add the dependency in your app build.gradle:

      dependencies { implementation 'com.github.User:Repo:Tag' }

    If you don't have any releases/tags, you can also just do com.github.User:Repo:branchname-SNAPSHOT to build from the latest commit on that branch.

提交回复
热议问题