2017-01-08 200 views
0

如果我從頭開始創建一個新項目或打開我以前的項目之一,我得到:AndroidStudio錯誤:訪問被拒絕?

java.io.FileNotFoundException: C:\Users\Terry.AndroidStudio2.2\system\android-palette\v1\layout_palette.xml (Access is denied).

我沒有以前和現在一下子我得到這個錯誤的任何問題。

我沒有問題使用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

這是一個簡單的解決。我製作了文件layout_palette.xmlmenu_palette.xml可寫和它的工作。