gpt4 book ai didi

安卓工作室 : UnsupportedOperationException: Operation is not supported > for read-only collection

转载 作者:太空宇宙 更新时间:2023-11-03 13:39:47 27 4
gpt4 key购买 nike

我使用的是 Android Studio 3.3.2每次我打开我的项目时,都会出现一条消息:由于批量更新,索引暂停。

IDE 捕获了一个错误:

java.lang.UnsupportedOperationException: Operation is not supported for read-only collection
at kotlin.collections.EmptyList.add(Collections.kt)
at com.android.tools.idea.gradle.run.MakeBeforeRunTaskProviderUtil.addBeforeRunTaskToConfig(MakeBeforeRunTaskProviderUtil.java:109)
at com.android.tools.idea.gradle.run.MakeBeforeRunTaskProviderUtil.fixConfigurationsMissingBeforeRunTask(MakeBeforeRunTaskProviderUtil.java:65)
at com.android.tools.idea.gradle.project.FixAndroidRunConfigurationsAction.actionPerformed(FixAndroidRunConfigurationsAction.java:75)
at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:255)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:272)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.lambda$null$2(ActionManagerImpl.java:1356)
at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:195)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.lambda$tryToExecuteNow$3(ActionManagerImpl.java:1313)
at com.intellij.openapi.wm.impl.FocusManagerImpl.lambda$doWhenFocusSettlesDown$2(FocusManagerImpl.java:199)
at com.intellij.util.ui.UIUtil.invokeLaterIfNeeded(UIUtil.java:3094)
at com.intellij.ide.IdeEventQueue.ifFocusEventsInTheQueue(IdeEventQueue.java:189)
at com.intellij.ide.IdeEventQueue.executeWhenAllFocusEventsLeftTheQueue(IdeEventQueue.java:138)
at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:190)
at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:196)
at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.doWhenFocusSettlesDown(IdeFocusManagerImpl.java:63)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.tryToExecuteNow(ActionManagerImpl.java:1312)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.lambda$tryToExecute$1(ActionManagerImpl.java:1297)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.tryToExecute(ActionManagerImpl.java:1300)
at com.android.tools.idea.gradle.project.FixAndroidRunConfigurationsAction.executeAction(FixAndroidRunConfigurationsAction.java:99)
at com.android.tools.idea.gradle.project.FixAndroidRunConfigurationsAction.perform(FixAndroidRunConfigurationsAction.java:62)
at com.android.tools.idea.gradle.project.RunConfigurationChecker.lambda$ensureRunConfigsInvokeBuild$0(RunConfigurationChecker.java:70)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:315)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:447)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:431)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:415)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
at java.awt.EventQueue.access$500(EventQueue.java:98)
at java.awt.EventQueue$3.run(EventQueue.java:715)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:817)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:758)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:394)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

我必须去File>Invalid cache/restart 来解决这个问题。有人知道如何用无效缓存修复它吗?

最佳答案

尝试使用新的 Android Studio 版本重新导入您的项目。

同时尝试使缓存无效并重新启动。

File > Invalidate Cache & Restart > Just Restart

如果此解决方案不起作用,请尝试只按消息右侧的播放按钮。这种事在我身上发生过很多次。

关于安卓工作室 : UnsupportedOperationException: Operation is not supported > for read-only collection,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55654568/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com