how to import your own github forked library into android studio

前端 未结 5 1928
不思量自难忘°
不思量自难忘° 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条回答
  •  闹比i
    闹比i (楼主)
    2021-02-01 20:04

    • Fork and library from Github you want improve
    • Open Android Studio > Load Project from Version Control
    • Select the project or enter the url (You must be signed to Github version control)
    • Now you can Commit and Push to Github without any issues.
    • Tag the project with new version, Git > Tag > Create tag
    • Open the app gradle file and add:
    apply plugin: 'com.github.dcendents.android-maven'
        group='com.github.yourgithubusername'
    

    and open the root gradle file and add:

       classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
    
    • Go to Android Studio Terminal And type: ./gradlew install
    • Now Commit and Push to github
    • Go to Jitpack (SignIn with Github on 1st Use)
    • Select the library
    • Copy the Gradle plugin code after selecting the tag:

    implementation 'com.github.username:repo:tag'

提交回复
热议问题