Kotlin Plugin on Android Studio error


#1

Here is the error from Event Log:
11:48:59 AM Plugin Error: Kotlin threw an uncaught NoSuchMethodError. Disable Plugin
11:48:59 AM NoSuchMethodError: org.jetbrains.android.sdk.AndroidSdkData.getLocalSdk()Lcom/android/sdklib/repository/local/LocalSdk;

Here is the gradle code for kotlin
apply plugin: 'kotlin-android’
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.0.5-3’
compile ‘org.jetbrains.kotlin:kotlin-stdlib:1.0.5-3’

My Android Studio version is 2.2.3

Here is the full stack trace
org.jetbrains.android.sdk.AndroidSdkData.getLocalSdk()Lcom/android/sdklib/repository/local/LocalSdk;
java.lang.NoSuchMethodError: org.jetbrains.android.sdk.AndroidSdkData.getLocalSdk()Lcom/android/sdklib/repository/local/LocalSdk;
at org.jetbrains.android.inspections.klint.IntellijLintClient.getLocalSdk(IntellijLintClient.java:368)
at org.jetbrains.android.inspections.klint.IntellijLintClient.getSdk(IntellijLintClient.java:340)
at com.android.tools.klint.client.api.LintDriver$LintClientWrapper.getSdk(LintDriver.java:2134)
at com.android.tools.klint.checks.ApiLookup.getPlatformVersion(ApiLookup.java:146)
at com.android.tools.klint.checks.ApiLookup.get(ApiLookup.java:199)
at com.android.tools.klint.checks.ApiLookup.get(ApiLookup.java:134)
at com.android.tools.klint.checks.ApiDetector.beforeCheckProject(ApiDetector.java:322)
at com.android.tools.klint.client.api.LintDriver.checkProject(LintDriver.java:931)
at com.android.tools.klint.client.api.LintDriver.analyze(LintDriver.java:455)
at com.android.tools.klint.client.api.LintDriver.analyze(LintDriver.java:396)
at org.jetbrains.android.inspections.klint.AndroidLintExternalAnnotator$1.run(AndroidLintExternalAnnotator.java:148)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1181)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils$2.run(ProgressIndicatorUtils.java:80)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils$5.run(ProgressIndicatorUtils.java:141)
at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:142)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:446)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:392)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:127)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:137)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:77)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:102)
at org.jetbrains.android.inspections.klint.AndroidLintExternalAnnotator.doAnnotate(AndroidLintExternalAnnotator.java:145)
at org.jetbrains.android.inspections.klint.AndroidLintExternalAnnotator.doAnnotate(AndroidLintExternalAnnotator.java:62)
at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doAnnotate(ExternalToolPass.java:218)
at com.intellij.codeInsight.daemon.impl.ExternalToolPass.access$500(ExternalToolPass.java:44)
at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.run(ExternalToolPass.java:160)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:333)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:323)
at com.intellij.util.ui.update.MergingUpdateQueue$3.run(MergingUpdateQueue.java:267)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:282)
at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:234)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:378)
at com.intellij.util.Alarm$Request.run(Alarm.java:389)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:227)
at com.intellij.util.concurrency.BoundedTaskExecutor$2.run(BoundedTaskExecutor.java:187)
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)


#2

The behavior occured when i open a kotlin file


#3

Whiсh exactly version of the Kotlin plugin are you using?


#4

The newest one right now,
1.0.5-release-IJ2016.1-3


#5

There was an error with the plugin repository that caused the wrong version of the plugin to be made available to Android Studio users. Please uninstall and reinstall the plugin, you’ll get the correct version now (1.0.5-release-Studio2.2-3).


#6

@yole Ok that’s resolve my problem, thank you