zoukankan      html  css  js  c++  java
  • 关于Android studio无法创建Java Class和接口问题解决办法。

       小白,入职了一家新公司,重新配置了studio 的工作环境,拉完代码,刚开始一切正常,在项目上改改bug啥的都没问题,后来加需求要新增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都重新复制一次

    发生在自己身上类似的问题,我用的Android studio版本3.1.1

    点击OK完全没反应,网上各种改settings方法也试过了无效,下面的方法完美解决


    最终的解决办法如下:

    打开studio所在的文件夹(在这之前请关闭studio),
    在bin文件夹下找到这个文件studio.exe.vmoptions
    使用记事本打开这个文件
    添加下面这句话:
    -Djdk.util.zip.ensureTrailingSlash=false
    保存,ok,重启studio,打开file and templates,发现所有的templates 都存在了,问题解决。


    ========================================Talk is cheap, show me the code=======================================

    CSDN博客地址:https://blog.csdn.net/qq_34115899
  • 相关阅读:
    MFC调用C动态库函数-----待补充
    硬盘知识总结:
    Android 四:区分刷机与root
    总结:Linux系统启动流程
    Android 三:手机adb 命令解锁
    UVa11136 Hoax or what
    UVa11988 Broken Keyboard (a.k.a. Beiju Text)
    UVa11280 Flying to Fredericton
    UVa10269 Adventure of Super Mario
    UVa12589 Learning Vector
  • 原文地址:https://www.cnblogs.com/lcy0515/p/9179764.html
Copyright © 2011-2022 走看看