Android studio无法创建类和接口问题解决办法

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

这就很尴尬了,到底是哪里出了问题,根据template报错,打开file->setting->file and templates 发现里边的templates 全部是空的,class没有模板,我就从别人那里考了一份出来粘贴上,发现可以新建类了,ok,问题得到解决。

但是过几天发现又出问题了,再次打开studio,发现templates又空了,总不能每次开IDE都重新复制一次

最终的解决办法如下:

打开studio所在的文件夹(在这之前请关闭studio),

在bin文件夹下找到这个文件studio.exe.vmoptions

使用记事本打开这个文件

添加下面这句话:

-Djdk.util.zip.ensureTrailingSlash=false

保存,ok,重启studio,打开file and templates,发现所有的templates 都存在了,问题解决。

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容