I'm trying to Support eclipse IDE to use my aar based on this link
I encountered a problem when trying to iterate over compile dependncies
configurations.compile.filter {it.name.endsWith 'jar'}.each { File file -> moveJarIntoLibs(file)}
I got
Error:Could not find com.android.support:support-v13:22.1.1.
Searched in the following locations:
file:/C:/Users/myUser/.m2/repository/com/android/support/support-v13/22.1.1/support-v13-22.1.1.pom
file:/C:/Users/myUser/.m2/repository/com/android/support/support-v13/22.1.1/support-v13-22.1.1.jar
Required by:
com.company.project.sdk.android:project:3.0.0-SNAPSHOT
If I remark this line the build is successful.
Also, I have the support library installed.
Any ideas how to support Eclipse IDE / Resolve this problem?
It seems that the problem was related to the fact that support repository is not included automatically as a repository. I found the related issue in Android project issue 69270 and followed the suggestion of adding the local support repository as maven repository
repositories {
def androidHome = System.getenv("ANDROID_HOME")
mavenCentral()
maven {
url "$androidHome/extras/android/m2repository/"
}
}
Now the problem no longer occur.
Related
In recent days I'm getting failed to resolve github libraries for so many popular libraries. I know it generally happens when the library is suspended or not available. But i tried it for so many libraries. And getting same result. But doesn't mean every libraries don't work. Some works.
For example..
I tried it for PhotoView..
compile 'com.github.chrisbanes:PhotoView:2.0.0'
In the release page the latest version was 2.0.0
I get same thing for so many other libraries. I think last week I updated the gradle. So is that why I'm getting this problem for some libraries..
Or what can be the problem..
I'm also using all maven urls for all libraries as mentioned in the docs file..
Make sure you added this root build.gradle file (Not your module build.gradle file):
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
FYI
New version has been released, You can try with
compile 'com.github.chrisbanes:PhotoView:2.1.3'
After that, Clean-Rebuild-Run.
... even when the error reports the correct download URL.
(Bintray details below.)
Gradle Repo
repositories {
jcenter()
maven { url 'https://dl.bintray.com/myUsername/myRepo/' }
}
Dependencies
compile('com.domain.groupid:library-core:v1.2.3#aar') {
transitive=true
}
compile('com.domain.groupid:library-support:v1.2.3#aar') {
transitive=true
}
Error
Error:Could not find library-core.aar (com.domain.groupid:library-core:v1.2.3).
Searched in the following locations:
https://dl.bintray.com/myUsername/myRepo/com/domain/groupid/library-core/v1.2.3/library-core-v1.2.3.aar
If I copy that URL, I can download it in a signed out window. Why does Gradle have a problem with it?
There is another similar compile dependency (listed here as library-support), but I'm assuming it didn't get to it because this one failed first.
The setup...
I have a personal public repo on Bintray, with two android libraries.
https://bintray.com/myUsername/myRepo/library-core
https://bintray.com/myUsername/myRepo/library-support
Both have versions upload by the bintray rule in my library's gradle scripts. The versions upload, I can see them in the bintray UI, and I can download them and see that they are what I expected:
https://dl.bintray.com/myUsername/myRepo/com/domain/groupid/library-core/maven-metadata.xml
https://dl.bintray.com/myUsername/myRepo/com/domain/groupid/library-core/library-core-v1.2.3/library-core-v1.2.3-sources.jar
https://dl.bintray.com/myUsername/myRepo/com/domain/groupid/library-core/library-core-v1.2.3/library-core-v1.2.3.aar
https://dl.bintray.com/myUsername/myRepo/com/domain/groupid/library-core/library-core-v1.2.3/library-core-v1.2.3.pom
// Same for library-support. All of these download in a signed out window.
Is gradle expecting something else?
Maven usually doesn't expect the v prefix in the version attribute. It's implied by the order of coordinate syntax: <group>:<name>:<version>. Using semantic versioning for the version number should do the trick.
I had a similar issue, adding another answer to hopefully help others in the future.
In my case, I first only uploaded the .jar file to the maven repo, then when I uploaded the .aar file, it couldn't find it even though the error URL properly linked to the artifact.
Adding
--refresh-dependencies
to my gradle command fixed the issue for me
I'm currently attempting to include this github repository to my android studio project. I tried following the instructions given in this question but to no avail.
I've added the line maven { url "https://jitpack.io" } to my project build.gradle as well as this line compile 'com.github.karussell:snacktory' to my module build.gradle file and I get a failed to resolve error. In the question that I linked earlier, it says to follow this format for adding the library compile 'com.github.User:Repo:Tag' but I'm not sure what the tag part of it is supposed to be.
The github repo has a pom.xml file which lists other dependencies which I've been able to add without an issue. Any suggestions on how to include this particular library?
I used this repo as suggested by #Randyka Yudhistira and it worked perfectly!
In order to fetch the cwac-camera commonsware jar, I have this in build.grade:
dependencies {
compile 'com.commonsware.cwac:camera:0.6.+'
}
when I try and compile, it gives me this:
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not find com.commonsware.cwac:camera:0.6.12.
Searched in the following locations:
https://jcenter.bintray.com/com/commonsware/cwac/camera/0.6.12/camera-0.6.12.pom
https://jcenter.bintray.com/com/commonsware/cwac/camera/0.6.12/camera-0.6.12.jar
file:/home/alex/android/android-sdk-linux/extras/android/m2repository/com/commonsware/cwac/camera/0.6.12/camera-0.6.12.pom
file:/home/alex/android/android-sdk-linux/extras/android/m2repository/com/commonsware/cwac/camera/0.6.12/camera-0.6.12.jar
file:/home/alex/android/android-sdk-linux/extras/google/m2repository/com/commonsware/cwac/camera/0.6.12/camera-0.6.12.pom
file:/home/alex/android/android-sdk-linux/extras/google/m2repository/com/commonsware/cwac/camera/0.6.12/camera-0.6.12.jar
Required by:
Cwac4:app:unspecified
so its looking in jcenter, and in a bunch of my home directory files and failing to find anything. I think it should look on github as I know there are releases here: https://github.com/commonsguy/cwac-camera/releases, so how can I tell it that?
additionally, when I manually include the jar in one of my home directories for instance, it compiles with no errors, but using import com.commonsware.camera..(anything basically) results in "could not resolve symbol commonsware" errors. I take this to mean that I can't just manually put it somewhere and that perhaps android studio needs to see it in an official repository for it to allow importing it. Is this correct?
NOTE: I know that this library is slated to be rewritten. I would like to use it anyways if possible.
so how can I tell it that?
Quoting the current version of the documentation:
To integrate the core AAR, the Gradle recipe is:
repositories {
maven {
url "https://repo.commonsware.com.s3.amazonaws.com"
}
}
dependencies {
compile 'com.commonsware.cwac:camera:0.6.+'
}
You appear to have added the dependencies but did not update your repositories.
Use this
repositories {
maven { url 'https://repo.commonsware.com.s3.amazonaws.com' }
maven { url 'https://jitpack.io' }
maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
}
I try to repair the dependency to google play services in my android project. It already worked but now it is broken. I think this happened in between the Android Studio beta- and release-version.
This is the dependency in the build.gradle file:
dependencies {
compile 'com.google.android.gms:play-services:6.5.87'
}
Android Studio was able to autocomplete the version string: '6.5.87' So I thought it knows how to solve the dependency. But it does not.. This is what I treid:
reinstaled Android Studio (1.0.1) and the Android SDK
used several play-service versions (incl. tried to use '+')
tried to 'gradlew clean' the project
installed almost everything from the Android SDK Manager. (incl. Google Repository and Android Support Repository)
set all environment variables to the correct path
But I still get this error if I try to do a gradle project sync:
Error:Could not find com.google.android.gms:play-services:6.5.87.
Searched in the following locations:
file:/C:/Users/MyName/.m2/repository/com/google/android/gms/play-services/6.5.87/play-services-6.5.87.pom
file:/C:/Users/MaName/.m2/repository/com/google/android/gms/play-services/6.5.87/play-services-6.5.87.jar
https://repo1.maven.org/maven2/com/google/android/gms/play-services/6.5.87/play-services-6.5.87.pom
https://repo1.maven.org/maven2/com/google/android/gms/play-services/6.5.87/play-services-6.5.87.jar
https://oss.sonatype.org/content/repositories/snapshots/com/google/android/gms/play-services/6.5.87/play-services-6.5.87.pom
https://oss.sonatype.org/content/repositories/snapshots/com/google/android/gms/play-services/6.5.87/play-services-6.5.87.jar
https://oss.sonatype.org/content/repositories/releases/com/google/android/gms/play-services/6.5.87/play-services-6.5.87.pom
https://oss.sonatype.org/content/repositories/releases/com/google/android/gms/play-services/6.5.87/play-services-6.5.87.jar
Required by:
code:android:1.0
UPDATE:
Gradle is searching in "file:/C:/Users/MyName/.m2/repository/" but it should use
"file:/C:/Users/MyName/AppData\Local\Android\sdk\extras\google\m2repository" .. I dont know why this is wrong and how to fix it..
UPDATE 2
I fixed it using this workaround:
repositories {
def androidHome = System.getenv("ANDROID_HOME")
maven { url "$androidHome/extras/android/m2repository/" }
maven { url "$androidHome/extras/google/m2repository/"}
}
But I am not happy with it. Does anybody know whats wrong with my gradle?
In Android SDK Manager download the "Google Repository"
Try download the sdk and use this library
compile 'com.google.android.gms:play-services:7.0.0'
After adding jcenter() to reposetories or top level gradle file I fixed the issue
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.1'
classpath 'com.google.gms:google-services:1.5.0-beta2'
}
}