我正在尝试使用gradle将带有AspectJ的Robobinding添加到Android Studio中的新项目中。当我点击"与Gradle文件同步项目"时,该过程一直保持在" Gradle:下载https://jcenter.bintray.com/org/aspectj/aspectjtools/1.8.2/aspectjtools-1.8.2.jar"过夜8小时。它没有超时或抛出一些错误。
我尝试手动下载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编译树功能将是多余的。)
以下是我的Project 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')
}