Cannot build project due to gradle project sync in progress - android

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.

Related

Android IDE error - AlreadyDisposedException while opening Android studio

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.

Android Studio AI 140

[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.

NullPointerException when run with Intellij IDEA new libgdx project for android

Steps to reproduce:
download setur.jar - http://libgdx.badlogicgames.com/download.html
generate project for desktop, Android, iOS, HTML
open Intellij IDEA, press Open, and select build.gradle
wait while gradle will do the staff and than run android project
I am facing some strange issue:
15:32:20 Compilation completed successfully in 11 sec
15:32:20 NullPointerException: null
15:32:30 Error Report
Error Submitting Feedback: null
Consider creating an issue at Android Issue Tracker
if I press NullPointerException (link), there appears message and stacktrace:
message: Exception in plugin Android Support. x min ago. Occured 2 times since the last clear. Disable plugin... <-- this is a link (if I press this, than Android will be not visible by IDEA at all.
stacktrace:
java.lang.NullPointerException
at com.sun.proxy.$Proxy169.getMinSdkVersion(Unknown Source)
at com.android.tools.idea.model.AndroidModuleInfo.getMinSdkVersion(AndroidModuleInfo.java:71)
at org.jetbrains.android.facet.AndroidFacet.canRunOnDevice(AndroidFacet.java:560)
at org.jetbrains.android.facet.AndroidFacet.isCompatibleDevice(AndroidFacet.java:536)
at org.jetbrains.android.run.DeviceChooser$MyDeviceTableModel.getValueAt(DeviceChooser.java:352)
at javax.swing.JTable.getValueAt(JTable.java:2716)
at com.intellij.ui.table.JBTable.getRowHeight(JBTable.java:149)
at javax.swing.JTable.getRowHeight(JTable.java:993)
at javax.swing.JTable.getCellRect(JTable.java:2936)
at javax.swing.JTable.valueChanged(JTable.java:4697)
at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:184)
at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:164)
at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:211)
at javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:405)
at javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:415)
at javax.swing.DefaultListSelectionModel.setSelectionInterval(DefaultListSelectionModel.java:459)
at org.jetbrains.android.run.DeviceChooser.updateTable(DeviceChooser.java:227)
at org.jetbrains.android.run.DeviceChooser.init(DeviceChooser.java:150)
at org.jetbrains.android.run.ExtendedDeviceChooserDialog.<init>(ExtendedDeviceChooserDialog.java:124)
at org.jetbrains.android.run.AndroidRunningState.execute(AndroidRunningState.java:245)
at com.intellij.execution.runners.DefaultProgramRunner.doExecute(DefaultProgramRunner.java:38)
at org.jetbrains.android.run.AndroidDebugRunner.doExec(AndroidDebugRunner.java:144)
at org.jetbrains.android.run.AndroidDebugRunner.doExecute(AndroidDebugRunner.java:135)
at com.intellij.execution.runners.GenericProgramRunner$1.execute(GenericProgramRunner.java:48)
at com.intellij.execution.impl.ExecutionManagerImpl$2.run(ExecutionManagerImpl.java:208)
at com.intellij.openapi.project.DumbServiceImpl.runWhenSmart(DumbServiceImpl.java:95)
at com.intellij.execution.impl.ExecutionManagerImpl$1$1.run(ExecutionManagerImpl.java:172)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
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.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:697)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:524)
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)
Android does not support Swing & Awt API. So your project should not depend on swing.* / awt.* packages if you want to run it on Android.
You should use the libgdx GUI elements only if you want your game to be cross-plattform. This guide should get you started: https://github.com/libgdx/libgdx/wiki/Scene2d
This is a bug that occurs with IntelliJ 13.x, the fix never made it into that branch.
IntelliJ 14+ and newer versions of Android Studio don't have this issue.
Source: Android Open Source Project Issue

Android Studio Issue - Premature end of file

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.

Problems generating Google App Engine Backend in Android Studio

I'm not able to use the backend generation feature in the Android Studio. I followed this blog post trying to set up a backend for my application, however I'm getting the following IDE error:
Exception in plugin Maven Integration
Argument 0 for #NotNull parameter of com/intellij/util/containers/ContainerUtil.map must not be null: Argument 0 for #NotNull parameter of com/intellij/util/containers/ContainerUtil.map must not be null
java.lang.IllegalArgumentException: Argument 0 for #NotNull parameter of com/intellij/util/containers/ContainerUtil.map must not be null
at com.intellij.util.containers.ContainerUtil.map(ContainerUtil.java)
at org.jetbrains.idea.maven.utils.MavenUtil.collectFiles(MavenUtil.java:247)
at org.jetbrains.idea.maven.wizards.MavenProjectBuilder.commit(MavenProjectBuilder.java:129)
at com.intellij.projectImport.ProjectImportBuilder.commit(ProjectImportBuilder.java:59)
at com.google.gct.intellij.endpoints.externalbuilder.MavenBackendGeneratorHelper.addMavenFunctionality(MavenBackendGeneratorHelper.java:216)
at com.google.gct.intellij.endpoints.externalbuilder.ui.GenerateMavenBackend.actionPerformed(GenerateMavenBackend.java:115)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:162)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter$1.run(ActionMenuItem.java:260)
at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:892)
at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:114)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:230)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:104)
at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:512)
at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:44)
at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:532)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
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:729)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:688)
at java.awt.EventQueue$3.run(EventQueue.java:686)
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:702)
at java.awt.EventQueue$4.run(EventQueue.java:700)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:699)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:686)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:510)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:339)
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)
After the process finishes, I only get the -AppEngine module generated, with no -endpoints module.
I'm sure that Maven is set up properly on my machine, I checked with this issue that also complains about not being able to generate the backend.
Is there a solution to this problem?
[windows 8] get 0.4.0 Android Studio,
New Project,
click on the to select
Tools>Google Cloud Tools>Generate App Engine
provide Project Number and Project ID and API Key, from
https://cloud.google.com/console#/project
looks like you already know about this
This will generate -AppEngine
and
-endpoints
Select -endpoints on the left Project browser,
then Tools>Google Cloud Tools>Generate Client Libraries
(this makes the .war that get deployed with app-engine so app-engine code can deal with endpoint code)
Click on "Maven Projects" written vertically on the far right top,
click Plugins>appengine, click appengine:update
That will deploy the appengine.
(Jan 7 '14) You have to go back to the console and reselect the correct Version in order for the app to Register with the Endpoint Service.
go here:
https://cloud.google.com/console#/project, then click AppEngine, then click Versions, then click the latest Version, then click Make Default
The new solution is to go to File>New Module>More Modules>AppEngine Java Endpoints Module
Here's a Google I/O video that describes more about setting up the steps to set it up:
https://www.youtube.com/watch?v=KBhOkfbbZLk
There's also this link on Google's documentation for Cloud Tools:
https://cloud.google.com/mobile/app_engine/add_module
You Should Need to Install the Google API Packages into Your Workspace..Then,only You will Access the same..Otherwise,it shows an ERROR only..

Categories

Resources