本文介绍了XML预览中的呈现问题:无法找到模式0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
java.lang.IllegalStateException:无法找到模式0
在android.view.DisplayInfo.findMode (DisplayInfo.java:458)
在android.view.DisplayInfo.getMode(DisplayInfo.java:445)
在android.view.Display.getRefreshRate(Display.java:648)
在android.support.v7.widget.RecyclerView.onAttachedToWindow(RecyclerView.java:2392)
在android.view.View.dispatchAttachedToWindow(View.java:15392)
在android.view.ViewGroup.dispatchAttachedToWindow( ViewGroup.java:2953)
在android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2960)
在android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2960)
在android .view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2960)
在android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2 960)
在android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2960)
在android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2960)
在android.view.AttachInfo_Accessor 。com.android.layoutlib.bridge.Bridge.createS (Bridge.java:429)
在com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:389)
在com.android.tools.idea.rendering.RenderTask $ 2。 compute(RenderTask.java:548)
在com.android.tools.idea.rendering.RenderTask $ 2.compute(RenderTask.java:533)
在com.intellij.openapi.application.impl.ApplicationImpl .runReadAction(ApplicationImpl.java:966)
在com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:533)
在com.android.tools.idea.rendering.RenderTask .lambda $ inflate $ 53(RenderTask.java:659)
在java.util.concurrent.FutureTask.r un(FutureTask.java:266)
在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java: 617)
在java.lang.Thread.run(Thread.java:745)
解决方案
在 com.android.support:design:25.0.0
$ b $中的RecyclerView问题b
也许这个版本有一些问题。
更改版本到24.1.1解决了我的问题。
compile'com.android.support:appcompat-v7: 24.1.1'
compile'com.android.support:support-v13:24.1.1'
compile'com.android.support:design:24.1.1'
如果您没有删除默认提供的gradle导入更改这也
androidTestCompile'com.android.support:support-annotations:24.2.1'
After updating the android studio exception occured during rendering.
java.lang.IllegalStateException: Unable to locate mode 0
at android.view.DisplayInfo.findMode(DisplayInfo.java:458)
at android.view.DisplayInfo.getMode(DisplayInfo.java:445)
at android.view.Display.getRefreshRate(Display.java:648)
at android.support.v7.widget.RecyclerView.onAttachedToWindow(RecyclerView.java:2392)
at android.view.View.dispatchAttachedToWindow(View.java:15392)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2953)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2960)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2960)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2960)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2960)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2960)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2960)
at android.view.AttachInfo_Accessor.setAttachInfo(AttachInfo_Accessor.java:42)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:333)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:429)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:389)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:548)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:533)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:966)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:533)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$53(RenderTask.java:659)
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:745)
解决方案
That's problem with RecyclerView in com.android.support:design:25.0.0
Maybe there is some issue in that version.Changed version to 24.1.1 solved my problem.
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:support-v13:24.1.1'
compile 'com.android.support:design:24.1.1'
in case you not have not removed the default provided gradle imports change this also
androidTestCompile 'com.android.support:support-annotations:24.2.1'
这篇关于XML预览中的呈现问题:无法找到模式0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!