No cached version of com.android.tools.build:aapt2:3.6.1-6040484 available for offline mode

6.8k views Asked by At

Is there any offline option present in gradle setting of the latest version of android studio ?

3

There are 3 answers

0
Dayananda V On

Just disable gradle offline mode and try, will work fine.

To disable offline mode in Android Studio 3.6.1

  1. Click on gradle window (on right side of studio)
  2. Select the project
  3. Click Toggle Offline Mode button (disable here)
0
Koch On

I tried toggling offline mode (by clicking on it). It doesn't do anything.

Edit: Finally got it working, and this is I did:

Open the build.gradle file from your app folder, it should look similar to this

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.1'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

add google() to repositories in -buildscript and allprojects just like this :

buildscript {
    repositories {
        google()       // here
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.1'
    }
}

allprojects {
    repositories {
        google()      //and here
        jcenter()
    }
}

In Android Studio, go to File -> Project Structure.. [ shortcut : Ctrl + Alt + Shift + S ]

In the Project tab : Android Gradle Plugin Version -> 3.6.1 and Gradle Version -> 5.6.4 |||

Last, under the Module tab, make sure the compile sdk version is > 14 (ie: 25, 28 or 29..)

0
Arun Singh On

Check the SDK version installed in android studio in starting configure SDK manager and check that what version of android is installed.Install other version of android according to requirement also in project structure check the module, set it to android lolipop or lower version. Then toggle offline mode in gradle settings. Sync your project with gradle file,then try running it.