I'm using Android Studio 0.2.6 in Mac Mountain Lion. When I run the project first time, it runs fine.
But next time onwards, I have the following error:
Internal error: (org.jdom.input.JDOMParseException) Error on line 1: Premature end of file.
org.jdom.input.JDOMParseException: Error on line 1: Premature end of file.
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:533)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:946)
at com.intellij.openapi.util.JDOMUtil.loadDocument(JDOMUtil.java:377)
at com.intellij.openapi.util.JDOMUtil.loadDocument(JDOMUtil.java:355)
at org.jetbrains.jps.model.serialization.JpsLoaderBase.loadRootElement(JpsLoaderBase.java:69)
at org.jetbrains.jps.model.serialization.JpsLoaderBase.loadRootElement(JpsLoaderBase.java:40)
at org.jetbrains.jps.model.serialization.JpsProjectLoader.loadFromDirectory(JpsProjectLoader.java:127)
at org.jetbrains.jps.model.serialization.JpsProjectLoader.loadProject(JpsProjectLoader.java:99)
at org.jetbrains.jps.model.serialization.impl.JpsSerializationManagerImpl.loadModel(JpsSerializationManagerImpl.java:41)
at org.jetbrains.jps.cmdline.JpsModelLoaderImpl.loadModel(JpsModelLoaderImpl.java:45)
at org.jetbrains.jps.cmdline.BuildRunner.load(BuildRunner.java:71)
at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:198)
at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:113)
at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler$1.run(BuildMain.java:128)
at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:41)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:680)
Caused by: org.xml.sax.SAXParseException: Premature end of file.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1427)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1056)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:518)
... 20 more
Caused by: org.xml.sax.SAXParseException: Premature end of file.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1427)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1056)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:518)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:946)
at com.intellij.openapi.util.JDOMUtil.loadDocument(JDOMUtil.java:377)
at com.intellij.openapi.util.JDOMUtil.loadDocument(JDOMUtil.java:355)
at org.jetbrains.jps.model.serialization.JpsLoaderBase.loadRootElement(JpsLoaderBase.java:69)
at org.jetbrains.jps.model.serialization.JpsLoaderBase.loadRootElement(JpsLoaderBase.java:40)
at org.jetbrains.jps.model.serialization.JpsProjectLoader.loadFromDirectory(JpsProjectLoader.java:127)
at org.jetbrains.jps.model.serialization.JpsProjectLoader.loadProject(JpsProjectLoader.java:99)
at org.jetbrains.jps.model.serialization.impl.JpsSerializationManagerImpl.loadModel(JpsSerializationManagerImpl.java:41)
at org.jetbrains.jps.cmdline.JpsModelLoaderImpl.loadModel(JpsModelLoaderImpl.java:45)
at org.jetbrains.jps.cmdline.BuildRunner.load(BuildRunner.java:71)
at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:198)
at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:113)
at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler$1.run(BuildMain.java:128)
at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:41)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:680)
I've tried restarting, reverting files from SVN, deleting out and gen folders and rebuiding. But still not working. It drives me crazy. Thanks for your help.
None of the above worked for me. Thinking it may involve the beta 5.1 version of AndroidStudio I even reverted to a previous stable version but no luck.
The solution for me was to do a file search for all XML files in the project, sort them by size, and find the two empty XML files that should have been deleted but were only truncated to zero size. It was then a simple matter of deleting them. After that everything went well.
I hope that saves some folks the 2 hours or so of hair pulling I went through. I sure wish the stack trace printing also included the names of the problematic files. That would have saved a lot of aggravation.
just Delete .idea directory and app.iml file and then import project again and it will generate new Gradle file and your problem resolve....
This happened when I checked out the project in another computer and then back to the first one.
I fixed the problem by closing the project and then File > Import Project... from the exect same sources.
Android Studio fixed the project while keeping all previous gradle configurations.
It drove me crazy too :)
For me a simple Build -> Clean Project and then rebuilding did the trick.
This issue seems fixed when creating new projects in 0.8.1. Unfortunately, if you created the project on a version less than 0.8.1, and then try to open with the new version, you still get the same error. I had to create a whole new project from scratch with 0.8.1 to no longer get the error.
I deleted all folder from this folder directory link :C:\Users\BeingXpert.gradle\caches\transforms-1\files-1.1\appcompat-v7-26.1.0.aar
Its solve my problem which is same!
I just did
File->Invalidate Caches and Restart
It solved the error
It's probably not a problem with the project. As I was also getting the same issue on opening a project and after applying almost all of the solution above I concluded that none of them worked for me. So I decided to create a new project and I got the same problem in the freshly created project too. Then I came to know that this issue wasn't with my project it was an issue something in Android Studio. So, What steps I took to solve the issue were:
Go to User Directory i.e C:\users\%your user name%\
Delete .idea and .Android directory
Open Android Studio and when it asks for import settings, select "Do not import settings" option.
Tested on Android Studio 3.6.2.
Related
I have Android studio dolphin version.
While I try to open Android studio, an error dialog box appears and it shows like
IDE error occured
See details and submit report
And the report shows an error as below
com.intellij.serviceContainer.AlreadyDisposedException: Already disposed: Module: 'AppName.app' (disposed)
at com.intellij.serviceContainer.ComponentManagerImpl.checkState(ComponentManagerImpl.kt:184)
at com.intellij.serviceContainer.ComponentManagerImpl.getComponent(ComponentManagerImpl.kt:533)
at com.intellij.facet.FacetManager.getInstance(FacetManager.java:15)
at com.intellij.facet.impl.ProjectFacetManagerImpl.getIndex(ProjectFacetManagerImpl.java:76)
at com.intellij.facet.impl.ProjectFacetManagerImpl.hasFacets(ProjectFacetManagerImpl.java:100)
at com.intellij.facet.impl.ui.FacetDependentToolWindowManager$1.facetRemoved(FacetDependentToolWindowManager.java:58)
at com.intellij.facet.impl.ProjectWideFacetListenersRegistryImpl$ProjectWideFacetListenerWrapper.facetRemoved(ProjectWideFacetListenersRegistryImpl.java:86)
at com.intellij.facet.impl.FacetEventsPublisher.onFacetRemoved(FacetEventsPublisher.kt:129)
at com.intellij.facet.impl.FacetEventsPublisher.onModuleRemoved(FacetEventsPublisher.kt:89)
at com.intellij.facet.impl.FacetEventsPublisher.access$onModuleRemoved(FacetEventsPublisher.kt:17)
at com.intellij.facet.impl.FacetEventsPublisher$1.moduleRemoved(FacetEventsPublisher.kt:29)
at com.intellij.util.messages.impl.MessageBusImpl.invokeMethod(MessageBusImpl.java:645)
at com.intellij.util.messages.impl.MessageBusImpl.invokeListener(MessageBusImpl.java:624)
at com.intellij.util.messages.impl.MessageBusImpl.deliverMessage(MessageBusImpl.java:417)
at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:390)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:372)
at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:33)
at com.intellij.util.messages.impl.MessageBusImpl$MessagePublisher.invoke(MessageBusImpl.java:179)
at com.sun.proxy.$Proxy87.moduleRemoved(Unknown Source)
at com.intellij.workspaceModel.ide.impl.legacyBridge.module.ModuleManagerBridgeImpl.fireEventAndDisposeModule(ModuleManagerBridgeImpl.kt:63)
at com.intellij.workspaceModel.ide.impl.legacyBridge.module.ModuleManagerComponentBridge.processModuleChange(ModuleManagerComponentBridge.kt:181)
at com.intellij.workspaceModel.ide.impl.legacyBridge.module.ModuleManagerComponentBridge.access$processModuleChange(ModuleManagerComponentBridge.kt:45)
at com.intellij.workspaceModel.ide.impl.legacyBridge.module.ModuleManagerComponentBridge$2$changed$1.invoke(ModuleManagerComponentBridge.kt:126)
at com.intellij.workspaceModel.ide.impl.legacyBridge.module.ModuleManagerComponentBridge$2$changed$1.invoke(ModuleManagerComponentBridge.kt:74)
at com.intellij.workspaceModel.ide.impl.UtilsKt.executeOrQueueOnDispatchThread(utils.kt:13)
at com.intellij.workspaceModel.ide.impl.legacyBridge.module.ModuleManagerComponentBridge$2.changed(ModuleManagerComponentBridge.kt:102)
at com.intellij.workspaceModel.ide.WorkspaceModelTopics$EventsDispatcher.changed(WorkspaceModelTopics.kt:118)
at com.intellij.util.messages.impl.MessageBusImpl.invokeMethod(MessageBusImpl.java:645)
at com.intellij.util.messages.impl.MessageBusImpl.invokeListener(MessageBusImpl.java:624)
at com.intellij.util.messages.impl.MessageBusImpl.deliverMessage(MessageBusImpl.java:417)
at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:390)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:372)
at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:33)
at com.intellij.util.messages.impl.MessageBusImpl$MessagePublisher.invoke(MessageBusImpl.java:179)
at com.sun.proxy.$Proxy96.changed(Unknown Source)
at com.intellij.workspaceModel.ide.impl.WorkspaceModelImpl.onChanged(WorkspaceModelImpl.kt:112)
at com.intellij.workspaceModel.ide.impl.WorkspaceModelImpl.access$onChanged(WorkspaceModelImpl.kt:19)
at com.intellij.workspaceModel.ide.impl.WorkspaceModelImpl$updateProjectModel$2.invoke(WorkspaceModelImpl.kt:75)
at com.intellij.workspaceModel.ide.impl.WorkspaceModelImpl$updateProjectModel$2.invoke(WorkspaceModelImpl.kt:19)
at com.intellij.workspaceModel.storage.impl.VersionedEntityStorageImpl.replace(VersionedEntityStorageImpl.kt:183)
at com.intellij.workspaceModel.ide.impl.WorkspaceModelImpl.updateProjectModel(WorkspaceModelImpl.kt:75)
at com.intellij.workspaceModel.ide.impl.jps.serialization.JpsProjectModelSynchronizer$applyLoadedStorage$1.run(JpsProjectModelSynchronizer.kt:212)
at com.intellij.openapi.application.WriteAction.lambda$runAndWait$2(WriteAction.java:115)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithClass(ApplicationImpl.java:935)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:961)
at com.intellij.openapi.application.WriteAction.compute(WriteAction.java:96)
at com.intellij.openapi.application.WriteAction.lambda$computeAndWait$3(WriteAction.java:149)
at com.intellij.openapi.application.WriteThread.lambda$submit$0(WriteThread.java:27)
at com.intellij.openapi.application.WriteThread.lambda$submit$1(WriteThread.java:43)
at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:214)
at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:21)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:196)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLaterOnWriteThread$10(ApplicationImpl.java:794)
at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:82)
at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:131)
at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:47)
at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:187)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:891)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:760)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:447)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:818)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:446)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:492)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Suppressed: java.lang.RuntimeException
at com.intellij.openapi.application.WriteAction.computeAndWait(WriteAction.java:158)
at com.intellij.openapi.application.WriteAction.computeAndWait(WriteAction.java:128)
at com.intellij.openapi.application.WriteAction.runAndWait(WriteAction.java:114)
at com.intellij.workspaceModel.ide.impl.jps.serialization.JpsProjectModelSynchronizer.applyLoadedStorage(JpsProjectModelSynchronizer.kt:209)
at com.intellij.workspaceModel.ide.impl.jps.serialization.JpsProjectModelSynchronizer.loadProject(JpsProjectModelSynchronizer.kt:229)
at com.intellij.workspaceModel.ide.impl.jps.serialization.DelayedProjectSynchronizer.runActivity(DelayedProjectSynchronizer.kt:23)
at com.intellij.ide.startup.impl.StartupManagerImpl.runStartupActivity(StartupManagerImpl.kt:312)
at com.intellij.ide.startup.impl.StartupManagerImpl.runActivityAndMeasureDuration(StartupManagerImpl.kt:293)
at com.intellij.ide.startup.impl.StartupManagerImpl.runActivityAndMeasureDuration$default(StartupManagerImpl.kt:288)
at com.intellij.ide.startup.impl.StartupManagerImpl$runPostStartupActivities$1$1.run(StartupManagerImpl.kt:245)
at com.intellij.openapi.project.DumbServiceImpl.runWithWaitForSmartModeDisabled(DumbServiceImpl.java:645)
at com.intellij.ide.startup.impl.StartupManagerImpl$runPostStartupActivities$1.accept(StartupManagerImpl.kt:244)
at com.intellij.ide.startup.impl.StartupManagerImpl$runPostStartupActivities$1.accept(StartupManagerImpl.kt:62)
at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processWithPluginDescriptor(ExtensionPointImpl.java:299)
at com.intellij.openapi.extensions.ExtensionPointName.processWithPluginDescriptor(ExtensionPointName.java:144)
at com.intellij.ide.startup.impl.StartupManagerImpl.runPostStartupActivities(StartupManagerImpl.kt:239)
at com.intellij.ide.startup.impl.StartupManagerImpl.access$runPostStartupActivities(StartupManagerImpl.kt:62)
at com.intellij.ide.startup.impl.StartupManagerImpl$projectOpened$3$1.run(StartupManagerImpl.kt:189)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:188)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:624)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:698)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:646)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:623)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:175)
at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:277)
at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:255)
at com.intellij.ide.startup.impl.StartupManagerImpl$projectOpened$3.run(StartupManagerImpl.kt:189)
at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
And also another dialog box appears as
Unable to save settings
Failed to save settings. Please restart Android Studio
On the top, in the configuration tab, it now shows Add Configuration where it showed app with an android icon previously.
The project explorer keeps on loading forever. The same problem occurs whenever I try to create a new project as well.
There is no modules.xml file and some folders in the .idea folder are missing which the previous projects have.
What I have tried so far
Invalidated caches and Restarted
Deleted .idea and .app folder and restarted
Created a new project to check if the same error occurs
Uninstalled and reinstalled Android studio
Clicked on Repair IDE and followed the steps
Installed previous android studio versions and checked
But none the above steps seem to help resolve the issue.
I know it's an old post, but it's relating to a similar issue and might still be of use:
Android Studio - Gradle sync failed: Already disposed
As stated,
As it turned out, the problem was that I was trying to open a project directory that was a symlink to the actual location (on the same partition). Gradle (on command line) had no issues building the project from the symlinked location, however, opening it in Android Studio resulted in the obscure and non helpful error described above.
Also, some have reported this worked for them:
Delete module folder and modules.xml file under .idea folder.
Close Android Studio
Reopen and sync
So it might effectively be because your module.xml file is missing
For me what helped was (ignoring the root cause of this issue)
removing the project from my local machine
and cloning it again. Then reopening it in AS.
I am on Mac btw.
(Try to restart AS (or Intelli) and clear cache first, before doing this.)
Basically:
Close Android Studio
rm -rf Project-Directory
git clone via commandline (or AS, both works)
reopen AS and import project
Since I don't have time to fiddle around with all the possible options
that you find on the net, to fix this issue, this was the fasted approach.
I have a gradle sync fail for my little project that seems to be quite rare as google did not find anything about it. I get the error:
Gradle sync failed: removeContentEntry: removed content entry url 'file://C:/Users/BenutzerA/IdeaProjects/EtikettenScanner1/app' still exists after removing (2 s 337 ms)
A clean build did not help. "Invalidate caches /Restart" did not help.
So far this seems the only project that suffers from this problem. I switched to 3 other projects and they all build without problems.
Project uses Kotlin, Android, Google-Services
Anyone has a hint for me?
Part of idea.log:
021-02-15 20:39:10,076 [4053612] WARN - e.project.sync.GradleSyncState - removeContentEntry: removed content entry url 'file://C:/Users/BenutzerA/IdeaProjects/EtikettenScanner1/app' still exists after removing
java.lang.IllegalStateException: removeContentEntry: removed content entry url 'file://C:/Users/BenutzerA/IdeaProjects/EtikettenScanner1/app' still exists after removing
at com.intellij.workspaceModel.ide.impl.legacyBridge.module.roots.ModifiableRootModelBridgeImpl.removeContentEntry(ModifiableRootModelBridgeImpl.kt:209)
at com.android.tools.idea.gradle.project.sync.setup.module.common.ContentEntriesSetup.removeExistingContentEntries(ContentEntriesSetup.java:47)
at com.android.tools.idea.gradle.project.sync.setup.module.ndk.NdkModuleCleanupStep.cleanUpModule(NdkModuleCleanupStep.java:42)
at com.android.tools.idea.gradle.project.sync.idea.data.service.NdkModuleModelDataService.onModelNotFound(NdkModuleModelDataService.java:78)
at com.android.tools.idea.gradle.project.sync.idea.data.service.ModuleModelDataService.onModelsNotFound(ModuleModelDataService.java:64)
at com.android.tools.idea.gradle.project.sync.idea.data.service.ModuleModelDataService.importData(ModuleModelDataService.java:49)
at com.intellij.openapi.externalSystem.service.project.manage.ProjectDataManagerImpl.doImportData(ProjectDataManagerImpl.java:252)
at com.intellij.openapi.externalSystem.service.project.manage.ProjectDataManagerImpl.importData(ProjectDataManagerImpl.java:120)
at com.intellij.openapi.externalSystem.service.project.manage.ProjectDataManagerImpl.importData(ProjectDataManagerImpl.java:206)
at com.intellij.openapi.externalSystem.service.project.manage.ProjectDataManagerImpl.importData(ProjectDataManagerImpl.java:213)
at com.android.tools.idea.gradle.project.sync.idea.IdeaSyncPopulateProjectTask.populateProject(IdeaSyncPopulateProjectTask.java:66)
at com.android.tools.idea.gradle.project.sync.idea.ProjectSetUpTask.doPopulateProject(ProjectSetUpTask.java:95)
at com.android.tools.idea.gradle.project.sync.idea.ProjectSetUpTask.onSuccess(ProjectSetUpTask.java:65)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.handExecutionResult(ExternalSystemUtil.java:559)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.executeImpl(ExternalSystemUtil.java:539)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.lambda$execute$1(ExternalSystemUtil.java:373)
at com.intellij.openapi.project.DumbServiceHeavyActivities.suspendIndexingAndRun(DumbServiceHeavyActivities.java:21)
at com.intellij.openapi.project.DumbServiceImpl.suspendIndexingAndRun(DumbServiceImpl.java:185)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.execute(ExternalSystemUtil.java:373)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4.run(ExternalSystemUtil.java:644)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:962)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync$5(CoreProgressManager.java:472)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:235)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:178)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:658)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:610)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:65)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:165)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:235)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:834)```
Intellij Idea 2022.1.4 (Ultimate edition)
My solution is to delete files:
project-dir/.idea/compiler.xml
project-dir/.idea/modules.xml
restart/reload the Gradle project
Just in case you miss it in the initial comments, when I had this problem (in another project using IntelliJ IDEA directly) removing the .iml file and the .idea directory and re importing the project worked like a treat for me.
There is solution helped me:
Build needle build variant via terminal (./gradlew assembleRelease for example)
After change build variant to needle via android studio (to Release in this example)
May be it helps other people
I solved this problem like this:
Export project to a zip file
Delete old folder (make a backup)
Unzip the exported project
Run Android Studio again from that folder
What worked for me was to remove a duplicate entry in .idea/modules/myproject.test.iml
this entry was duplicated :
<content url="file://$MODULE_DIR$/../../build/generated/sources/annotationProcessor/java/test">
<sourceFolder url="file://$MODULE_DIR$/../../build/generated/sources/annotationProcessor/java/test" isTestSource="true" generated="true" />
</content>
Delete ".idea" folder. Helps already twice for me, IDEA 2022.1.4 Ultimate
Remove ".idea" folder.
Reopen the project. The problem should be gone.
Restore the previously deleted ".idea" folder.
I am attempting to reopen an older Android Studio project in version 3.0.
It compiles and launches just fine, but if I try to edit a layout in the layout designer, it won't load and simply keeps saying that it is waiting for the build to finish (which it has).
When I look in the IDE errors, I see this error:
provider: org.jetbrains.android.augment.AndroidPsiAugmentProvider#2180343: Resource name cannot be empty.
As I look though the trace info, I see nothing that points back at my project.
Any suggestions?
Here is the full trace output:
provider: org.jetbrains.android.augment.AndroidPsiAugmentProvider#2180343: Resource name cannot be empty.
java.lang.IllegalArgumentException: Resource name cannot be empty.
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122)
at com.android.ide.common.res2.ResourceItem.<init>(ResourceItem.java:115)
at com.android.ide.common.res2.IdGeneratingResourceParser$IdResourceItem.<init>(IdGeneratingResourceParser.java:202)
at com.android.ide.common.res2.IdGeneratingResourceParser.<init>(IdGeneratingResourceParser.java:81)
at com.android.ide.common.res2.ResourceSet.createResourceFile(ResourceSet.java:456)
at com.android.ide.common.res2.ResourceSet.createFileAndItems(ResourceSet.java:111)
at com.android.ide.common.res2.ResourceSet.handleNewFile(ResourceSet.java:257)
at com.android.ide.common.res2.ResourceSet.handleNewFile(ResourceSet.java:52)
at com.android.ide.common.res2.DataSet.loadFile(DataSet.java:275)
at com.android.tools.idea.res.ResourceFolderRepository$InitialScanState.loadFile(ResourceFolderRepository.java:325)
at com.android.tools.idea.res.ResourceFolderRepository.scanFileResourceFile(ResourceFolderRepository.java:524)
at com.android.tools.idea.res.ResourceFolderRepository.scanFileResourceFolder(ResourceFolderRepository.java:477)
at com.android.tools.idea.res.ResourceFolderRepository.scanResFolder(ResourceFolderRepository.java:449)
at com.android.tools.idea.res.ResourceFolderRepository.scanRemainingFiles(ResourceFolderRepository.java:375)
at com.android.tools.idea.res.ResourceFolderRepository.<init>(ResourceFolderRepository.java:119)
at com.android.tools.idea.res.ResourceFolderRepository.create(ResourceFolderRepository.java:152)
at com.android.tools.idea.res.ResourceFolderRegistry.get(ResourceFolderRegistry.java:76)
at com.android.tools.idea.res.ResourceFolderRegistry.get(ResourceFolderRegistry.java:64)
at com.android.tools.idea.res.ModuleResourceRepository.create(ModuleResourceRepository.java:95)
at com.android.tools.idea.res.ResourceRepositories.lambda$getModuleResources$2(ResourceRepositories.java:98)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:942)
at com.android.tools.idea.res.ResourceRepositories.getModuleResources(ResourceRepositories.java:95)
at com.android.tools.idea.res.ModuleResourceRepository.findModuleResources(ModuleResourceRepository.java:71)
at com.android.tools.idea.res.ModuleResourceRepository.getOrCreateInstance(ModuleResourceRepository.java:59)
at com.android.tools.idea.res.ProjectResourceRepository.computeRepositories(ProjectResourceRepository.java:81)
at com.android.tools.idea.res.ProjectResourceRepository.create(ProjectResourceRepository.java:73)
at com.android.tools.idea.res.ResourceRepositories.lambda$getProjectResources$1(ResourceRepositories.java:83)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:942)
at com.android.tools.idea.res.ResourceRepositories.getProjectResources(ResourceRepositories.java:80)
at com.android.tools.idea.res.ProjectResourceRepository.findProjectResources(ProjectResourceRepository.java:63)
at com.android.tools.idea.res.ProjectResourceRepository.getOrCreateInstance(ProjectResourceRepository.java:51)
at com.android.tools.idea.res.AppResourceRepository.computeRepositories(AppResourceRepository.java:156)
at com.android.tools.idea.res.AppResourceRepository.create(AppResourceRepository.java:123)
at com.android.tools.idea.res.ResourceRepositories.lambda$getAppResources$0(ResourceRepositories.java:68)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:942)
at com.android.tools.idea.res.ResourceRepositories.getAppResources(ResourceRepositories.java:65)
at com.android.tools.idea.res.AppResourceRepository.findAppResources(AppResourceRepository.java:117)
at com.android.tools.idea.res.AppResourceRepository.getOrCreateInstance(AppResourceRepository.java:99)
at org.jetbrains.android.dom.converters.ResourceReferenceConverter.getResourceTypesInCurrentModule(ResourceReferenceConverter.java:262)
at org.jetbrains.android.augment.AndroidPsiAugmentProvider.getAugments(AndroidPsiAugmentProvider.java:67)
at com.intellij.psi.augment.PsiAugmentProvider.lambda$collectAugments$0(PsiAugmentProvider.java:93)
at com.intellij.psi.augment.PsiAugmentProvider.forEach(PsiAugmentProvider.java:137)
at com.intellij.psi.augment.PsiAugmentProvider.collectAugments(PsiAugmentProvider.java:92)
at com.intellij.psi.impl.source.ClassInnerStuffCache.getAllInnerClasses(ClassInnerStuffCache.java:139)
at com.intellij.psi.impl.source.ClassInnerStuffCache.lambda$getInnerClasses$3(ClassInnerStuffCache.java:72)
at com.intellij.psi.util.CachedValuesManager.lambda$getCachedValue$0(CachedValuesManager.java:141)
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.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:137)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:127)
at com.intellij.psi.impl.source.ClassInnerStuffCache.getInnerClasses(ClassInnerStuffCache.java:71)
at com.intellij.psi.impl.source.ClassInnerStuffCache.getInnerClassesMap(ClassInnerStuffCache.java:182)
at com.intellij.psi.impl.source.ClassInnerStuffCache.lambda$findInnerClassByName$6(ClassInnerStuffCache.java:102)
at com.intellij.psi.util.CachedValuesManager.lambda$getCachedValue$0(CachedValuesManager.java:141)
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.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:137)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:127)
at com.intellij.psi.impl.source.ClassInnerStuffCache.findInnerClassByName(ClassInnerStuffCache.java:101)
at com.intellij.psi.impl.source.PsiClassImpl.findInnerClassByName(PsiClassImpl.java:396)
at org.jetbrains.android.util.AndroidResourceUtil.findResourceFieldsFromClass(AndroidResourceUtil.java:190)
at org.jetbrains.android.util.AndroidResourceUtil.findResourceFields(AndroidResourceUtil.java:182)
at org.jetbrains.android.util.AndroidResourceUtil.findResourceFields(AndroidResourceUtil.java:168)
at org.jetbrains.android.AndroidGotoRelatedProvider.collectRelatedJavaFiles(AndroidGotoRelatedProvider.java:182)
at org.jetbrains.android.AndroidGotoRelatedProvider.getLazyItemsForXmlFile(AndroidGotoRelatedProvider.java:112)
at org.jetbrains.android.AndroidLineMarkerProvider.getMarkerInfo(AndroidLineMarkerProvider.java:91)
at org.jetbrains.android.AndroidLineMarkerProvider.doGetLineMarkerInfo(AndroidLineMarkerProvider.java:52)
at org.jetbrains.android.AndroidLineMarkerProvider.collectSlowLineMarkers(AndroidLineMarkerProvider.java:37)
at com.intellij.codeInsight.daemon.impl.LineMarkersPass.queryProviders(LineMarkersPass.java:209)
at com.intellij.codeInsight.daemon.impl.LineMarkersPass.lambda$doCollectInformation$3(LineMarkersPass.java:111)
at com.intellij.codeInsight.daemon.impl.Divider.divideInsideAndOutsideInOneRoot(Divider.java:96)
at com.intellij.codeInsight.daemon.impl.LineMarkersPass.doCollectInformation(LineMarkersPass.java:106)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$null$1(PassExecutorService.java:438)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1156)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:431)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:556)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:430)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:406)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:142)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:242)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:404)
at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:165)
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)
java.lang.IllegalArgumentException: Resource name cannot be empty.
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122)
at com.android.ide.common.res2.ResourceItem.<init>(ResourceItem.java:115)
at com.android.ide.common.res2.IdGeneratingResourceParser$IdResourceItem.<init>(IdGeneratingResourceParser.java:202)
at com.android.ide.common.res2.IdGeneratingResourceParser.<init>(IdGeneratingResourceParser.java:81)
at com.android.ide.common.res2.ResourceSet.createResourceFile(ResourceSet.java:456)
at com.android.ide.common.res2.ResourceSet.createFileAndItems(ResourceSet.java:111)
at com.android.ide.common.res2.ResourceSet.handleNewFile(ResourceSet.java:257)
at com.android.ide.common.res2.ResourceSet.handleNewFile(ResourceSet.java:52)
at com.android.ide.common.res2.DataSet.loadFile(DataSet.java:275)
at com.android.tools.idea.res.ResourceFolderRepository$InitialScanState.loadFile(ResourceFolderRepository.java:325)
at com.android.tools.idea.res.ResourceFolderRepository.scanFileResourceFile(ResourceFolderRepository.java:524)
at com.android.tools.idea.res.ResourceFolderRepository.scanFileResourceFolder(ResourceFolderRepository.java:477)
at com.android.tools.idea.res.ResourceFolderRepository.scanResFolder(ResourceFolderRepository.java:449)
at com.android.tools.idea.res.ResourceFolderRepository.scanRemainingFiles(ResourceFolderRepository.java:375)
at com.android.tools.idea.res.ResourceFolderRepository.<init>(ResourceFolderRepository.java:119)
at com.android.tools.idea.res.ResourceFolderRepository.create(ResourceFolderRepository.java:152)
at com.android.tools.idea.res.ResourceFolderRegistry.get(ResourceFolderRegistry.java:76)
at com.android.tools.idea.res.ResourceFolderRegistry.get(ResourceFolderRegistry.java:64)
at com.android.tools.idea.res.ModuleResourceRepository.create(ModuleResourceRepository.java:95)
at com.android.tools.idea.res.ResourceRepositories.lambda$getModuleResources$2(ResourceRepositories.java:98)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:942)
at com.android.tools.idea.res.ResourceRepositories.getModuleResources(ResourceRepositories.java:95)
at com.android.tools.idea.res.ModuleResourceRepository.findModuleResources(ModuleResourceRepository.java:71)
at com.android.tools.idea.res.ModuleResourceRepository.getOrCreateInstance(ModuleResourceRepository.java:59)
at com.android.tools.idea.res.ProjectResourceRepository.computeRepositories(ProjectResourceRepository.java:81)
at com.android.tools.idea.res.ProjectResourceRepository.create(ProjectResourceRepository.java:73)
at com.android.tools.idea.res.ResourceRepositories.lambda$getProjectResources$1(ResourceRepositories.java:83)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:942)
at com.android.tools.idea.res.ResourceRepositories.getProjectResources(ResourceRepositories.java:80)
at com.android.tools.idea.res.ProjectResourceRepository.findProjectResources(ProjectResourceRepository.java:63)
at com.android.tools.idea.res.ProjectResourceRepository.getOrCreateInstance(ProjectResourceRepository.java:51)
at com.android.tools.idea.res.AppResourceRepository.computeRepositories(AppResourceRepository.java:156)
at com.android.tools.idea.res.AppResourceRepository.create(AppResourceRepository.java:123)
at com.android.tools.idea.res.ResourceRepositories.lambda$getAppResources$0(ResourceRepositories.java:68)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:942)
at com.android.tools.idea.res.ResourceRepositories.getAppResources(ResourceRepositories.java:65)
at com.android.tools.idea.res.AppResourceRepository.findAppResources(AppResourceRepository.java:117)
at com.android.tools.idea.res.AppResourceRepository.getOrCreateInstance(AppResourceRepository.java:99)
at org.jetbrains.android.resourceManagers.LocalResourceManager.getResourceNames(LocalResourceManager.java:261)
at org.jetbrains.android.resourceManagers.ResourceManager.getResourceNames(ResourceManager.java:349)
at org.jetbrains.android.augment.ResourceTypeClassBase.buildResourceFields(ResourceTypeClassBase.java:40)
at org.jetbrains.android.augment.ResourceTypeClass.buildLocalResourceFields(ResourceTypeClass.java:30)
at org.jetbrains.android.augment.AndroidPsiAugmentProvider.getAugments(AndroidPsiAugmentProvider.java:107)
at com.intellij.psi.augment.PsiAugmentProvider.lambda$collectAugments$0(PsiAugmentProvider.java:93)
at com.intellij.psi.augment.PsiAugmentProvider.forEach(PsiAugmentProvider.java:137)
at com.intellij.psi.augment.PsiAugmentProvider.collectAugments(PsiAugmentProvider.java:92)
at com.intellij.psi.impl.source.ClassInnerStuffCache.getAllFields(ClassInnerStuffCache.java:125)
at com.intellij.psi.impl.source.ClassInnerStuffCache.lambda$getFields$1(ClassInnerStuffCache.java:60)
at com.intellij.psi.util.CachedValuesManager.lambda$getCachedValue$0(CachedValuesManager.java:141)
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.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:137)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:127)
at com.intellij.psi.impl.source.ClassInnerStuffCache.getFields(ClassInnerStuffCache.java:59)
at com.intellij.psi.impl.source.ClassInnerStuffCache.getFieldsMap(ClassInnerStuffCache.java:145)
at com.intellij.psi.impl.source.ClassInnerStuffCache.lambda$findFieldByName$4(ClassInnerStuffCache.java:82)
at com.intellij.psi.util.CachedValuesManager.lambda$getCachedValue$0(CachedValuesManager.java:141)
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.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:137)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:127)
at com.intellij.psi.impl.source.ClassInnerStuffCache.findFieldByName(ClassInnerStuffCache.java:80)
at com.intellij.psi.impl.source.PsiClassImpl.findFieldByName(PsiClassImpl.java:362)
at org.jetbrains.android.util.AndroidResourceUtil.findResourceFieldsFromClass(AndroidResourceUtil.java:195)
at org.jetbrains.android.util.AndroidResourceUtil.findResourceFields(AndroidResourceUtil.java:182)
at org.jetbrains.android.util.AndroidResourceUtil.findResourceFields(AndroidResourceUtil.java:168)
at org.jetbrains.android.AndroidGotoRelatedProvider.collectRelatedJavaFiles(AndroidGotoRelatedProvider.java:182)
at org.jetbrains.android.AndroidGotoRelatedProvider.getLazyItemsForXmlFile(AndroidGotoRelatedProvider.java:112)
at org.jetbrains.android.AndroidLineMarkerProvider.getMarkerInfo(AndroidLineMarkerProvider.java:91)
at org.jetbrains.android.AndroidLineMarkerProvider.doGetLineMarkerInfo(AndroidLineMarkerProvider.java:52)
at org.jetbrains.android.AndroidLineMarkerProvider.collectSlowLineMarkers(AndroidLineMarkerProvider.java:37)
at com.intellij.codeInsight.daemon.impl.LineMarkersPass.queryProviders(LineMarkersPass.java:209)
at com.intellij.codeInsight.daemon.impl.LineMarkersPass.lambda$doCollectInformation$3(LineMarkersPass.java:111)
at com.intellij.codeInsight.daemon.impl.Divider.divideInsideAndOutsideInOneRoot(Divider.java:96)
at com.intellij.codeInsight.daemon.impl.LineMarkersPass.doCollectInformation(LineMarkersPass.java:106)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$null$1(PassExecutorService.java:438)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1156)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:431)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:556)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:430)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:406)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:142)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:242)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:404)
at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:165)
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)
Update:
I have not found a solution yet, but a coworker working on another project (from which I forked my project) has just had the same thing happen to him. This leads me to think this may be project specific. However, none of the error trace shows anything in our project. This obviously makes it hard to diagnose.
This error can occur when you update to Android Studio 3.0. It doesn't affect your ability to build a project, but the error does not allow you to visually see your xml layout files. You will also get the error when committing files to GIT, but you can still commit and push.
What I found in one of my projects is that a file was added to the "menu" folder automatically upon Android Studio upgrade, and the file had no name. It was named simply ".xml". All you need to do is delete the file and clean your project, allowing a new build of the project. That should take care of the issue.
Go to File>Invalidate Caches / Restart.
It might help!
Thank you!
I am able to fix it by Uninstall Android Studio 3.0 and installed Android Studio 3.1. Its working fine.
Maybe you can try it like this:
go to setting in AndroidStudio and change values like in this image.
Then click ok.
I'm new on using android project version 0.82. I was creating a new apps (from scratch), and then I try to run the app. but the build process take forever because the gradle project sync failed, and in the top of the text editor, it says gradle project sync in progress. this takes forever. I've check the graddle wrapper properties, I've finished download the gradle 1.12 in the project before.
here is the idea log
2014-08-06 22:51:33,707 [ 284991] INFO - llij.help.impl.HelpManagerImpl - Failed to load help set from 'jar:file:///C:\Users\stephen\AppData\Local\Android\android-studio\help\ideahelp.jar!/idea/Help.hs'
javax.help.HelpSetException: Could not parse
Got an IOException (C:\Users\stephen\AppData\Local\Android\android-studio\help\ideahelp.jar (The system cannot find the path specified))
Parsing failed for null
at javax.help.HelpSet.<init>(HelpSet.java:146)
at com.intellij.help.impl.HelpManagerImpl.loadHelpSet(HelpManagerImpl.java:159)
at com.intellij.help.impl.HelpManagerImpl.createHelpSet(HelpManagerImpl.java:133)
at com.intellij.help.impl.HelpManagerImpl.invokeHelp(HelpManagerImpl.java:54)
at com.intellij.ide.actions.ContextHelpAction.actionPerformed(ContextHelpAction.java:42)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:164)
at com.intellij.openapi.actionSystem.impl.ActionButton.actionPerformed(ActionButton.java:170)
at com.intellij.openapi.actionSystem.impl.ActionButton.performAction(ActionButton.java:133)
at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:313)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:708)
at java.awt.EventQueue$4.run(EventQueue.java:706)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:697)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:520)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Finally somehow after trying to invalidate the cache and restart several times doesn't give any effect, I try to restart my laptop and then it just worked. the build can finally be done.
In interest of why it happens, the reason is staring you right in the face, at what it tells you in the beginning of the above error-log: "Failed to load help set" or some such. I'm completely baffled at how a project sync or build could affect this....
The IDE is attempting to launch or read from a HelpSet jar, perhaps because you pushed a help button or clicked a menu item. If the referenced JAR file actually exists at the specified location, then perhaps the internal file is not readable within the JAR.
That a restart "solves" this is again odd; best guess to correct this? In my case, NetBeans IDE has a console log that is accessible from the View menu, and I presume other IDEs have a debug, diagnostic, or "console" log somewhere. Check your IDE log(s); it may take a little bit of time and exploration to see what's being posted as output.
This isn't a strictly android-studio, or idea, or even Java problem, either; any sufficiently-developed bit of software or IDE can also experience this.
i am starting with android development
i have created some sample application but
when i am opening .xml file resides in res/layout/main.xml
after that my eclipse crash and close.
i even try "open with android layout editor" which also crashes eclipse.
i am not getting why this problem occur.
my os is ubantu 9.04
and using eclipse Galileo
EDIT:
i am getting following error in my eclipse log file. what dose this means???
!ENTRY com.android.ide.eclipse.adt 4 0 2011-04-29 16:56:16.476
!MESSAGE loadAndParseRClass failed to find class com.saltriver.gui.R
!STACK 0
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.lang.ClassLoader.defineClass(ClassLoader.java:465)
at com.android.ide.eclipse.adt.internal.resources.manager.ProjectClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at com.android.ide.eclipse.adt.internal.resources.manager.CompiledResourcesMonitor.loadAndParseRClass(Unknown Source)
at com.android.ide.eclipse.adt.internal.resources.manager.CompiledResourcesMonitor.fileChanged(Unknown Source)
at com.android.ide.eclipse.adt.internal.resources.manager.GlobalProjectMonitor$DeltaVisitor.visit(Unknown Source)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:68)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:48)
at com.android.ide.eclipse.adt.internal.resources.manager.GlobalProjectMonitor$1.resourceChanged(Unknown Source)
at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:291)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285)
at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:149)
at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:313)
at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1022)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1809)
at org.eclipse.core.internal.events.NotificationManager$NotifyJob.run(NotificationManager.java:40)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
"crash" is not very specific. Look into the file .metadata/.log in your workspace to see if Eclipse wrote an error message before it died.
If that doesn't help, start Eclipse from a console with -debug -console -consoleLog.
[EDIT] The error means that you're using Java X to run Eclipse but a plugin needs Java Y (where Y > X).
the usual case is that you run Eclipse with Java 5 and you have a plugin which needs Java 6. Unfortunately, the error message is useless: It doesn't tell you which class is the problem, from which JAR it came, which version it has and which versions are supported - The code has all the information but some smart guy decided that you don't need that. Pity.
So try to get the latest version of Java to run the IDE.
This is independent of the Java version which you use to build and run your projects!! It's just the VM which Eclipse uses to load its plugins. For VMs used in projects, see the Eclipse preferences.
Close 'Eclipse'
Go to your Eclipse folder open eclipse.ini file in any text editor.
after the line which says openFile add following two lines.
-vm
C:\Program Files\Java\jdk1.6.0_24\bin\javaw.exe
(This folder path may vary according to your java installation directory).
save and close.
Open eclipse and tadaaaa!!! you can open xml files again. :)