我已经通过以下帖子从我们的nexus服务器下载了一个文件:gradle - download and unzip file from url在我的android项目中,首先指定目标:
compile 'net.myapp.gwt:MyAppGWT:1.0:android@zip'
然后我有这个解压缩任务:
task unzip(type: Copy) {
def zipPath = project.configurations.compile.find {it.name.startsWith("net.myapp.gwt")}
println zipPath
def zipFile = file(zipPath)
def outputDir = file('src/main/assets/')
from zipTree(zipFile)
into outputDir
}
问题在于行
project.configurations.compile
生成最奇怪的错误。应用它会给我以下错误:
Error:Could not find com.android.support:appcompat-v7:23.0.1.
Searched in the following locations:
file:/Applications/AndroioStudio.app/Contents/gradle/m2repository/com/android/support/appcompat-v7/23.0.1/appcompat-v7-23.0.1.pom
file:/Applications/AndroidStudio.app/Contents/gradle/m2repository/com/android/support/appcompat-v7/23.0.1/appcompat-v7-23.0.1.jar
https://jcenter.bintray.com/com/android/support/appcompat-v7/23.0.1/appcompat-v7-23.0.1.pom
https://jcenter.bintray.com/com/android/support/appcompat-v7/23.0.1/appcompat-v7-23.0.1.jar
https://maven.fabric.io/public/com/android/support/appcompat-v7/23.0.1/appcompat-v7-23.0.1.pom
https://maven.fabric.io/public/com/android/support/appcompat-v7/23.0.1/appcompat-v7-23.0.1.jar
https://nexus.domain.net/content/repositories/apps-releases/com/android/support/appcompat-v7/23.0.1/appcompat-v7-23.0.1.pom
https://nexus.domain.net/content/repositories/apps-releases/com/android/support/appcompat-v7/23.0.1/appcompat-v7-23.0.1.jar
Required by:
apps-android:app:unspecified
Please install the Android Support Repository from the Android SDK Manager.
<a href="openAndroidSdkManager">Open Android SDK Manager</a>
现在,它突然无法找到
com.android.support:appcompat-v7:23.0.1
如果删除该行,不是问题。
答案 0 :(得分:1)
@RaGe是对的。将库添加到我们的本地repo服务器就可以了。尽管如此,正如您所说,这是一种解决方法,从长远来看,找到更好的解决方案可能会很好。
答案 1 :(得分:0)