w1063042587
「已注销」
采纳率100%
2017-08-02 04:24 阅读 16.6k
已采纳

Android Studio中一些jar包无法打开

50

如题,在启动Android Studio之后会出现以下错误

图片说明

    Entry fileTemplates//code/Google Test Fixture SetUp Method.cc.ft not found in C:/Program Files/Android/Android Studio/lib/idea.jar
    java.io.FileNotFoundException: Entry fileTemplates//code/Google Test Fixture SetUp Method.cc.ft not found in C:/Program Files/Android/Android Studio/lib/idea.jar
        at com.intellij.util.io.URLUtil.openJarStream(URLUtil.java:101)
        at com.intellij.util.io.URLUtil.openStream(URLUtil.java:62)
        at com.intellij.ide.fileTemplates.impl.UrlUtil.loadText(UrlUtil.java:46)
        at com.intellij.ide.fileTemplates.impl.DefaultTemplate.loadText(DefaultTemplate.java:53)
        at com.intellij.ide.fileTemplates.impl.DefaultTemplate.<init>(DefaultTemplate.java:46)
        at com.intellij.ide.fileTemplates.impl.FileTemplatesLoader.loadDefaultsFromRoot(FileTemplatesLoader.java:191)
        at com.intellij.ide.fileTemplates.impl.FileTemplatesLoader.loadDefaultTemplates(FileTemplatesLoader.java:151)
        at com.intellij.ide.fileTemplates.impl.FileTemplatesLoader.<init>(FileTemplatesLoader.java:93)
        at com.intellij.ide.fileTemplates.impl.FileTemplateSettings.<init>(FileTemplateSettings.java:49)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.picocontainer.defaults.InstantiatingComponentAdapter.newInstance(InstantiatingComponentAdapter.java:193)
        at org.picocontainer.defaults.ConstructorInjectionComponentAdapter$1.run(ConstructorInjectionComponentAdapter.java:220)
        at org.picocontainer.defaults.ThreadLocalCyclicDependencyGuard.observe(ThreadLocalCyclicDependencyGuard.java:53)
        at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getComponentInstance(ConstructorInjectionComponentAdapter.java:248)
        at com.intellij.util.pico.CachingConstructorInjectionComponentAdapter.getComponentInstance(CachingConstructorInjectionComponentAdapter.java:58)
        at com.intellij.openapi.components.impl.ServiceManagerImpl$MyComponentAdapter.getComponentInstance(ServiceManagerImpl.java:232)
        at com.intellij.util.pico.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:246)
        at com.intellij.util.pico.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:212)
        at org.picocontainer.defaults.BasicComponentParameter.resolveInstance(BasicComponentParameter.java:77)
        at org.picocontainer.defaults.ComponentParameter.resolveInstance(ComponentParameter.java:114)
        at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getConstructorArguments(ConstructorInjectionComponentAdapter.java:257)
        at org.picocontainer.defaults.ConstructorInjectionComponentAdapter$1.run(ConstructorInjectionComponentAdapter.java:217)
        at org.picocontainer.defaults.ThreadLocalCyclicDependencyGuard.observe(ThreadLocalCyclicDependencyGuard.java:53)
        at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getComponentInstance(ConstructorInjectionComponentAdapter.java:248)
        at com.intellij.util.pico.CachingConstructorInjectionComponentAdapter.getComponentInstance(CachingConstructorInjectionComponentAdapter.java:58)
        at com.intellij.openapi.components.impl.ServiceManagerImpl$MyComponentAdapter.getComponentInstance(ServiceManagerImpl.java:232)
        at com.intellij.util.pico.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:246)
        at com.intellij.util.pico.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:212)
        at com.intellij.openapi.components.ServiceManager.doGetService(ServiceManager.java:46)
        at com.intellij.openapi.components.ServiceManager.getService(ServiceManager.java:41)
        at com.intellij.ide.fileTemplates.FileTemplateManager.getInstance(FileTemplateManager.java:55)
        at com.intellij.codeInspection.defaultFileTemplateUsage.FileHeaderChecker.checkFileHeader(FileHeaderChecker.java:48)
        at com.intellij.codeInspection.defaultFileTemplateUsage.DefaultFileTemplateUsageInspection.checkFile(DefaultFileTemplateUsageInspection.java:65)
        at com.intellij.codeInspection.AbstractBaseJavaLocalInspectionTool$1.visitFile(AbstractBaseJavaLocalInspectionTool.java:98)
        at com.intellij.extapi.psi.PsiFileBase.accept(PsiFileBase.java:70)
        at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:81)
        at com.intellij.codeInspection.InspectionEngine.createVisitorAndAcceptElements(InspectionEngine.java:69)
        at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.runToolOnElements(LocalInspectionsPass.java:286)
        at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitPriorityElementsAndInit$1(LocalInspectionsPass.java:254)
        at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:123)
        at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1029)
        at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$0(ApplierCompleter.java:96)
        at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:494)
        at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:443)
        at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
        at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:106)
        at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:91)
        at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731)
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

然而我用rar打开 C:/Program Files/Android/Android Studio/lib/idea.jar 这个包时又可以找到这个文件,见下图

图片说明

同样的问题还发生在新建类的时候,会报“This template did not produce a Java class or an interface”的错误,当我打开File→Settings→Editor→File and Code Templates→的时候会发现所有的模版都是空的

图片说明

而这个时候关闭设置窗口,又会报“ FileNotFoundException: Entry fileTemplates//default.html not found in C:/Program Files/Android/Android Studio/lib/resources(下划线)en.jar”的错误。而当我用rar打开对应的文件的时候也能找到这个default.html

请求各位大神解决一下,谢谢!

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

11条回答 默认 最新

  • 已采纳
    weixin_40171106 weixin_40171106 2017-09-12 11:41

    谷歌翻墙后终于找到了这个问题的解决方法
    首先,这个问题的出现原因就是系统是32位的,却装了64位IDE,虽然网上一直说Android Studio不分64和32
    解决方法如下
    1.uninstall Android Studio(不卸载SDK)
    2.然后到https://developer.android.google.cn/studio/index.html下载32位的压缩包,解压到原来的目录下
    3.重新打开android studio,加载成功!

    点赞 6 评论 复制链接分享
  • rzlhqn rzlhqn 2017-12-24 09:49

    这样做就可以了
    修改studio.exe.vmoptions和studio64.exe.vmoptions
    -Djdk.util.zip.ensureTrailingSlash=false

    点赞 8 评论 复制链接分享
  • cataclysm2012 cataclysm2012 2017-08-12 01:24

    我是这样解决的:我的系统是win7 64位操作系统,但是由于我之前安装的JDK版本是32位的,所以我在运行android studio的时候选择运行的是32位版本,后来我发现android studio是自带JDK的,所以跟之前安装的32位和64位没啥关系,我运行android studio 64位的就正常了,楼主的系统如果是64位的,尝试一下运行64位的试试,默认的JDK就选AS自带的,或者自己安装的64位JDK

    点赞 3 评论 复制链接分享
  • juexia1206 juexia1206 2017-10-30 03:08

    已经找到了解决的方法:更新软件到3.0
    下载地址:http://www.android-studio.org/
    其他都不用卸载,运行3.0后,会提示你更新,更新就可以了.

    点赞 1 评论 复制链接分享
  • rzlhqn rzlhqn 2017-12-24 08:37

    我也遇到这个问题,不过我是通过更新NDK来解决的

    点赞 1 评论 复制链接分享
  • qq_35473951 霸王横千秋 2017-08-02 06:03

    估计是jar包错了,你删了jar包,重新下一个试试

    点赞 评论 复制链接分享
  • cataclysm2012 cataclysm2012 2017-08-11 23:52

    兄弟,你解决了吗?我也遇到这个问题,重装都不好使,就是找不到。。

    点赞 评论 复制链接分享
  • qq_28150513 iwulh 2017-08-23 08:26

    遇到同样的问题 很尴尬

    点赞 评论 复制链接分享
  • weixin_40171106 weixin_40171106 2017-09-09 09:40

    有没有解决方法!!?

    点赞 评论 复制链接分享
  • qq_38714817 qq_38714817 2017-09-11 07:07

    同样遇到了这个问题!!求问是怎么解决的??

    点赞 评论 复制链接分享
  • juexia1206 juexia1206 2017-10-30 02:50

    确实有点坑人,这个谷歌,很无语.重装了还是依旧.

    点赞 评论 复制链接分享

相关推荐