Anas Yousuf
Anas Yousuf

Reputation: 523

Disable offline mode and rerun the build

A problem occurred configuring root project 'customerapp'.
> Could not resolve all artifacts for configuration ':classpath'.  
   > Could not resolve com.android.tools.build:gradle:4.1.3.  
     Required by:  
         project :  
      > No cached version of com.android.tools.build:gradle:4.1.3 available for offline mode.  
      > No cached version of com.android.tools.build:gradle:4.1.3 available for offline mode.  
   > Could not resolve com.google.gms:google-services:4.3.5.  
     Required by:  
         project :  
      > No cached version of com.google.gms:google-services:4.3.5 available for offline mode.  
      > No cached version of com.google.gms:google-services:4.3.5 available for offline mode.  
   > Could not resolve com.android.tools.build:gradle:4.1.3.  
     Required by:  
         project : > com.jakewharton:butterknife-gradle-plugin:9.0.0-rc2  
      > No cached version of com.android.tools.build:gradle:4.1.3 available for offline mode.  
      > No cached version of com.android.tools.build:gradle:4.1.3 available for offline mode.  
   > Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.71.  
     Required by:  
         project : > com.jakewharton:butterknife-gradle-plugin:9.0.0-rc2  
      > No cached version of org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.71 available for offline mode.  
      > No cached version of org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.71 available for offline mode.  
   > Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.71.  
     Required by:  
         project : > io.realm:realm-gradle-plugin:7.0.0 > io.realm:realm-transformer:7.0.0  
      > No cached version of org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.71 available for offline mode.  
      > No cached version of org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.71 available for offline mode.  

Possible solution:
 - Disable offline mode and rerun the build

Already checked and applied these answers:-

  1. No cached version of com.android.tools.build:aapt2:3.2.0-alpha18-4804415 available for offline mode
  2. enable & disable Gradle offline mode?
  3. enable/disable offline mode in andriod studio 4.0
  4. Gradle not searching dependencies online

Upvotes: 1

Views: 3848

Answers (2)

Svetlana Rozhkova
Svetlana Rozhkova

Reputation: 178

I had a similar problem. This is solution that worked for me (Android Studion 4.1.1):

  1. As Rodrigo said in the answer above above, go to View > Tool Windows > Gradle

  2. Right click on the project in Gradle tab and select "Refresh Gradle Dependencies" enter image description here

  1. Clean / Rebuild if needed. You may also need to Invalidate cache and restart android studio (File -> Invalidate cache / restart).

Upvotes: 2

Disable Offline Mode

View > Tool Windows > Gradle from the menu bar.

Then, near the top of the Gradle window, click Toggle Offline Mode Gradle offline button in the Gradle panel.

Upvotes: 4

Related Questions