设为首页 加入收藏

TOP

Android studio无法创建类和接口问题解决办法。提示 Unable to parse template "Class"
2019-09-17 15:40:40 】 浏览:52
Tags:Android studio 无法 创建 类和 接口 问题 解决 办法 提示 Unable parse template " Class"

重新配置了studio 的工作环境, 没问题,后来加需求要新增java类和接口,这就出现问题了,新建的时候,就会报错:

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
保存, 重启studio,打开file and templates,发现所有的templates 都存在了 。
 
原文地址:  https://blog.csdn.net/renhaijuniryfe/article/details/78629942
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇C:\Program Files\Java\jdk1.7.0_.. 下一篇Error:Execution failed for task..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目