0

I have a Kotlin project that I need to convert in Java. I don't know if it is possible in Android Studio ? Can the Kotlin's logics be converted in Java's without loosing anything or having some issues when running the app ?

If YES, how to do it perfectly ?

Félix Maroy
  • 1,389
  • 2
  • 16
  • 21
  • Thanks a lot. This question was already answered here https://stackoverflow.com/questions/34957430/how-to-convert-a-kotlin-source-file-to-a-java-source-file – Félix Maroy Jun 28 '19 at 08:19
  • Just watch out, the decompiled code will look super ugly and disgusting... Trust me, I've tried... – SnakeException Jun 28 '19 at 15:41

1 Answers1

3

You have to do the following to get java code from kotlin:

Menu > Tools > Kotlin > Show Kotlin Bytecode

Click on the Decompile button

Copy the java code

With a version (1.2+) of the Kotlin plugin you also can directly do Menu > Tools > Kotlin -> Decompile Kotlin to Java.

Try to be sure that everythings works fine.

Hope it helps.

Andrea Ebano
  • 563
  • 1
  • 4
  • 16
  • Thanks, I find solutions here https://stackoverflow.com/questions/34957430/how-to-convert-a-kotlin-source-file-to-a-java-source-file – Félix Maroy Jun 28 '19 at 08:19