Arbani Oumaima
Arbani Oumaima

Reputation: 366

Decompile Kotlin to JAVA

I am a beginner at Android Studio , and I want the main activity to be on java not on kotlin . I tested some solution available on Stack overflow such as:
menu -> tools -> kotlin -> decompile kotlin to java

  1. Menu > Tools > Kotlin > Show Kotlin Bytecode
  2. Click on the Decompile button
  3. Copy the java code

and always the Decompile button is disabled.

enter image description here

Upvotes: 3

Views: 7619

Answers (1)

pau1adam
pau1adam

Reputation: 597

Your code has some errors that won't let it compile. If you fix those issues the "Decompile" button will re-enable.

However:

I want the main activity to be on java not on kotlin

If this is what you want, it's better you write it in Java in the first place. Chances are the decompiled Java code will be ugly.

Upvotes: 1

Related Questions