new class文件的时候报Unable to parse template "Class" Error message: This template did not produce a Java

xiaoxiao2021-02-28  41

Android studio new class文件的时候报 Unable to parse template "Class" Error message: This template did not produce a Java class or an interface Error parsing file template: Unable to find resource 'Package Header

这个就奇葩了,什么都没有动过怎么就报这个错了。

原因是file -> class 里面的东西为空,,,模版置空了。

加上就行了。

我的里面是:

#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 { }

上网查,给出的是:

#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end #parse("File Header.java") public class ${NAME} { }

反正多试一试就行了。

转载请注明原文地址: https://www.6miu.com/read-2625490.html

最新回复(0)