问题描述
有人可以帮助我将Android Studio 中的 Kotlin 代码转换为 Java 吗?
Can anyone help me about converting Kotlin code in Android Studio to Java?
我经历了以下过程:
工具>> Kotlin >>将Kotlin反编译为Java
但是"Kotlin to Java"选项被禁用.我该怎么办?
But the "Kotlin to Java" option is disabled. What should I do?
推荐答案
当前仅对位于 Kotlin 类(.class
,而不是.kt
扩展名)启用Tools >> Kotlin>> Decompile Kotlin to Java
> 构建成功后.
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.
@Uriel Frankel 解决方法的注释:
如果已禁用(或未显示)Tools >> Kotlin >> Show Kotlin Bytecode >> Decompile button
,则应安装Java Bytecode Decompiler
插件:Preferences >> Plugins >> search for
Java Bytecode Decompiler` >>检查插件&按确定.
If Tools >> Kotlin >> Show Kotlin Bytecode >> Decompile button
is disabled (or not shown) the Java Bytecode Decompiler
plugin should be installed: Preferences >> Plugins >> search for
Java Bytecode Decompiler` >> check the plugin & press OK.
这篇关于将Kotlin转换为Java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!