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.
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'm new to NativeScript and took over a project recently upgraded from NativeScript 4 to 6. Here is my environment detials:
Windows 10
Node v16.6.1
NativeScript 8.0.2
Android Studio 11 (with al
the recommended updates to date)
VS Code 1.58.2
I can create a new Native script project with "tns create" and build/run it in the simulator just fine. However, when I try to run the project the build throws the following error:
java.lang.RuntimeException: Class not found android.support.v4.view.ViewPager.OnPageChangeListener
at org.nativescript.staticbindinggenerator.Generator.getClass(Generator.java:551)
at org.nativescript.staticbindinggenerator.Generator.getInterfacesFromCache(Generator.java:534)
at org.nativescript.staticbindinggenerator.Generator.writeBinding(Generator.java:283)
at org.nativescript.staticbindinggenerator.Generator.generateBinding(Generator.java:171)
at org.nativescript.staticbindinggenerator.Generator.processRows(Generator.java:234)
at org.nativescript.staticbindinggenerator.Generator.generateBindings(Generator.java:121)
at org.nativescript.staticbindinggenerator.Generator.writeBindings(Generator.java:97)
at org.nativescript.staticbindinggenerator.Main.main(Main.java:55)
Here is the run command I'm using: "tns run android --emulator"
I have tried tons of things and searches but no luck resolving this issue.
So I had an idea and searched with a different search engine than I normally use. I did find some ideas which helped me resolved the issue.
I had previously searched in VSCode for variations on "android.support.v4.view.ViewPager.OnPageChangeListener", but only found the log file with the error. Then I learned you have to change the filter options of the find in file search otherwise the files you are looking for can be excluded from the search results. I also used Baregrep to confirm I was getting everything.
I fixed the issue by replacing all occurrences of:
android.support.v4.view.ViewPager with androidx.viewpager.widget.ViewPager
Also you may need to install widgets:npm i tns-core-modules-widgets
Since the files where I made the changes were all non-project files (many of them in the node_modules directory) there is probably something else that involves updating Node or NativeScript that may solve this as well.
If someone else figures that out, I'll be watching this thread for updates, and thanks in advance!
Fissh
I am trying to implement firebase with xamarin.android but after downloading some nugat packages I started getting different errors and the latest one is as below:
Severity Code Description Project File Line Suppression State
Error The "XamarinBuildAndroidAarProguardConfigs" task failed unexpectedly.
System.IO.InvalidDataException: Central Directory corrupt. ---> System.IO.IOException: An attempt was made to move the file pointer before the beginning of the file.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.SeekCore(Int64 offset, SeekOrigin origin)
at System.IO.FileStream.Seek(Int64 offset, SeekOrigin origin)
at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory()
--- End of inner exception stack trace ---
at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory()
at System.IO.Compression.ZipArchive.Init(Stream stream, ZipArchiveMode mode, Boolean leaveOpen)
at System.IO.Compression.ZipArchive..ctor(Stream stream, ZipArchiveMode mode, Boolean leaveOpen, Encoding entryNameEncoding)
at Xamarin.Build.Download.XamarinBuildAndroidAarProguardConfigs.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() FireBaseSolution
android target framework : 25
Some of installed references :
Xamarin.Android.Support.v4
Xamarin.Android.Support.v7.AppCompat
Xamarin.GooglePlayServices.Base
Xamarin.Firebase.Messaging
Please guide me how to resolve it.
Thanks
For me the solution was in downgrading version nuget package "Xamarin.Build.Download" to version 4.4
Answering on an old question, but this may help others if they ended up in the same situation as me (not being allowed to modify the version of Xamarin.Build.Download), here's how I fixed it:
I deleted the folders for C:\Users(username)\AppData\Local\Xamarin and C:\Users(username)\AppData\Local\XamarinBuildDownloadCache and rebuilt my solution.
What I found was that evening using the NuGet cache clearing tool in Visual Studio, these directories remained untouched.
I can only surmise that this issue can also be caused by file corruption (I might have had a faulty network connection), and the DownloadCahe blocked attempting to get the "clean" files.
On MacOS I had to wipe all folders concerning Xamarin in "~/Library/Caches". Afterwards it would build fine.
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 have just started with android in Eclipse and now i want to do the same in netbeans 6.8, i Configured netbeans with all the (andoird's)jar files..etc..whatever it asked me to do.,now it is possible to open the android project in the my netbeans 6.8, but the problem that i get now,
While i try to start new Android Project,Its getting opened and in the console ,its saying that build is successful,after i code the simple helloworld app and once i clean and build the app,its showing me as Build failed..Please help me to rectify the same..
I am very much annoyed becos of this problem for the last 2 days..
This is the error that i got...
Created dir: C:\Android Practices\workspace\AndroidApplication2\dist
=C:\Android was unexpected at this time.
C:\Android Practices\workspace\AndroidApplication2\nbproject\build-impl.xml:411: exec returned: 255
BUILD FAILED (total time: 0 seconds)
I had this same problem and it seems to come from the whitespaces existing in the path. Try changing the directory name to one without white spaces or change the path in the ant to something like this:
<project ... >
<property file="local.properties" />
<property name="sdk.dir" value="C:\Docume~1\user\android-sdk-windows" />
...
which is what solved my problem. Notice that Docume~1 is exactly 8 character long, I remember that was important.
I hope that helps.
Edit: I updated the answer to mark where to add the line, but unless your local.properties file contains something else apart from the definition of the sdk.dir, you can delete that line