2016-05-08 64 views
1

我願意將Acra添加到我的android studio項目中。Android Studio Gradle - 無法解決依賴關係:acra

然而,儘管tutorial看起來很簡單,我無法得到的依賴,而我得到的錯誤:

無法解析:ch.acra:ACRA:4.8.5

等級文件:

buildscript { 
    repositories { 
     mavenCentral() 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:1.5.0' 
     classpath 'com.google.gms:google-services:1.5.0' 
    } 
} 

apply plugin: 'com.android.application' 
apply plugin: 'com.google.gms.google-services' 

dependencies { 
    compile fileTree(dir: 'libs', include: '*.jar') 
    compile 'com.android.support:support-v4:21.+' 
    compile 'ch.acra:acra:4.8.5' 
    compile 'com.google.android.gms:play-services-location:8.3.0' 
    compile ('com.google.android.gms:play-services-analytics:8.3.0') { 
     exclude module: 'support-v4' 
    } 

} 

我錯過了什麼?

我也是在終端得到這樣的:

* What went wrong: 
A problem occurred configuring root project 'WifiCapture'. 
> Could not resolve all dependencies for configuration ':_debugCompile'. 
    > Could not find ch.acra:acra:4.8.5. 
    Searched in the following locations: 
     file:/Users/myuser/Library/Android/sdk/extras/android/m2repository/ch/acra/acra/4.8.5/acra-4.8.5.pom 
     file:/Users/myuser/Library/Android/sdk/extras/android/m2repository/ch/acra/acra/4.8.5/acra-4.8.5.jar 
     file:/Users/myuser/Library/Android/sdk/extras/google/m2repository/ch/acra/acra/4.8.5/acra-4.8.5.pom 
     file:/Users/myuser/Library/Android/sdk/extras/google/m2repository/ch/acra/acra/4.8.5/acra-4.8.5.jar 
    Required by: 
     :MyApp:unspecified 

* Try: 
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. 

回答

0

你可以嘗試使用這樣的:編譯 'ch.acra:ACRA:4.9.0-RC-2'

+0

任何ACRA版本 – htafoya

1

這可能是一個連接問題。嘗試強制gradle重新下載所有依賴項。如果不工作,檢查防火牆等

+0

相同的結果,謝謝之外。我如何重造以重新下載? – htafoya

+0

http://stackoverflow.com/questions/13565082/how-can-i-force-gradle-to-redownload-dependencies – F43nd1r

+0

沒有工作..我不知道如果gradle搜索本地文件..我包括刷新所有內容後終端上的輸出。 – htafoya

1

的問題是,repositories塊應該是buildscript