I have a library that is being built in Eclipse, but I would like to upload it to jCenter to be used as a gradle dependency in an Android Studio project. I have tried building the gradle files in Eclipse, making a Bintray account, and trying to link it to jCenter but nothing seems to go through. It may be because I have not published it on Bintray, but I also do not see any option to publish it anyway.
You need to add Bintray plugin to your Gradle project. Please see the examples.
Related
I have a gradle zip file that I want to use as a dependency in my project in intelliJ.
So I opened that project using Open and then pointing to build.gradle file. Tried to run it and got Could not find or load main class.
How to solve this and then also how to add this project to some other project as a dependency in IntelliJ.
I am fairly new to IntelliJ and Java project settings, will appreciate any help. Thanks in advance!
To add it as a dependency you can use this this
The developers of that project have chosen to promote JitPack as the way to consume their JARs. You can tell because their Github project page has a little "JitPack" badge at the top of the readme. If you click on that badge, it takes you to this page showing how to add the dependency to your Gradle or Maven project.
If you're not yet using Maven or Gradle, this is a great opportunity to learn :-)
Gradle Java tutorial
Maven tutorial
When you open your Maven or Gradle project in IntelliJ, it will automatically resolve the dependencies for you.
I am trying to incorporate the Google Direction Library created by https://github.com/akexorcist/Android-GoogleDirectionLibrary
In the README it shows the following downloads. I know how to add gradle dependencies, but what does adding proguard and maven do and how do I add it?
Maven
Proguard
You can add the dependency either via Maven OR Gradle. So if you're using Gradle, that's 100% fine and just do that.
As for Proguard, there should be a file called "proguard-rules.pro" or something like that in your project. Simply copy the text from the Github page and paste it into that file in your project.
That's it.
I've created a library for Android and now I would like to publish it. I have followed this guide and got it to work on jcenter and I'm able to use it.
The uploaded file, however, is an *.aar file.
How can I get it to compile and upload a .jar?
The Gradle project in the blog post you refer to is an Android library project, that's why it creates aar file.
For example of a Java project (that create a jar), take a look at Bintray's GitHub examples repository. If you work with Gradle, probably the
gradle-bintray-plugin-examples/publications-example/ will be the right one to begin with.
I am experiencing difficulties to install some project based on a build.gradle file. I was told in a precedent post, that I should use Android Studio but it seems even more difficult (reported conflict for gradle 1.10 and Android Studio). So I am asking if it is possible to import the project directly in my ide, https://github.com/chrisbanes/ActionBar-PullToRefresh. If yes, should I put the library folder below in my libs folder ? Here's a screen of the file hierarchy
Since you are using Android Studio and Gradle, you could import it as suggested by the QuickStart page :
The easiest way to add ActionBar-PullToRefresh to your project is via
Gradle, you just need to add the following dependency to your
build.gradle:
dependencies {
mavenCentral()
compile 'com.github.chrisbanes.actionbarpulltorefresh:library:+'
}
I believe this is by far the easiest way to include that great library in your project.
If you are using Eclipse, you can still use the library, just download the project and create a create a new library project with the code from "library".
Check the guide http://www.jetbrains.com/idea/webhelp/cloning-a-repository-from-github.html
and other github integration http://www.jetbrains.com/idea/webhelp/using-github-integration.html
My company operates behind a firewall with no access to outside networks (including the internet.) We use Maven and wish to use the ActionBarSherlock code. There are two problems:
If you want to simply include the dependency to the libapk in your pom file, you need internet connectivity to download this file.
Otherwise, you must load in the Sherlock as a separate project and reference it in your Android project. This is a hassle in that anybody else that wants to work on the project must download both projects, not to mention that Maven will still not work.
Is there any way to install Sherlock as a true dependency (installed in your Maven repository) without internet and without creating another project?
I tried several things (making a libapk from the actionbarsherlock project and sticking it in the repo, Creating a jar from the actionbarsherlock project and adding it to libs folder - but then you cannot find the resources needed like themes, adding the .jar file in to maven) but nothing seems to work.
Any help would be appreciated.
You can manually install jars into your local maven repository:
Guide to installing 3rd party JARs
Later if maven tries to access internet when compiling or on other phase you can use mvn -o to manage dependencies offline