Android studio無法創建類和接口問題解決辦法。提示 Unable to 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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM