Shima Erfan
Shima Erfan

Reputation: 357

Cannot connect to jcenter() in android studio

I'm trying to import MusicBobber library in android studio. I had download and import the example project but when I sync the project this error showed up:

Error:A problem occurred configuring project ':app'.
    A problem occurred configuring project ':audiowidget'.
    Could not download support-media-compat.aar (com.android.support:support-media-compat:24.2.0)
    Could not get resource 'https://jcenter.bintray.com/com/android/support/support-media-compat/24.2.0/support-media-compat-24.2.0.aar'.  
    Could not GET 'https://jcenter.bintray.com/com/android/support/support-media-compat/24.2.0/support-media-compat-24.2.0.aar'.  
    Connection to 'https://jcenter.bintray.com' refused

when I try to open the https://jcenter.bintray.com , site will open with no problem. also I'm using freegate for proxy. where is the problem and what should I do?

Upvotes: 10

Views: 9126

Answers (2)

Gulshan
Gulshan

Reputation: 61

Replacing

jcenter() with maven { url 'https://maven.aliyun.com/repository/jcenter' }

worked for me.

Upvotes: 6

Iman Irajian
Iman Irajian

Reputation: 197

In Android Studio, go to

File> Settings...> Appearance & Behavior> System Settings> HTTP Proxy

then choose Auto-detect proxy settings

finally Synchronize your project.

Note:

Make sure your SDK and Android Studio and gradle are update. I run the project successfully with these system's configurations:

  • Android Studio 2.1.3
  • gradle-2.14.1
  • SDK:
  • Android Support Repository 32
  • Google Play services 32
  • Android Repository 32

Upvotes: 5

Related Questions