Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio: InvalidVirtualFileAccessException trying to render an XML layout

I'm trying to preview an xml layout (any xml layout) in my app. I'm using Android Studio 1.5 Preview 2. I'm getting this error over and over:

InvalidVirtualFileAccessException: Accessing invalid virtual file: file://D:/Scott/Android/Studio/MyApp/app/build/intermediates/classes/debug/com/scott/myapp/R$styleable.class; original:134487; found:-

Details:

Accessing invalid virtual file: file://D:/Scott/Android/Studio/MyApp/app/build/intermediates/classes/debug/com/scott/myapp/R$styleable.class; original:134487; found:-
com.intellij.openapi.vfs.InvalidVirtualFileAccessException: Accessing invalid virtual file: file://D:/Scott/Android/Studio/MyApp/app/build/intermediates/classes/debug/com/scott/myapp/R$styleable.class; original:134487; found:-
    at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.getFileId(PersistentFSImpl.java:332)
    at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.getTimeStamp(PersistentFSImpl.java:319)
    at com.intellij.openapi.vfs.newvfs.impl.VirtualFileSystemEntry.getTimeStamp(VirtualFileSystemEntry.java:228)
    at org.jetbrains.android.uipreview.ModuleClassLoader.isUpToDate(ModuleClassLoader.java:357)
    at org.jetbrains.android.uipreview.ModuleClassLoader.get(ModuleClassLoader.java:383)
    at org.jetbrains.android.uipreview.ViewLoader.getModuleClassLoader(ViewLoader.java:242)
    at org.jetbrains.android.uipreview.ViewLoader.loadAndParseRClass(ViewLoader.java:515)
    at org.jetbrains.android.uipreview.ViewLoader.loadAndParseRClassSilently(ViewLoader.java:495)
    at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadAndParseRClass(LayoutlibCallbackImpl.java:636)
    at com.android.tools.idea.rendering.RenderTask.<init>(RenderTask.java:153)
    at com.android.tools.idea.rendering.RenderService.createTask(RenderService.java:200)
    at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.doRender(AndroidLayoutPreviewToolWindowManager.java:649)
    at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.access$1700(AndroidLayoutPreviewToolWindowManager.java:80)
    at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7$1.run(AndroidLayoutPreviewToolWindowManager.java:594)
    at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:152)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:452)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:402)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:137)
    at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7.run(AndroidLayoutPreviewToolWindowManager.java:589)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)
    at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254)
    at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)
    at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)
    at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)
    at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
    at com.intellij.util.Alarm$Request$1.run(Alarm.java:351)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)

Anyone else have this error?

Notes:

  • This seems to be specific to this project, as I'm able to render xml layouts in another project using the same version
  • I've tried ReBuilding the project, but it hasn't helped
like image 767
Scott Avatar asked Nov 29 '22 23:11

Scott


1 Answers

If anyone is having this issue in 2.1.2, first try closing your Android Studio project and reopening it. That fixed the error immediately for me after about an hour of trying to debug.

like image 66
Jack Ryan Avatar answered Dec 04 '22 14:12

Jack Ryan