Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 496 Vote(s) - 3.47 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why is "Decompile kotlin to java" greyed out in Android Studio 3.1.2

#1
[![enter image description here][1]][1]


[1]:


However, if I manually do "Show Kotlin Bytecode" and click on "Decompile" it will show the correct java code.
Reply

#2
If you write some kotlin and want to see how it gets compiled into JAVA by using the Decompile Kotlin to Java menu, you need to be viewing the compiled .class file and not the Kotlin source .kt file.

After building the app, try to find the compiled *.kt file in the App/build/tmp/kotlin-classes directory. Here is a simple command line you can run in the root of your project to output the location if your Kotlin file is named Hello.kt:

find ./ | grep "Hello.class"

Open the .class file in IntelliJ or Android Studio and the menu will be available to see how your Kotlin was converted to JAVA

Reply

#3
Another option for viewing Kotlin decompiled code is to open Kotlin bytecode tab and press Decompile there.

Go to `Tools -> Kotlin -> Show Kotlin Bytecode` press `Decompile` in the header.

Works for IntelliJ IDEA 2019.3, so I believe it would work in Android Studio as well.
Reply

#4
Install the plugin Kotlin to Java decompiler in android studio.
Open the kotlin file in the editor
Run the action from Code -> Decompile Kotlin to Java
Reply

#5

<b>Answer:</b>
<br>               Because, Even after the update of latest Kotlin version ,Sometimes Plugins for Kotlin to Java Decompiler is disabled (OFF).In Order to Enable it, click on Help from the toolbar of Android studio
[Help][1]
> Go to Find Action or Press(Ctrl+Shift+A)
> Now Click on Actions Tab and search for "Decompile Kotlin to Java"
> Select the Plugin "Decompile Kotlin to Java" and if it is "OFF" toggle it to "ON"
[Image of Plugin][2]

Finally, Go to Tools tab >> find Kotlin >> Show Kotlin Bytecode
[Image for reference ][3]

A new tab will open on the left <br>
[Image of Decompile][4]


[1]:

[2]:

[3]:

[4]:
Reply

#6
Install Kotlin to Java Decompiler

[![enter image description here][1]][1]


Then go to **tools->kotlin-> show kotlin bytecode** to see byte code information.

you can further check the java equivalent code by using **Decompile** button in the bytecode window.

[![enter image description here][2]][2]


[1]:

[2]:
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through