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.
Related
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 just installed Android Studio and have started a new app (Basic App template with toolbar and floating button). I have enabled Virtualization in my BIOS and have added a Pixel 2 (version 29) emulator.
When I press the Run button, the emulator opens the Pixel 2 and powers on, but the app doesn't open and no icons appear (apart from the standard phone, sms, chrome, playstore icons). I press Run again and still nothing happens (apart from Gradle building).
There are no errors that I can see.
Edit: Every now and then when I press Run I see the following error message in Event Log:
8:52 AM Error during Sync: Remote object doesn't exist!
This only occurs sometimes. Other time, it just says:
8:44 AM Executing tasks: [:app:assembleDebug]
8:44 AM Gradle build finished in 3 s 972 ms
I have tried:
Deleting the emulator from AVD Manager then creating a new one (Pixel 2, version 29, everything else left as default).
Deleting the project and creating a new one
Uninstalling and reinstalling Android Studio
Restarting computer
Going to File > Invalidate Caches / Restart and invaliding then restarting
Edit 2:
I was just asked to check Logcat in a comment. There is a lot in there but this part is highlighted red and repeats throughout the logs:
2019-08-02 08:53:21.707 2031-9184/? E/LoadManifestTask: Can't find Chimera operation impl class com.google.android.gms.walletp2p.infra.phenotype.PhenotypeCommitIntentOperation dropping operation
java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.walletp2p.infra.phenotype.PhenotypeCommitIntentOperation" on path: DexPathList[[zip file "/system/product/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk"],nativeLibraryDirectories=[/data/user_de/0/com.google.android.gms/app_extracted_libs/x86, /system/product/priv-app/PrebuiltGmsCore/lib/x86, /system/product/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk!/lib/x86, /system/lib, /system/product/lib, /system/lib, /system/product/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at ecj.<init>(:com.google.android.gms#16910022#16.9.10 (040700-247503114):5)
at eck.run(:com.google.android.gms#16910022#16.9.10 (040700-247503114):53)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
This is a very undesirable kind of system bug. Well, the point is here that, sometimes even creating a simple data directory won't work. You would have to go to the source and create a folder yourself. This case is same. Attempting 'Invalidate caches and restating' isn't working, so you have to do it manually. This is how:
Solution:
Close Android Studio
Go to C:\Users\UserName\.android and rename:
build-cache folder to build-cache.bak
Go to C:\Users\UserName\.AndroidStudio3.4.2\system and rename these folders:
caches to caches.bak
compiler to compiler.bak
compile-server to compile-server.bak
conversion to conversion.bak
external_build_system to external_build_system.bak
frameworks to frameworks.bak
gradle to gradle.bak
resource_folder_cache to resource_folder_cache.bak
Open the Android Studio and open your project again.
Hope it solves your case also. Did for me when I faced the same problem around a year ago.
[Not useful anymore]
I just updated to the latest version of Android Studio from Canary chanel and I have this error (see below).
I just open the new Android Studio, click on my project and wait to see the error. The popup
Gradle sync in progress
remains, but it does not do anything. And all the project is 'broken' : it does not find reference to anything.
I'm mac Mac OS X 10.10.2
java.lang.NullPointerException
at com.intellij.openapi.externalSystem.service.project.manage.ExternalSystemShortcutsManager.getActionId(ExternalSystemShortcutsManager.java:64)
at com.intellij.openapi.externalSystem.service.project.manage.ExternalSystemKeymapExtension.getActionPrefix(ExternalSystemKeymapExtension.java:149)
at com.intellij.openapi.externalSystem.service.project.manage.ExternalSystemKeymapExtension$ExternalSystemRunConfigurationAction.<init>(ExternalSystemKeymapExtension.java:240)
at com.intellij.openapi.externalSystem.service.project.manage.ExternalSystemKeymapExtension.updateRunConfigurationActions(ExternalSystemKeymapExtension.java:161)
at com.intellij.openapi.externalSystem.service.project.manage.ExternalSystemShortcutsManager.scheduleRunConfigurationKeymapUpdate(ExternalSystemShortcutsManager.java:139)
at com.intellij.openapi.externalSystem.service.project.manage.ExternalProjectsManager.init(ExternalProjectsManager.java:129)
at com.intellij.openapi.externalSystem.service.ExternalSystemStartupActivity$1.run(ExternalSystemStartupActivity.java:49)
at com.intellij.openapi.externalSystem.service.ExternalSystemStartupActivity.runActivity(ExternalSystemStartupActivity.java:79)
at com.intellij.ide.startup.impl.StartupManagerImpl$2.run(StartupManagerImpl.java:156)
at com.intellij.ide.startup.impl.StartupManagerImpl.runActivity(StartupManagerImpl.java:336)
at com.intellij.ide.startup.impl.StartupManagerImpl.access$700(StartupManagerImpl.java:59)
at com.intellij.ide.startup.impl.StartupManagerImpl$3.run(StartupManagerImpl.java:174)
at com.intellij.openapi.project.DumbServiceImpl.updateFinished(DumbServiceImpl.java:259)
at com.intellij.openapi.project.DumbServiceImpl.access$700(DumbServiceImpl.java:52)
at com.intellij.openapi.project.DumbServiceImpl$9.run(DumbServiceImpl.java:424)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
at java.awt.EventQueue.access$400(EventQueue.java:82)
at java.awt.EventQueue$2.run(EventQueue.java:676)
at java.awt.EventQueue$2.run(EventQueue.java:674)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:734)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:569)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:382)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Try using the standalone version, so that you can always go back to a working setup (download link). Plus, make a backup of your Studio preferences (just i case).
Moreover, try performing Invalidate caches/Restart and see if that fixes it.
Ok, I finally found a solution :
Create a new project and copy/paste the sources from the old project to the new one.
That's all.
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.
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. :)