gpt4 book ai didi

android - Android Studio中gradle项目手动下载超时的依赖文件

转载 作者:行者123 更新时间:2023-11-29 01:31:14 24 4
gpt4 key购买 nike

我正在尝试使用 gradle 将带有 AspectJ 的 Robobinding 添加到 Android Studio 中的新项目中。当我点击“Sync Project with Gradle Files”时,该过程在过去的 8 小时内一直停留在“Gradle: Download https://jcenter.bintray.com/org/aspectj/aspectjtools/1.8.2/aspectjtools-1.8.2.jar”。它没有超时或抛出一些错误。

我尝试手动下载 aspectjtools-1.8.2.jar 并将其放置在 C:\Users\Knobloch.gradle\caches\modules-2\files-2.1\org.aspectj\aspectjtools\1.8.2 但从附近的文件夹,它们有我需要的某种 GUID 子文件夹。

我尝试在 libs 文件夹中手动添加 jar 并使用:

compile files('libs/aspectjtools-1.8.2.jar')

这没有用。 (现在我注意到我的模块配置中的 gradle compile tree 函数是多余的)。

这是我的项目 build.gradle 的相关部分:

buildscript {
repositories {
jcenter()
maven() {
name 'RoboBinding AspectJPlugin Maven Repository'
url "https://github.com/RoboBinding/RoboBinding-aspectj-plugin/raw/master/mavenRepo"
}
}
dependencies {
classpath 'org.robobinding:aspectj-plugin:0.8.4'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}
}
apply plugin: 'org.robobinding.android-aspectj'
apply plugin: 'com.neenbedankt.android-apt'

以及我模块中的相关部分:app build.gradle:

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:support-v4:22.2.0'
compile "org.robobinding:robobinding:$robobindingVersion"
aspectPath "org.robobinding:robobinding:$robobindingVersion"
//alternatively we can use with-aop-and-dependencies jar(RoboBinding provides a minimal Proguarded with-aop-and-dependencies jar.).
compile("org.robobinding:robobinding:$robobindingVersion:with-aop-and-dependencies") {
exclude group: 'com.google.guava', module: 'guava'
}
aspectPath("org.robobinding:robobinding:$robobindingVersion:with-aop-and-dependencies") {
exclude group: 'com.google.guava', module: 'guava'
}
compile files('libs/aspectjtools-1.8.2.jar')
}

最佳答案

引用@user "Andromeda"here 给出的答案.

如果您使用的是 Android Studio 0.8 或更高版本,更详细的答案是 here通过@user“SamRad”。

关于android - Android Studio中gradle项目手动下载超时的依赖文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31108223/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com