我已經在我的系統中安裝了Android Studio版本2.1.2,並且如果我在Gradle文件中添加了任何依賴關係,那麼I get failed to resolve error
。Android工作室 - gradle未能解決依賴關係
It happen the all the libraries likes Picasso not only for Junit
於是,我就在gradle.properties
文件
systemProp.http.proxyHost=http://xxxx/xxx
systemProp.http.proxyPort=80
systemProp.https.proxyHost=http://xxxx/xxx
systemProp.https.proxyPort=80
添加代理服務器設置,但我得到了以下錯誤:
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not resolve junit:junit:4.12.
Required by:
MyApplication2:app:unspecified
> Could not resolve junit:junit:4.12.
> Could not get resource 'https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.pom'.
> Could not GET 'https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.pom'.
> http://xxxx/xxx
如何解決這個問題,請在該幫助。
的build.gradle文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "24.0.0"
defaultConfig {
applicationId "com.example.muraliathmarao.myapplication"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
}
你可以發佈你的bulid.gradle嗎? – nshmura
@nshmura,build.gradle添加問題 –
我想你必須在防火牆後面(像Zscaler)。如果那樣的話,那麼你需要在java中導入cacert(ssl證書)並重新啓動android studio。檢查此鏈接,如果有幫助http://javarevisited.blogspot.in/2012/03/add-list-certficates-java-keystore.html – dudego