如果我从头开始创建一个新项目或打开我之前的一个项目,我会得到:
java.io.FileNotFoundException: C:\ Users \用户Terry.AndroidStudio2.2 \ SYSTEM \机器人调色板\ V1 \ layout_palette.xml (访问被拒绝)。
我之前没有任何问题,现在我突然发现了这个错误。
使用IDE打开此文件没有问题,所以我不明白为什么打开它会有问题。
有没有人有任何建议? 我使用的是2.2.3版本。
以下是事件序列:
java.io.FileNotFoundException: C:\Users\Terry\.AndroidStudio2.2\system\android-palette\v1\layout_palette.xml (Access is denied)
java.lang.RuntimeException: java.io.FileNotFoundException: C:\Users\Terry\.AndroidStudio2.2\system\android-palette\v1\layout_palette.xml (Access is denied)
at com.android.tools.idea.uibuilder.palette.NlPaletteModel.loadPalette(NlPaletteModel.java:82)
at com.android.tools.idea.uibuilder.palette.NlPaletteModel.getPalette(NlPaletteModel.java:60)
at com.android.tools.idea.uibuilder.palette.NlPalettePanel.checkForNewMissingDependencies(NlPalettePanel.java:542)
at com.android.tools.idea.uibuilder.palette.NlPalettePanel.setDesignSurface(NlPalettePanel.java:195)
at com.android.tools.idea.uibuilder.palette.NlPalettePanel.<init>(NlPalettePanel.java:140)
at com.android.tools.idea.uibuilder.editor.NlPaletteManager.createContent(NlPaletteManager.java:88)
at com.intellij.designer.LightToolWindowManager$4.run(LightToolWindowManager.java:261)
at com.intellij.designer.LightToolWindowManager$4.run(LightToolWindowManager.java:258)
at com.intellij.designer.LightToolWindowManager.bind(LightToolWindowManager.java:208)
at com.android.tools.idea.uibuilder.editor.NlPreviewForm.lambda$attachPalette$178(NlPreviewForm.java:336)
at com.intellij.openapi.project.DumbServiceImpl.runWhenSmart(DumbServiceImpl.java:163)
at com.android.tools.idea.uibuilder.editor.NlPreviewForm.attachPalette(NlPreviewForm.java:332)
at com.android.tools.idea.uibuilder.editor.NlPreviewForm.setActiveModel(NlPreviewForm.java:326)
at com.android.tools.idea.uibuilder.editor.NlPreviewForm$Pending.run(NlPreviewForm.java:264)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:345)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:329)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:857)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:658)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:386)
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)
Caused by: java.io.FileNotFoundException: C:\Users\Terry\.AndroidStudio2.2\system\android-palette\v1\layout_palette.xml (Access is denied)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
at com.android.tools.idea.uibuilder.palette.NlPaletteModel.copyPredefinedPalette(NlPaletteModel.java:99)
at com.android.tools.idea.uibuilder.palette.NlPaletteModel.loadPalette(NlPaletteModel.java:74)
... 32 more
答案 0 :(得分:0)
这是一个简单的修复。我将文件 layout_palette.xml 和 menu_palette.xml 设为可写并且有效。
答案 1 :(得分:0)
对我来说,/。AndriodStudio下的所有目录都是隐藏和只读模式。我更改了权限,然后它开始工作。