Can't iterate over compile dependecies due to

2019-06-01 20:08发布

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?

1条回答
啃猪蹄的小仙女
2楼-- · 2019-06-01 20:19

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.

查看更多
登录 后发表回答