Linux上的Intellij:Android项目创建失败并显示错误

时间:2018-08-17 06:31:04

标签: java android intellij-idea

我在Intellij Ultimate上安装了Ubuntu 16.04JDKopenjdk 8一起安装,而android-sdk是从Android官方网站手动安装的, Intellij Ultimate在设置中使用此android-sdk,这样我就可以开始使用android应用程序了。

在列出最近项目的主菜单中,我选择创建一个新项目,该项目类型当然是android,但是在为新项目选择了所有选项之后,它将返回主菜单,并且在菜单上不执行任何操作。错误日志显示以下内容:

java.lang.NoSuchMethodError: com.google.wireless.android.sdk.stats.GradleSyncStats$Builder.setEmbeddedRepoEnabled(Z)Lcom/google/wireless/android/sdk/stats/GradleSyncStats$Builder;
    at com.android.tools.idea.gradle.project.sync.GradleSyncState.generateSyncEvent(GradleSyncState.java:483)
    at com.android.tools.idea.gradle.project.sync.GradleSyncState.syncStarted(GradleSyncState.java:212)
    at com.android.tools.idea.gradle.project.sync.GradleSyncState.syncStarted(GradleSyncState.java:181)
    at com.android.tools.idea.gradle.project.sync.GradleSyncInvoker.sync(GradleSyncInvoker.java:225)
    at com.android.tools.idea.gradle.project.sync.GradleSyncInvoker.lambda$requestProjectSync$0(GradleSyncInvoker.java:128)
    at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88)
    at com.intellij.openapi.application.TransactionGuardImpl.submitTransactionAndWait(TransactionGuardImpl.java:153)
    at com.android.tools.idea.gradle.project.sync.GradleSyncInvoker.requestProjectSync(GradleSyncInvoker.java:145)
    at com.android.tools.idea.gradle.project.importing.GradleProjectImporter.openOrImportProject(GradleProjectImporter.java:210)
    at com.android.tools.idea.gradle.project.importing.GradleProjectImporter.importProject(GradleProjectImporter.java:168)
    at com.android.tools.idea.npw.project.NewProjectModel$ProjectTemplateRenderer.performGradleImport(NewProjectModel.java:345)
    at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:315)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:447)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:431)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:415)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
    at java.awt.EventQueue.access$500(EventQueue.java:98)
    at java.awt.EventQueue$3.run(EventQueue.java:715)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:781)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:722)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:382)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

我尝试通过删除android sdk文件夹并让Intellij Ultimate自行处理安装,再次创建一个新项目,但错误发生的方式相同。.我检查了Intellij Ultimate是否创建了项目文件夹(确实如此),但是在导入并检查主布局后,它停留在Waiting for build to finish...上,并且发生另一个错误:

java.lang.NoSuchMethodError: com.android.manifmerger.ManifestMerger2$Invoker.addNavigationFiles(Ljava/lang/Iterable;)Lcom/android/manifmerger/ManifestMerger2$Invoker;
    at com.android.tools.idea.model.ManifestInfo.getMergedManifest(ManifestInfo.java:99)
    at com.android.tools.idea.model.ManifestInfo$ManifestFile.parseManifest(ManifestInfo.java:315)
    at com.android.tools.idea.model.ManifestInfo$ManifestFile.refresh(ManifestInfo.java:380)
    at com.android.tools.idea.model.MergedManifest.syncWithReadPermission(MergedManifest.java:386)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:925)
    at com.android.tools.idea.model.MergedManifest.sync(MergedManifest.java:365)
    at com.android.tools.idea.model.MergedManifest.getPackage(MergedManifest.java:152)
    at org.jetbrains.android.dom.converters.PackageClassConverter.getManifestPackage(PackageClassConverter.java:96)
    at org.jetbrains.android.dom.converters.PackageClassConverter.createReferences(PackageClassConverter.java:142)
    at com.intellij.util.xml.impl.GenericValueReferenceProvider.a(GenericValueReferenceProvider.java:124)
    at com.intellij.util.xml.impl.GenericValueReferenceProvider.a(GenericValueReferenceProvider.java:115)
    at com.intellij.util.xml.impl.GenericValueReferenceProvider.getReferencesByElement(GenericValueReferenceProvider.java:75)
    at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.getReferences(ReferenceProvidersRegistryImpl.java:135)
    at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.mapNotEmptyReferencesFromProviders(ReferenceProvidersRegistryImpl.java:123)
    at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.doGetReferencesFromProviders(ReferenceProvidersRegistryImpl.java:102)
    at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.getReferencesFromProviders(ReferenceProvidersRegistry.java:50)
    at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.getReferencesFromProviders(ReferenceProvidersRegistry.java:44)
    at com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.getReferences(XmlAttributeValueImpl.java:110)
    at com.intellij.xml.util.XmlRefCountHolder$IdGatheringRecursiveVisitor.visitXmlAttributeValue(XmlRefCountHolder.java:249)
    at com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.accept(XmlAttributeValueImpl.java:62)
    at com.intellij.psi.PsiWalkingState.visit(PsiWalkingState.java:70)
    at com.intellij.psi.PsiWalkingState.visit(PsiWalkingState.java:27)
    at com.intellij.util.WalkingState.walkChildren(WalkingState.java:65)
    at com.intellij.util.WalkingState.elementStarted(WalkingState.java:52)
    at com.intellij.psi.PsiWalkingState.elementStarted(PsiWalkingState.java:79)
    at com.intellij.psi.XmlRecursiveElementWalkingVisitor.visitElement(XmlRecursiveElementWalkingVisitor.java:38)
    at com.intellij.xml.util.XmlRefCountHolder$IdGatheringRecursiveVisitor.visitElement(XmlRefCountHolder.java:177)
    at com.intellij.psi.PsiElementVisitor.visitFile(PsiElementVisitor.java:34)
    at com.intellij.psi.XmlRecursiveElementWalkingVisitor.visitFile(XmlRecursiveElementWalkingVisitor.java:56)
    at com.intellij.psi.XmlElementVisitor.visitXmlFile(XmlElementVisitor.java:26)
    at com.intellij.psi.impl.source.xml.XmlFileImpl.accept(XmlFileImpl.java:71)
    at com.intellij.xml.util.XmlRefCountHolder$1.lambda$compute$0(XmlRefCountHolder.java:61)
    at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:49)
    at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:222)
    at com.intellij.psi.impl.PsiCachedValue.getValueWithLock(PsiCachedValue.java:60)
    at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:38)
    at com.intellij.xml.util.XmlRefCountHolder.getRefCountHolder(XmlRefCountHolder.java:79)
    at com.intellij.xml.util.XmlDuplicatedIdInspection$1.visitXmlAttributeValue(XmlDuplicatedIdInspection.java:53)
    at com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.accept(XmlAttributeValueImpl.java:62)
    at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:75)
    at com.intellij.codeInspection.InspectionEngine.createVisitorAndAcceptElements(InspectionEngine.java:63)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.runToolOnElements(LocalInspectionsPass.java:276)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitPriorityElementsAndInit$3(LocalInspectionsPass.java:244)
    at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:133)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1156)
    at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:105)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:580)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:525)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:85)
    at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:116)
    at com.intellij.concurrency.ApplierCompleter.lambda$compute$0(ApplierCompleter.java:96)
    at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:147)
    at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:222)
    at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:96)
    at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
    at java.util.concurrent.ForkJoinPool$WorkQueue.pollAndExecCC(ForkJoinPool.java:1190)
    at java.util.concurrent.ForkJoinPool.helpComplete(ForkJoinPool.java:1879)
    at java.util.concurrent.ForkJoinPool.awaitJoin(ForkJoinPool.java:2045)
    at java.util.concurrent.ForkJoinTask.doJoin(ForkJoinTask.java:390)
    at java.util.concurrent.ForkJoinTask.join(ForkJoinTask.java:719)
    at java.util.concurrent.ForkJoinPool.invoke(ForkJoinPool.java:2616)
    at com.intellij.concurrency.JobLauncherImpl.invokeConcurrentlyUnderProgress(JobLauncherImpl.java:65)
    at com.intellij.concurrency.JobLauncher.invokeConcurrentlyUnderProgress(JobLauncher.java:56)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.visitPriorityElementsAndInit(LocalInspectionsPass.java:247)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.inspect(LocalInspectionsPass.java:218)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.collectInformationWithProgress(LocalInspectionsPass.java:121)
    at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:83)
    at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:69)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$null$1(PassExecutorService.java:423)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1161)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:416)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:580)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:525)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:85)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:415)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:391)
    at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:147)
    at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:222)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:389)
    at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:161)
    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)

我不知道如何解决此问题。.我已经在互联网上进行了研究,但没有找到答案,我想看看是否可以解决这个问题,然后再下载Android Studio,我认为这会更好因为Intellij Ultimate实际上是Android Studio

来使Intellij起作用

0 个答案:

没有答案