Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to compile forked library in Gradle?

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

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

It is forked from https://github.com/Bearded-Hen/Android-Bootstrap, but no documentation in the repository explains how to include in in project.

I tried something like this:

compile 'com.theDazzler:androidbootstrap:+' 

but gradle failed and shows error that library not found.

Edit: Can anyone fork it and/or publish it?

like image 891
xyz Avatar asked Jan 12 '15 20:01

xyz


People also ask

How do I fork a project in Android Studio?

Forking the repository You'll need to fork it first and push the branch to your fork. To do this, go to the GitHub repository and press fork. You'll need the URL of your repository in the next step, as we'll push the branch to it.

Is gradle 7 compatible with Java 8?

Compiling and testing Java 6/7Gradle can only run on Java version 8 or higher. Gradle still supports compiling, testing, generating Javadoc and executing applications for Java 6 and Java 7. Java 5 and below are not supported.

What Java version gradle uses?

A Java version between 8 and 18 is required to execute Gradle. Java 19 and later versions are not yet supported. Java 6 and 7 can still be used for compilation and forked test execution. Any supported version of Java can be used for compile or test.


1 Answers

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'     } 
like image 62
Gabriele Mariotti Avatar answered Sep 22 '22 06:09

Gabriele Mariotti