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
Related
I have a unity project I am exporting that project as android studio project while opening the android studio project I am getting this error
Gradle sync failed: Could not find manifest-merger.jar
(com.android.tools.build:manifest-merger:26.0.1).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/manifest-merger/26.0.1/manifest-merger-26.0.1.jar
I have a few old exported project that was working fine before but today they are also giving the same error.
I finally fixed the issue. This may be a workaround but it works.
So if anyone having this issue, just follow this:
Swap the position of jcenter() and google() in project gradle file and in also all the other module you have in your project. Like in mine I have crashlytics, fabric so just remember to make the changes in their build.gradle file as well:
buildscript {
repositories {
jcenter()
google()
}
}
to
buildscript {
repositories {
google()
jcenter()
}
}
Before building your project again go to your project folder and delete the .gradle folder from your project and then build your project.
Go to Publishing Settings/Build, enable Custom Gradle Template
Go to Assets/Plugins/Android/mainTemplate.gradle and change the postion from
buildscript {
repositories {
jcenter()
google()
}
to
buildscript {
repositories {
google()
jcenter()
}
Remove gradle cache and rebuild. For Mac you can run rm -rf $HOME/.gradle/caches/ in terminal.
Jcenter no longer hosts google dependencies, these can be resolved from "https://maven.google.com"
so you can simply add that to the resolvers list along with jcenter.
Regards,
Itamar
The problem is definitely having jcenter() above google().
However for me, my build.gradle was correct.
The problem happened because of one of my dependencies library had that problem.
The problem seemingly started happening out of nowhere, probably because my jar was cached.
I solved the problem by upgrading my problematic library to latest version as that contained a fix.
suddenly gradle is unable to build the same code that was working moments ago !
my project depends on google play service dependencies
it says :
Could not find play-services-basement.aar (com.google.android.gms:play-services-basement:15.0.1).
Searched in the following locations:
https://jcenter.bintray.com/com/google/android/gms/play-services-basement/15.0.1/play-services-basement-15.0.1.aar
I think the aar file was removed from google by mistake
Does anyone have any idea, what is going on?
Add google() repository in your build.gradle. And check that google() is before jcenter().
The problem seems to be with jcenter. I have spent hours together with this problem and your problem seems to be similar to mine and I think the following solution should work.
For some reason and for many libraries in jcenter, the pom files of many libraries are kept in place but corresponding aar files have been removed. This is also the case with play-services-basement library. Check the following here for reference ( pom file of play-services-basement is available at jcentre here but aar file is not available at jcentre here):
Solution :
In your project level gradle file , change the following block of code
allprojects {
repositories {
jcenter()
google()
}
}
to
allprojects {
repositories {
google()
jcenter()
}
}
why this works ?
In our first code block, when gradle tries to resolve a dependency in the repository(in my case,it was google-services-basement in jcentre repository), it ddi not get resolved as corresponding aar files has been removed. As a result , build fails with something like :
Could not find play-services-basement.aar (com.google.android.gms:play-services-basement:15.0.1).
In our second code block, google repository has been referenced before jcenter repository. When gradle build starts, it looks first in the libraries listed first in repositories{... for resolving any library that is used in the project. Now, when gradle tries to resolve play-services-basement in jcenter, it is successful in resolving dependency as corresponding aar file has been made available by google repository(the same aar file of latest version is not available in jcenter repository) which has been referenced before jcenter repository is assessed. Do check and let me know if that works.
IN Worked
allprojects {
repositories {
google()
jcenter()
maven {
url 'https://jitpack.io'
}
maven {
url 'https://maven.google.com'
}
}
suddenly gradle is unable to build the same code that was working moments ago !
my project depends on google play service dependencies
it says :
Could not find play-services-basement.aar (com.google.android.gms:play-services-basement:15.0.1).
Searched in the following locations:
https://jcenter.bintray.com/com/google/android/gms/play-services-basement/15.0.1/play-services-basement-15.0.1.aar
I think the aar file was removed from google by mistake
Does anyone have any idea, what is going on?
Add google() repository in your build.gradle. And check that google() is before jcenter().
The problem seems to be with jcenter. I have spent hours together with this problem and your problem seems to be similar to mine and I think the following solution should work.
For some reason and for many libraries in jcenter, the pom files of many libraries are kept in place but corresponding aar files have been removed. This is also the case with play-services-basement library. Check the following here for reference ( pom file of play-services-basement is available at jcentre here but aar file is not available at jcentre here):
Solution :
In your project level gradle file , change the following block of code
allprojects {
repositories {
jcenter()
google()
}
}
to
allprojects {
repositories {
google()
jcenter()
}
}
why this works ?
In our first code block, when gradle tries to resolve a dependency in the repository(in my case,it was google-services-basement in jcentre repository), it ddi not get resolved as corresponding aar files has been removed. As a result , build fails with something like :
Could not find play-services-basement.aar (com.google.android.gms:play-services-basement:15.0.1).
In our second code block, google repository has been referenced before jcenter repository. When gradle build starts, it looks first in the libraries listed first in repositories{... for resolving any library that is used in the project. Now, when gradle tries to resolve play-services-basement in jcenter, it is successful in resolving dependency as corresponding aar file has been made available by google repository(the same aar file of latest version is not available in jcenter repository) which has been referenced before jcenter repository is assessed. Do check and let me know if that works.
IN Worked
allprojects {
repositories {
google()
jcenter()
maven {
url 'https://jitpack.io'
}
maven {
url 'https://maven.google.com'
}
}
I am trying to add an external dependency from jcenter
compile 'com.droidninja:filepicker:2.0.4'
but I keep getting these errors and I can't figure out what is going wrong.
I have seen the same errors come up in lot of projects but nobody seems to know whats going wrong.
The problem is not with the dependency you just added but the Android Support library's dependencies. The latest SDK updates move towards using the remote Google Maven repository instead of downloading everything to be available locally. In order to fix dependency resolution problems follow the Adding Support Libraries guide. Really briefly this is what you have to do:
Open your project's build.gradle (note that this is not the module's file!)
Add the Google Maven repo to the project repositories:
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
It's also recommended to add the repo to the buildscript block too, so later on the Gradle plugins can be downloaded from there too:
buildscript {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
I integrated HtmlSpanner into my Android application. I'm getting the following error:
Failed to resolve: com.osbcp.cssparser:cssparser:1.5.
How do I solve this error?
Thanks for help
This library is not in the standard Maven repository, that Gradle uses to resolve dependencies.
You should add the following repository address to your build.gradle file:
repositories {
mavenCentral()
maven {
url "http://repo.pageturner-reader.org"
}
}
If somebody is still looking, this lib or its analogue is in
maven repo
So you can just add dependency to build.gradle:
implementation 'com.osbcp:cssparser:1.7'
If you also need HTMLCleaner dependency, you can also find it in the standard repo
And add as a dependency to build.gradle like this:
implementation 'net.sourceforge.htmlcleaner:htmlcleaner:2.26'