0

My task is moving (from my home PC to my work PC) Android Studio 3.0 from PC1 on Windows 7 (32 bit) to PC2 on Windows 7 (64 bit). PC2 is always working offline. I've set in "Android Studio" on PC1 "Offline work" and synced it. Then I've tried to turn off the internet and created a new project. The project has built and run successfully.

Then I've copied to a flash drive from PC1 the next folders:

  1. C:\Users\User1\.android
  2. C:\Users\User1\.AndroidStudio3.0
  3. C:\Users\User1\.gradle
  4. D:\Android Studio
  5. D:\AndroidSDK

and I've pasted them to PC2 into:

  1. C:\Users\User2\.android
  2. C:\Users\User2\.AndroidStudio3.0
  3. C:\Users\User2\.gradle
  4. F:\Android Studio
  5. F:\AndroidSDK

After building of a new project the Gradle Console writes this:

F:\AndroidStudioProjects\app\build.gradle Error:Error:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve javax.annotation:javax.annotation-api:1.2. Open File
Show Details Error:Error:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not download junit.jar (junit:junit:4.12): No cached version available for offline mode Open File
Show Details Error:Error:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not download javawriter.jar (com.squareup:javawriter:2.1.1): No cached version available for offline mode Open File
Show Details Error:Error:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not download javax.inject.jar (javax.inject:javax.inject:1): No cached version available for offline mode Open File
Show Details Error:Error:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not download hamcrest-integration.jar (org.hamcrest:hamcrest-integration:1.3): No cached version available for offline mode Open File
Show Details Error:Error:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not download hamcrest-library.jar (org.hamcrest:hamcrest-library:1.3): No cached version available for offline mode Open File
Show Details Error:Error:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not download jsr305.jar (com.google.code.findbugs:jsr305:2.0.1): No cached version available for offline mode Open File
Show Details Error:Error:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not download hamcrest-core.jar (org.hamcrest:hamcrest-core:1.3): No cached version available for offline mode Open File
Show Details Error:Error:Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not download junit.jar (junit:junit:4.12): No cached version available for offline mode Open File
Show Details Error:Error:Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not download hamcrest-core.jar (org.hamcrest:hamcrest-core:1.3): No cached version available for offline mode Open File
Show Details Error:Error:Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not download junit.jar (junit:junit:4.12): No cached version available for offline mode Open File
Show Details Error:Error:Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not download hamcrest-core.jar (org.hamcrest:hamcrest-core:1.3): No cached version available for offline mode Open File
Show Details

What's wrong?

  • see this one https://stackoverflow.com/questions/46949622/android-studio-3-0-unable-to-resolve-dependency-for-appdexoptions-compilecla – Nawrez Nov 08 '17 at 10:00

2 Answers2

0

Try to uncheck "offline mode" for awhile, lets its download all dependencies.. its because gradle try to get depedencies from gradle cache..

Hallaz
  • 109
  • 2
  • 3
  • 16
  • I can't do it. PC2 hasn't an internet connection. I tried to do this on PC1. Then move all files from PC1 on PC2. The same problem. – Андрей Хорошавин Nov 09 '17 at 05:21
  • ive experiencing same problem with you, i spend hours for solution but that one is worked for me.. for android studio, internet connection is mandatory, u need internet for ur PC2... – Hallaz Nov 10 '17 at 06:11
0

I've found the solution. I've copied from PC1 C:\Users\Public.gradle and pasted it in the same directory on PC2. I've been working on PC2 without any internet connection))