当我尝试使用android studio中的Migrate to android x
功能升级到android x时,迁移成功,但是每当我打开布局文件时,我就开始在Android Support manager plugin
中收到此异常
Collection is empty
java.lang.IllegalArgumentException: Collection is empty
at java.util.EnumSet.copyOf(EnumSet.java:174)
at com.android.tools.idea.uibuilder.model.LayoutParamsManager.setAttribute(LayoutParamsManager.java:379)
at com.android.tools.idea.uibuilder.model.LayoutParamsManager.setAttribute(LayoutParamsManager.java:521)
at com.android.tools.idea.common.model.AttributesTransaction.applyAttributeToView(AttributesTransaction.java:98)
at com.android.tools.idea.common.model.AttributesTransaction.lambda$applyAllPendingAttributesToView$2(AttributesTransaction.java:133)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1620)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at com.android.tools.idea.common.model.AttributesTransaction.applyAllPendingAttributesToView(AttributesTransaction.java:133)
at com.android.tools.idea.common.model.AttributesTransaction.apply(AttributesTransaction.java:204)
at com.android.tools.idea.common.model.AttributesTransaction.commit(AttributesTransaction.java:218)
at com.android.tools.idea.common.command.NlWriteCommandAction$WriteCommandActionImpl.cleanUpAttributes(NlWriteCommandAction.java:107)
at com.android.tools.idea.common.command.NlWriteCommandAction$WriteCommandActionImpl.lambda$run$0(NlWriteCommandAction.java:93)
at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:408)
at com.android.tools.idea.common.command.NlWriteCommandAction$WriteCommandActionImpl.run(NlWriteCommandAction.java:92)
at com.intellij.openapi.command.WriteCommandAction$Simple.run(WriteCommandAction.java:238)
at com.intellij.openapi.application.RunResult.run(RunResult.java:35)
at com.intellij.openapi.command.WriteCommandAction.lambda$null$1(WriteCommandAction.java:175)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1010)
at com.intellij.openapi.command.WriteCommandAction.lambda$performWriteCommandAction$2(WriteCommandAction.java:174)
at com.intellij.openapi.command.WriteCommandAction.lambda$doExecuteCommand$4(WriteCommandAction.java:214)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:137)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:105)
at com.intellij.openapi.command.WriteCommandAction.doExecuteCommand(WriteCommandAction.java:216)
at com.intellij.openapi.command.WriteCommandAction.performWriteCommandAction(WriteCommandAction.java:172)
at com.intellij.openapi.command.WriteCommandAction.execute(WriteCommandAction.java:155)
at com.android.tools.idea.common.command.NlWriteCommandAction.run(NlWriteCommandAction.java:80)
at com.android.tools.idea.common.command.NlWriteCommandAction.run(NlWriteCommandAction.java:75)
at com.android.tools.idea.uibuilder.property.NlPropertyItem.setValueIgnoreDefaultValue(NlPropertyItem.java:360)
at com.android.tools.idea.uibuilder.property.NlPropertyItem.setValue(NlPropertyItem.java:344)
at com.android.tools.idea.uibuilder.property.editors.NlEditingListener$1.stopEditing(NlEditingListener.java:35)
at com.android.tools.idea.common.property.editors.BaseComponentEditor.stopEditing(BaseComponentEditor.java:118)
at com.android.tools.idea.common.property.editors.EnumEditor$PopupMenuHandler.popupMenuWillBecomeInvisible(EnumEditor.java:418)
at javax.swing.JComboBox.firePopupMenuWillBecomeInvisible(JComboBox.java:977)
at javax.swing.plaf.basic.BasicComboPopup.firePopupMenuWillBecomeInvisible(BasicComboPopup.java:361)
at javax.swing.JPopupMenu.setVisible(JPopupMenu.java:795)
at javax.swing.JPopupMenu.menuSelectionChanged(JPopupMenu.java:1483)
at javax.swing.MenuSelectionManager.setSelectedPath(MenuSelectionManager.java:119)
at javax.swing.MenuSelectionManager.clearSelectedPath(MenuSelectionManager.java:151)
at javax.swing.plaf.basic.BasicComboPopup.hide(BasicComboPopup.java:221)
at javax.swing.plaf.basic.BasicComboBoxUI.setPopupVisible(BasicComboBoxUI.java:879)
at javax.swing.JComboBox.setPopupVisible(JComboBox.java:816)
at com.intellij.openapi.ui.ComboBox.setPopupVisible(ComboBox.java:154)
at javax.swing.plaf.basic.BasicComboPopup$Handler.mouseReleased(BasicComboPopup.java:863)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290)
at java.awt.Component.processMouseEvent(Component.java:6548)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3325)
at javax.swing.plaf.basic.BasicComboPopup$1.processMouseEvent(BasicComboPopup.java:510)
at java.awt.Component.processEvent(Component.java:6313)
at java.awt.Container.processEvent(Container.java:2237)
at java.awt.Component.dispatchEventImpl(Component.java:4903)
at java.awt.Container.dispatchEventImpl(Container.java:2295)
at java.awt.Component.dispatchEvent(Component.java:4725)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
at java.awt.Container.dispatchEventImpl(Container.java:2281)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4725)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
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.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:737)
at java.awt.EventQueue$4.run(EventQueue.java:735)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:822)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:759)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:423)
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)
我已经尝试过进行Gradle清理和同步,但是没有运气。我还尝试了几种不同的最低sdk版本。
我们将不胜感激。
谢谢!