Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting Kotlin to Java

Tags:

Can anyone help me about converting Kotlin code in Android Studio to Java?

I went through the below process:

Tools >> Kotlin>> Decompile Kotlin to Java

But the "Kotlin to Java" option is disabled. What should I do?

enter image description here

like image 634
Saiteja Kolan Avatar asked Jun 17 '18 10:06

Saiteja Kolan


1 Answers

Currently Tools >> Kotlin>> Decompile Kotlin to Java is enabled only for compiled Kotlin classes (.class, not .kt extension) located at app/build/tmp/kotlin-classes/ after a successful build.

A note to the @Uriel Frankel's workaround:

If Tools >> Kotlin >> Show Kotlin Bytecode >> Decompile button is disabled (or not shown) the Java Bytecode Decompiler plugin should be installed: Preferences >> Plugins >> search forJava Bytecode Decompiler` >> check the plugin & press OK.

like image 182
Onik Avatar answered Oct 02 '22 11:10

Onik