• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Android Studio 3.0.1 - Cannot Create Class

I've seen similar questions regarding my issue but non of them answer or solved my issue. I'm getting the following two responses when trying to create a new Java Class in Android Studio 3.0.1.

  1. Unable to parse template "Class" Error message: This template did not produce a Java class or an interface package com.floresfandit.myapplication;

  2. Error parsing file template: Encountered ").\n */\n" at File Header.java[line 2, column 40] Was expecting one of: "[" ... "}" ...
I have no code written, other than what was populated when selecting the Blank Activity at new project. I've already re-installed Android Studio 3.0.1 three times. If by chance I don't get an exact answer is it possible to create blank activities, which will create both the Java Class and XML file and just use the Java Class as a workaround?
 
It would help to show the code that's causing the problem ;)
 
#if (${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end

#if (${IMPORT_BLOCK} != "")${IMPORT_BLOCK}
#end
#parse("File Header.java")

#if (${VISIBILITY} == "PUBLIC")public #end #if (${ABSTRACT} == "TRUE")abstract #end #if (${FINAL} == "TRUE")final #end class ${NAME} #if (${SUPERCLASS} != "")extends ${SUPERCLASS} #end #if (${INTERFACES} != "")implements ${INTERFACES} #end {
}
 
Is this some kind of pre processed Java template? Because that is not Java code.

Are you running a tool to read that and create a Java class? If so, what?
 
Sorry for slow responses. No, I don't use a tool of any sort. I didn't have any issue until I upgraded Android Studio to 3.0.1. As a update I found a solution that worked, but it isn't the best solution for everyone. Basically I created a new Windows Profile on my laptop and when I setup Android Studio to be used the first time I didn't import the other profile's settings. Now it's working properly, I can create Java Classes on the fly again. It's not ideal for everyone but it worked. Plus now I can keep all my programming files/stuff separate from my other personal stuff. Just have to login into different profiles, but that's no biggie.
 
Is this some kind of pre processed Java template? Because that is not Java code.

Are you running a tool to read that and create a Java class? If so, what?
Thanks for your help in trying to point me in the right direction, I posted a solution, but didn't fix the issue.
 
Back
Top Bottom