簡體   English   中英

手動下載Android Studio中gradle項目超時的依賴文件

[英]Manually download dependency file that times out for gradle project in Android Studio

我正在嘗試使用 gradle 將 Robobinding 與 AspectJ 添加到 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'

以及我的 Module: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”給出的答案。

如果您使用的是Android 0.8工作室或以上,更詳細的答案是這里由@user“SamRad”。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM