1

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?

Community
  • 1
  • 1
Ika
  • 1,456
  • 1
  • 15
  • 24
  • it only searched your local m2 folder, have you tried adding a remote dependency repo like `jcenter()` or `mavenCentral()`? – Blundell May 17 '15 at 13:28
  • It has access to maven centeral. But as you might know the dependencies that are Android related are not actually coming from the public repositories. Instead the Android Studio has a tool to download the required Android related dependencies and to resolve them. – Ika May 18 '15 at 05:43

1 Answers1

2

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.

Ika
  • 1,456
  • 1
  • 15
  • 24
  • Interesting, think the problem may be elsewhere and this fixes the symptom but at least it works (I don't have this in any of my projects) – Blundell May 18 '15 at 07:48
  • @Blundell Did you try to add code to print your dependencies? (assuming they include support libraries) – Ika May 18 '15 at 13:48
  • I'm not sure it would help in my case since I wanted to iterate inside a gradle task. The objective was coping part of the jars as part of the build process. – Ika May 21 '15 at 06:01
  • it definitely helped me... +1 – TheFuquan Jun 04 '15 at 13:50