「已注销」
2017-08-02 04:24
采纳率: 100%
浏览 16.7k
已采纳

Android Studio中一些jar包无法打开

如题,在启动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 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,加载成功!

    评论
    解决 无用
    打赏 举报
查看更多回答(10条)

相关推荐 更多相似问题