今天在Android Studio 里新建一个注解时,竟然报错了,截图如下:

Unable to parse template "Annotation" Error message: This template did not produce a Java class or a

看到这也是醉了,以前我记得都是可以的啊,现在新建class和Interface都是可以的,唯独新建注解就不行了,于是百度一下,有人说是因为在as的设置里,找到Editor –>File and Code Templates里面的file模板是空的,可是我的并不是空的,我的截图如下:

Unable to parse template "Annotation" Error message: This template did not produce a Java class or a

当然,还是按照他给的方法试了一下,方法如下,结果还是不行,也是醉了。
Unable to parse template "Annotation" Error message: This template did not produce a Java class or a

。。。
于是,忽然,灵机一动,我就试了一下这个方法,自己新建一个File 模板:
截图如下:
Unable to parse template "Annotation" Error message: This template did not produce a Java class or a

点击左上角的加号,新建一个文件,名字为Annotation,右边那一块是从AnnotationType里复制过来的。点击apply,然后去新建一个注解文件,结果就可以了。截图如下。不过我发现,这两个Annotation现在选择哪一个都可以新建成功,真奇怪。

Unable to parse template "Annotation" Error message: This template did not produce a Java class or a

相关文章:

  • 2021-09-03
  • 2022-12-23
  • 2021-12-20
  • 2021-09-08
  • 2021-04-12
  • 2021-09-28
  • 2021-08-01
  • 2021-10-16
猜你喜欢
  • 2021-09-15
  • 2021-04-25
  • 2021-12-07
  • 2022-12-23
  • 2022-12-23
  • 2021-04-26
  • 2021-11-19
相关资源
相似解决方案