how to reduce AndroidLayoutPreviewToolWindowManager errors?

how can I reduce the number of crashes in Idea's AndroidLayoutPreviewToolWindowManager?

in the stack trace below, the resource value mentioned is available and well-defined--it is a .png image.  Simpler pages render ok.  

thanks,

larry

android.content.res.Resources$NotFoundException: Could not resolve resource value: 0x7F0200B1.
 at com.android.layoutlib.bridge.android.BridgeResources.throwException(BridgeResources.java:648)
 at com.android.layoutlib.bridge.android.BridgeResources.getDrawable(BridgeResources.java:171)
 at android.view.View.setBackgroundResource(View.java:7393)
 at com.makeramen.segmented.SegmentedRadioGroup.changeButtonsImages(SegmentedRadioGroup.java:46)
 at com.makeramen.segmented.SegmentedRadioGroup.onFinishInflate(SegmentedRadioGroup.java:39)
 at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
 at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
 at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
 at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
 at android.view.LayoutInflater.inflate(LayoutInflater.java:296)
 at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:279)
 at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:318)
 at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:325)
 at org.jetbrains.android.uipreview.RenderService.createRenderSession(RenderService.java:107)
 at org.jetbrains.android.uipreview.RenderUtil.renderLayout(RenderUtil.java:107)
 at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.doRender(AndroidLayoutPreviewToolWindowManager.java:367)
 at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.access$1100(AndroidLayoutPreviewToolWindowManager.java:78)
 at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7$1.run(AndroidLayoutPreviewToolWindowManager.java:305)
 at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178)
 at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:206)
 at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:169)
 at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7.run(AndroidLayoutPreviewToolWindowManager.java:301)
 at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:308)
 at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:298)
 at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:243)
 at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:258)
 at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:217)
 at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:207)
 at com.intellij.util.Alarm$Request$1.run(Alarm.java:230)
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 at java.lang.Thread.run(Thread.java:680)

2 comments
Comment actions Permalink

Try to rebuild project and refresh preview. If it doesn't help, please create an issue in the tracker

0
Comment actions Permalink

Thanks, that helps.  I like the preview feature a lot.

0

Please sign in to leave a comment.