Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kotlin app build failed due to "Could not initialize class com.intellij.ide.highlighter.JavaFileType"

I've just updated Android Studio to 2.2 and now my Kotlin project won't build. The gradle synch works fine, but when attempting to build I'm immediately presented with an error that reads:

Error:Execution failed for task ':app:compileDebugKotlin'.
> Could not initialize class com.intellij.ide.highlighter.JavaFileType

I've checked that my Kotlin plugin is up to date. This error sounds like something to do with the IDE and highlighting Java code? Any help would be appreciated.

like image 746
Mick Byrne Avatar asked Oct 10 '16 01:10

Mick Byrne


1 Answers

Open Tools | Kotlin | Configure Kotlin Plugin Updates in the main menu, then choose Check for Updates. Be sure that yo're using Stable channel.

Close Android Studio, go to your project's directory, and delete build and app/build folders. Run Android Studio. Deleted folders would be recreated.

Hope it will help

like image 84
piotrek1543 Avatar answered Jan 03 '23 21:01

piotrek1543