Converting Kotlin to Java

后端 未结 4 1154
醉梦人生
醉梦人生 2020-12-07 00:37

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

I went through the below process:

Tools >> Kotlin

4条回答
  •  青春惊慌失措
    2020-12-07 01:19

    Seems like a bug.

    Tools -> Kotlin -> Decompile Kotlin to Java

    Was actually disabled for me too even after a successful build (In my side Android Studio v3.2) so, I went through this:

    Click on the Kotlin (Compiled class):

    Selected Tools -> Kotlin -> Show Kotlin Bytecode

    Then kotlin bytecode window appeared:

    Made JVM 8 Target as selected and then decompile gave me the java class.

    Note that this happened when Java Bytecode Decompiler plugin was enabled on the Android Studio.

    Update:

    This however might have some issues even after converting to java and perhaps, we should wait for the newest releases.

提交回复
热议问题