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

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条回答 默认 最新

相关推荐 更多相似问题