Manually adding Gradle resources offline (in Android Studio)

After moving to China recently (i.e. last week), I set up Android Studio on a new computer. Because of the "Great Firewall of China," I have serious problems with projects. I get error messages from Gradle Sync and Gradle Build. Here are my posts:

Gradle Sync

C:\Users\Lars\AndroidStudioProjects\ChatClientColors\app\build.gradle
Error:Failed to resolve: javax.inject:javax.inject:1
Error:Failed to resolve: org.hamcrest:hamcrest-integration:1.1
Error:Failed to resolve: javax.annotation:javax.annotation-api:1.2
Error:Failed to resolve: org.hamcrest:hamcrest-library:1.1
Error:Failed to resolve: junit:junit-dep:4.10
Error:Failed to resolve: com.google.code.findbugs:jsr305:2.0.1
Error:Failed to resolve: com.squareup:javawriter:2.1.1
Error:Failed to resolve: org.hamcrest:hamcrest-core:1.1

Gradle Build

Information:Gradle tasks [:app:assembleDebug]
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugAndroidTestCompile'.
   > Could not resolve junit:junit-dep:4.10.
     Required by:
         ChatClientColors:app:unspecified > com.android.support.test:runner:0.2
      > Could not resolve junit:junit-dep:4.10.
         > Could not get resource 'https://jcenter.bintray.com/junit/junit-dep/4.10/junit-dep-4.10.pom'.
            > Could not GET 'https://jcenter.bintray.com/junit/junit-dep/4.10/junit-dep-4.10.pom'.
               > peer not authenticated
   > Could not resolve com.squareup:javawriter:2.1.1.
     Required by:
         ChatClientColors:app:unspecified > com.android.support.test.espresso:espresso-core:2.1
      > Could not resolve com.squareup:javawriter:2.1.1.
         > Could not get resource 'https://jcenter.bintray.com/com/squareup/javawriter/2.1.1/javawriter-2.1.1.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/squareup/javawriter/2.1.1/javawriter-2.1.1.pom'.
               > peer not authenticated
   > Could not resolve org.hamcrest:hamcrest-integration:1.1.
     Required by:
         ChatClientColors:app:unspecified > com.android.support.test.espresso:espresso-core:2.1
      > Could not resolve org.hamcrest:hamcrest-integration:1.1.
         > Could not get resource 'https://jcenter.bintray.com/org/hamcrest/hamcrest-integration/1.1/hamcrest-integration-1.1.pom'.
            > Could not GET 'https://jcenter.bintray.com/org/hamcrest/hamcrest-integration/1.1/hamcrest-integration-1.1.pom'.
               > peer not authenticated
   > Could not resolve org.hamcrest:hamcrest-library:1.1.
     Required by:
         ChatClientColors:app:unspecified > com.android.support.test.espresso:espresso-core:2.1
      > Could not resolve org.hamcrest:hamcrest-library:1.1.
         > Could not get resource 'https://jcenter.bintray.com/org/hamcrest/hamcrest-library/1.1/hamcrest-library-1.1.pom'.
            > Could not GET 'https://jcenter.bintray.com/org/hamcrest/hamcrest-library/1.1/hamcrest-library-1.1.pom'.
               > peer not authenticated
   > Could not resolve javax.inject:javax.inject:1.
     Required by:
         ChatClientColors:app:unspecified > com.android.support.test.espresso:espresso-core:2.1
      > Could not resolve javax.inject:javax.inject:1.
         > Could not get resource 'https://jcenter.bintray.com/javax/inject/javax.inject/1/javax.inject-1.pom'.
            > Could not GET 'https://jcenter.bintray.com/javax/inject/javax.inject/1/javax.inject-1.pom'.
               > peer not authenticated
   > Could not resolve com.google.code.findbugs:jsr305:2.0.1.
     Required by:
         ChatClientColors:app:unspecified > com.android.support.test.espresso:espresso-core:2.1
      > Could not resolve com.google.code.findbugs:jsr305:2.0.1.
         > Could not get resource 'https://jcenter.bintray.com/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.pom'.
               > peer not authenticated
   > Could not resolve javax.annotation:javax.annotation-api:1.2.
     Required by:
         ChatClientColors:app:unspecified > com.android.support.test.espresso:espresso-core:2.1
      > Could not resolve javax.annotation:javax.annotation-api:1.2.
         > Could not get resource 'https://jcenter.bintray.com/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2.pom'.
            > Could not GET 'https://jcenter.bintray.com/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2.pom'.
               > peer not authenticated
   > Could not resolve org.hamcrest:hamcrest-core:1.1.
     Required by:
         ChatClientColors:app:unspecified > com.android.support.test.espresso:espresso-core:2.1
      > Could not resolve org.hamcrest:hamcrest-core:1.1.
         > Could not get resource 'https://jcenter.bintray.com/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.pom'.
            > Could not GET 'https://jcenter.bintray.com/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.pom'.
               > peer not authenticated
Information:BUILD FAILED
Information:Total time: 1.0 secs
Information:1 error
Information:0 warnings
Information:See complete output in console

, HTTPS ( sdk, ). , , . Gradle , - , ...

, stackoverflow , Gradle , Gradle " ". ( .pom?) ? , - .gradle? ? Gradle, ?

!

+4

All Articles