问题
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
- Click on gradle window (on right side of studio)
- Select the project
- 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