Can't resolve dependency in Android Studio with jcenter -


why program hang on resolving dependency appdebug in andorid studio? can't resolve library.

this root gradle file:

buildscript { repositories {      jcenter()  } dependencies {     classpath 'com.android.tools.build:gradle:1.5.0'      // note: not place application dependencies here; belong     // in individual module build.gradle files } }  allprojects { repositories {     jcenter() } } 

and app gradle :

apply plugin: 'com.android.application'  android { compilesdkversion 23 buildtoolsversion "23.0.2"  defaultconfig {     applicationid "com.example.alimohammadi.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(dir: 'libs', include: ['*.jar']) testcompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:design:23.1.1' } 

and can't resolve junit. , can't access https://jcenter.bintray.com/ browser (it gave me connection time out while other site return true response).

after 1 day time wasting found it's gift iranian developer :d

finally switch mavencentral(). changing mavencentral() in root gradle . , problem solved.

my root build.gradle file turn below code:

buildscript { repositories {     mavencentral()  } dependencies {     classpath 'com.android.tools.build:gradle:1.5.0' } }  allprojects { repositories {     mavencentral() } } 

some library don't exist in mevencentral have add proxy our gradle.properties file below access jcenter :d

systemprop.http.proxyhost=www.somehost.org systemprop.http.proxyport=8080 systemprop.http.proxyuser=user systemprop.http.proxypassword=password systemprop.http.nonproxyhosts=localhost systemprop.http.auth.ntlm.domain=domain 

or https

systemprop.https.proxyhost=www.somehost.org systemprop.https.proxyport=8080 systemprop.https.proxyuser=user systemprop.https.proxypassword=password systemprop.https.nonproxyhosts=localhost systemprop.https.auth.ntlm.domain=domain 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -