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

余生颓废 提交于 2020-07-19 11:15:43

问题


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


回答1:


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)



回答2:


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.




回答3:


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..)



来源:https://stackoverflow.com/questions/60467308/no-cached-version-of-com-android-tools-buildaapt23-6-1-6040484-available-for-o

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!