Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
221 views
in Technique[技术] by (71.8m points)

android studio - Converting Kotlin to Java

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...