0

Currently, I know more of Java than of Kotlin, so the paste-auto-translation feature is helpful. To do this, I wanted to create a dummy Java class, so that I can write java code and copy-and-paste into a Kotlin file. I right-clicked the directory where other Kotlin files are in a project for which I checked 'Kotlin Support' at its creation, and selected New -> Java class.

But it showed an error : Unable to parse template "Class". What have I done wrong?

enter image description here

Enzokie
  • 7,365
  • 6
  • 33
  • 39
Damn Vegetables
  • 11,484
  • 13
  • 80
  • 135

1 Answers1

1

I believe it is a bug in Android 3.0 release, In order for you to add a template go to:

File > Settings > File and Code Templates and click Class.

Add this code below and hit OK.

#if (${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end

public class ${NAME} {
} 

enter image description here

Enzokie
  • 7,365
  • 6
  • 33
  • 39