10

I'm doing an Android Studio project (from this tutorial here: http://www.kilobolt.com/day-2-setting-up-libgdx.html).

When I press New Java Class I'm getting the error that's described in the title:

Unable to parse template "Class" Error message: This template did not produce a Java class or an interface.

I don't know why. I've searched on this site, there doesn't seem to be an answer.

There are No error messages in the code.

For what it is worth, I recently updated the gradle version for android studio before. Anyone know how to fix this?

Erick Adam
  • 399
  • 6
  • 13
  • 2
    backup your .AndroidStudio directory, delete it. And configure everything from scratch. – Oleg Aug 06 '17 at 17:18
  • How do I do this? – Erick Adam Aug 06 '17 at 17:46
  • I mean I know how but I'm wondering where the .androidstudio directory is located. – Erick Adam Aug 06 '17 at 18:47
  • Depends on your operating system, don't you know how to find a directory? – Oleg Aug 06 '17 at 18:51
  • I mean I do for pretty much everything else. I use Windows. Is it under C:/Users/username/AndroidStudio2.3 ? Or like C:/User/ProgramFiles/ ? That's what I was asking. – Erick Adam Aug 06 '17 at 18:59
  • c:\users\username\.AndroidStudio2.3 – Oleg Aug 06 '17 at 19:24
  • Thanks, I figured. I actually already solved the issue by editing the file template. Do you know what causes this issue to happen though? is it just a bug/glitch? – Erick Adam Aug 06 '17 at 19:37
  • Don't know. Glad you fixed it. – Oleg Aug 06 '17 at 19:40
  • 12
    For those who are still not able to fix. In android studio 2017, Go to File->setting->editor->file and code templates, select Class in the files tab and paste this #if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end #parse("File Header.java") public class ${NAME} { } – Semicolon Aug 10 '17 at 13:32
  • The reason is you maybe installed the 64 bit version on a 32 bit machine. I had the same problem. – SolderingIronMen Aug 10 '17 at 21:10

0 Answers0