How to compile forked library in Gradle?

前端 未结 4 1082
你的背包
你的背包 2020-12-05 00:35

I want to compile the following library in my project in build.gradle:

https://github.com/theDazzler/Android-Bootstrap

It is forked from https:/

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-05 01:03

    This fork isn't published in the maven central repo.

    Then you can't use an import like compile com.theDazzler:androidbootstrap:+

    You have to: - clone this library locally as a module in your project Clone the https://github.com/theDazzler/Android-Bootstrap/tree/master/AndroidBootstrap folder in your root/module1 folder.

      root:
          module1
            build.gradle
          app
            build.gradle
          settings.gradle
    
    • Change your settings.gradle file in

      include ':module1' include ':app'

    In your app/build.gradle file you have to add:

    dependencies {
        // Module Library
        compile project(':module1')
    }
    

    Finally in your module1/build.gradle you have to check the level used for gradle plugin.

    EDIT 31/10/2015:

    You can use another way to add a dependency with a github project,using the github repo and the jitpack plugin
    In this case you have to add this repo tp your build.gradle

    repositories {
            // ...
            maven { url "https://jitpack.io" }
        }
    

    and the dependency:

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

提交回复
热议问题