How do I generate Diagrams and UML of Kotlin code?

you can click only on a package in the project tree and click "Show Diagram...". Also it generates diagram from the Java point of view (shows Java's signatures and facade classes)

enter image description here


May be it help others.

Currently, existing class diagram generator like SimpleUML(You can download it from android studio plugin repository) is not able to create class diagram of Kotlin class. But you can use this plugin for Kotlin with little more effort.

Open activity class in android studio.

Go to tool -> Kotlin -> Show Kotlin Bytecode. New side tab will open and show byte code of selected activity class.

Click on top decompile of generated Kotlin bytecode which generate className.decompile.java class.

Click on class name and then right click on mouse. In many options click on 'add to simpleUML diagram'. Create new or add diagram in existing file.

If you face problem, let me know.

Note: - If you will install SimpleUML then it may create issue. Make sure you download SimpleUMLCE for working in the best way.