简体   繁体   中英

How to implement fixed version of library to my Android studio project?

This library contains 1 bug.

It was fixed here: https://github.com/heinrichreimer/material-intro/pull/287

What is the simplest way to implement this fixed version of the library to my Android studio project? I'm new to using libraries from GitHub, I'd appreciate some help on this.

I'm currently using this: implementation 'com.heinrichreimersoftware:material-intro:2.0.0'

You have several options:

  1. Wait for/Ask the owner to release a new version and use it.

  2. Fork the project and release one version of your own.

  3. Download the library and import it in your project as a dependency.

I'll explain here the third option:

  • Go to https://github.com/heinrichreimer/material-intro .
  • Click the Code button and Download ZIP.
  • Open the ZIP file and open the material-intro-master folder.
  • Rename the library folder to material-intro-library .
  • Open your project in Android Studio.
  • Go to File > New > Import module... and select the material-intro-library folder.
  • Finally, open your build.gradle file and replace implementation 'com.heinrichreimersoftware:material-intro:2.0.0' with implementation project(path: ':material-intro-library')

You can clone material-intro library to your pc. Place the material-intro/lib folder to your project root directory path.

add include ':library' to your setings.gradl

add implementation project(':library') to your app-level build.gradle

You could use JitPack.io which acts as a repository for libraries just like maven and also to compile any Android or Java library using Gradle on GitHub at the required commit (found in the the pull request) and use the compiled library in your project in two steps. No need for waiting, cloning, importing or even compiling on your local PC, all done and covered by JitPack.io. Here are the the steps (retrieved from website):

Step 1. Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

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

Step 2. Add the dependency

dependencies {
        implementation 'com.github.heinrichreimer:material-intro:b35d1c9d65'
}

You could use JitPack.io which acts as a repository for libraries just like maven and also to compile any Android or Java library using Gradle on GitHub at the required commit.

Step 1. Add the JitPack repository to your build file Step 2. Add the dependency

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM