For a unknown reason Android Studio 3.1 Canary 3 is bugged and stopped to work, I updated gradle to 3.1-alpha03
and it stopped working, no matter if I download the project again, already downloaded Android Studio again too.
I've already checkout old versions of the project, but this message still show:
Gradle sync failed: com.android.tools.idea.gradle.project.model.AndroidModuleModel.getSelectedVariant()Lcom/android/tools/idea/gradle/project/model/ide/android/IdeVariant; (8s 806ms)
I've removed .idea
folder, .gradle
folder, did invalidate and restart
I don't know nothing more to do, cant run or use the IDE.
Edit:
Edit2:
New Projects doesnt work too
It's a problem with Kotlin
1.1.60-release-Studio3.0-1
plugin.Uninstall it from Android Studio and fetch an older version from here: https://plugins.jetbrains.com/plugin/6954-kotlin
Try to download and install this kotlin plugin for android studio 3.1
I encountered the same problem after upgrading to:
&
Kotlin plugin 1.2.31
Everything is now okay.
Faced same problem after upgrading to Android Studio 3.1 stable.
Kotlin plugin version was 1.2.30-release-Studio3.1-1
So manually upgraded to,
and boom, problem solved.
In short, try upgrading to most relevant plugin to fix gradle sync failure.
solved:
first run ->
find ~ -path ~/Library/Caches/Metadata/Safari -prune -o -iname \*android\*studio\* -print -prune
DELETE ALL FOLDERS related to android-studio
start fresh install and project setup
Solution 1: Upgrade Plugin
First go to Tools menu > Select Kotlin > Configure Kotlin Plugin Updates > Select one of the kotlin plugin & press download (stable or early access, i chose early access to solve this issue)
And finally change the kotlin version in build.gradle(Project:) according to the downloaded version
Solution 2: Downgrade Plugin
If your on mac then press:
Command + ,
to open preference, then select plugin & search for kotlin & uninstall it, it will rollback to previous version: 1.1.51On Windows machine, press
Control + Alt + S
to open settings dialog, then select plugins & search for kotlin & uninstall it, it will rollback to previous version: 1.1.51Please Note: Do not uncheck kotlin in plugins else it will disable kotlin & fail to recognise kotlin file & syntax