Issues with Kotlin Plugin for Android Studio

I am using

ext.kotlin_version = '1.2.0-beta-88'

and Android Studio

Android Studio 3.1 Canary
Build #AI-171.4415322, built on October 25, 2017
JRE: 1.8.0_152-release-1012-b01 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.13

My Kotlin Plugin Version is
Version: 1.2.0-beta-88-Studio3.0-1

I am building an app using the android gradle plugin version 3.0.0

    classpath 'com.android.tools.build:gradle:3.0.0'

And now I get the following error.

2017-10-26 22:34:52,431 [e-1012-b01]  ERROR - intellij.openapi.progress.Task - com.android.tools.idea.gradle.project.model.AndroidModuleModel.getSelectedVariant()Lcom/android/tools/idea/gradle/project/model/ide/android/IdeVariant; 
java.lang.NoSuchMethodError: com.android.tools.idea.gradle.project.model.AndroidModuleModel.getSelectedVariant()Lcom/android/tools/idea/gradle/project/model/ide/android/IdeVariant;
	at org.jetbrains.kotlin.android.configure.KotlinGradleAndroidModuleModelProjectDataService.postProcess(KotlinGradleAndroidModuleModelProjectDataService.kt:49)
	at com.intellij.openapi.externalSystem.service.project.manage.ProjectDataManager.lambda$doImportData$0(ProjectDataManager.java:271)
	at com.intellij.openapi.externalSystem.service.project.manage.ProjectDataManager.importData(ProjectDataManager.java:147)
	at com.intellij.openapi.externalSystem.service.project.manage.ProjectDataManager.importData(ProjectDataManager.java:198)
	at com.intellij.openapi.externalSystem.service.project.manage.ProjectDataManager.importData(ProjectDataManager.java:204)
	at com.android.tools.idea.gradle.project.sync.idea.IdeaSyncPopulateProjectTask.doSelectiveImport(IdeaSyncPopulateProjectTask.java:206)
	at com.android.tools.idea.gradle.project.sync.idea.IdeaSyncPopulateProjectTask.populate(IdeaSyncPopulateProjectTask.java:156)
	at com.android.tools.idea.gradle.project.sync.idea.IdeaSyncPopulateProjectTask.access$000(IdeaSyncPopulateProjectTask.java:51)
	at com.android.tools.idea.gradle.project.sync.idea.IdeaSyncPopulateProjectTask$1.run(IdeaSyncPopulateProjectTask.java:144)
	at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:726)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:176)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:556)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:163)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:137)
	at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:334)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

This error only showed up after upgrading from Kotlin plugin 1.2-M2 to 1.2.0-beta-88.

I tried cleaning, restarting, etc. nothing helped yet.

2 Likes

The Kotlin plugin 1.2 is currently incompatible with Android Studio 3.1 Canary. Please use Studio 3.0 or the version of the Kotlin plugin bundled with Android Studio 3.0. We hope that we’ll be able to resolve the incompatibility in time for the 1.2 release.

Thanks for the quick reply.
The Kotlin plugin update was proposed automatically through the AndroidStudio upgrade feature. Maybe you want to avoid pushing this out for now.
How do I get the 3.0 version into 3.1?

Hmm, even on 3.0 stable (with update manager configured to only download stable updates) I get the prompt to upgrade to 1.2-beta-88
52

Still happening with latest plugin release: 1.2.0-rc-39-Studio3.0-1.

Good day, I have same issue

ext.kotlin_version = ‘1.1.60’
Android Studio 3.1 Canary
com.android.tools.build:gradle:3.1.0-alpha03

It started since update plugin to Version: 1.1.60-release-Studio3.0-1

1 Like

@alexeikorshun I had the same problem and solved it by uninstalling the kotlin plugin from Android Studio

thanks, I installed previous version, but I want to install latest version :slight_smile:

56 PM got upgrade message but I have tried many times those upgrades don’t work. Perhaps it would be wise to not push upgrade notifications to platforms your plugin version can’t work with.

ext.kotlin_version = ‘1.2.0’
currently stable plugin is 1.2.0 release Studio3.1.1

for Android Studio 3.1 canary 5

thx for finally pushing the correct update for Studio3.1-1

33 PM

Dear guys.
I installed Android Studio by offline method (depending on this tutorial) because Google repository isn’t available in my country (iran).
Android studio works fine but i cant update Kotlin plugin using offline method.
Please help me :roll_eyes:

No answer to this question? I do not find the answer.!

@maryam you can also find another solution here However it is an every evolving barrier for us!