Github Project not available on android studio - android

I forked a project and I made a little modification on https://github.com/oursgris/datetimepicker
How can I make it available in android studio ?
I tryied to add in build.gradle :
dependencies {
compile 'com.github.oursgris.datetimepicker:library:0.0.3'
}
I had an error : Failed to resolve: com.github.oursgris.datetimepicker:library:0.0.3
What did I missed ?
I manage to output aar file but I don't know how to make it available in android studio with a simple dependancy (like other projects)
Regards

You almost got it right. What was missing is that you need to add a repository that stores your 'aar' file. You can do this with JitPack:
repositories {
maven {
url "https://jitpack.io"
}
}
And then add your library as:
dependencies {
compile 'com.github.oursgris:datetimepicker:0.0.3'
}

Related

Unable to use JitPack repository - Android

All day I'm trying to add my Android library to Github with JitPack.
I did everything described on: https://jitpack.io/docs/ANDROID/, with no success.
The problem is, when i try to build project, Android Studio give me message:
Error:(47, 13) Failed to resolve: com.github.linean:btleuart:v1.0.0
Here is my repo: https://github.com/linean/btleuart
If anyone have any idea what should I check please tell me.
Sorry for my english :)
The release "v1.0.0" does not exist. The release name is "1.0.0". So, in your app or library gradle file, replace
compile 'com.github.linean:btleuart:v1.0.0'
by
compile 'com.github.linean:btleuart:1.0.0'
In addition, make sure that you have included JitPack repo in your root gradle file.
allprojects {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
}
}
You can read some examples describing how to use JitPack to include libraries in your projects
I found solution !
Clean project
use /.gradlew build
use /.gradlew install
Compille project
Git - and now its working
Thanks cricket_007 for info about JitPack build log :)
main build.gradle file should have this:
allprojects {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
}
}
you can check a working example here: https://github.com/matoelorriaga/pokemon-mvp/blob/master/build.gradle

failed to resolve com.android.support.constraint:constraint-layout:2.0.0-alpha4

I imported a project from my work-space. After this some errors were shown which I can't solve.
The message
Install Repository and sync project
was shown as a link, but clicking on it didn't solve my problem.
Add ConstraintLayout to your project.
To use ConstraintLayout in your project, proceed as follows:
Ensure you have the "maven.google.com" repository declared in your
module-level build.gradle file:
repositories {
maven {
url 'https://maven.google.com'
}
}
Add the library as a dependency in the same build.gradle file:
dependencies {
compile 'com.android.support.constraint:constraint-layout:1.0.2'
}
In the toolbar or sync notification, click Sync Project with Gradle Files.
The constraintLayout is not available yet on any stable relase of Android Studio. You have to download the latest Android Studio Preview to use it.

Cannot add external library to android studio project

I am trying to add https://github.com/jkwiecien/EasyImage to my Android studio project. When i add the line:
compile 'com.github.jkwiecien:EasyImage:1.2.1'
to my app's build.gradle file, it gives me:
Error(33, 13) Failed to resolve.
Add this line to your root build.gradle
repositories {
maven { url "https://jitpack.io" }
}
https://jitpack.io/#jkwiecien/EasyImage/1.3.1
If you're using gradle, you need two steps:
1. adding jitpack repository to the root build file
2. add your dependency to the EasyImage library to the app build file.
Please try Latest one
dependencies {
compile 'com.github.jkwiecien:EasyImage:1.2.3'
}
I found this answer here: https://android-arsenal.com/details/1/2725#package

Android Studio : Failed to resolve <github dependency>

Let me first start of by saying that I just recently migrated to Android Studio and being totally honest I didn't like it. Now there is this git I am trying to import into my project - https://github.com/ongakuer/CircleIndicator
Although the compile statement which the owner has asked to put creates the error.
I added it into the dependency{} in my build.gradle file.
compile 'me.relex:circleindicator:1.1.5#aar'
Failed to resolve: me.relex:circleindicator:1.1.5#aar
You probably had forgotten this line under your gradle :
allprojects {
repositories {
jcenter()
}
}
Edit the root gradle located in root/build.gradle
I'll just explain a little :
When you add this line : compile 'repository or jar url', it prompts your gradle that it should find the repository (or the jar) and add it to your source.
But where should it search for this particular repository ? That is the purpose of this line, to declare a location from where the gradle should search from. In most of the cases it is - jcenter
(see this link)
Just open build.gradle(Module:app) and copy pase on your dependencies
dependencies {
compile 'me.relex:circleindicator:1.1.5#aar'
}

Android Crashlytics plugin not installing library

When using the Crashlytics plugin in intellij I follow these steps.
Click plugin on toolbar.
Select App
Allow crashlytics to update AndroidManifest.xml as well has my first Activity.
Click "Next"
Try to build the App as the plugin instructs.
Then when i try to build i get this:
package com.crashlytics.android does not exist
I look in my dependencies and library and the jar is nowhere to be found.
What am I missing that would cause the library to not be loaded?
I solved this by following the maven instructions here https://crashlytics.com/downloads/maven and then just grabbing the jar from my .m2 and putting it in my libs folder. (This particular project was started as a maven project, then Maven was discarded and it has not yet been migrated to Gradle, so we're kind of in no-man's land). Anyway, I now have the jar.
The following configuration should work for Gradle-based projects:
buildscript {
repositories {
maven { url "http://download.crashlytics.com/maven" }
}
dependencies {
classpath "com.crashlytics.tools.gradle:crashlytics-gradle:1.+"
}
}
apply plugin: "crashlytics"
repositories {
maven { url "http://download.crashlytics.com/maven" }
}
dependencies {
compile "com.crashlytics.android:crashlytics:1.1.+"
}
Taken from https://crashlytics.com/downloads/gradle
After the automated setup from android studio, I was missing this line:
compile 'com.crashlytics.android:crashlytics:1.1.+'

Categories

Resources