Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 2.2.2 error "Unable to locate mode 0" on rendering preview after update

I update Android Studio to version 2.2.2 and after that I changed compileSdkVersion and buildToolVersion to 25.0.0 and appcompat-V7:25.0.0, Now I can't build project and run project perfectly but I have an error on during rendering activities that contain RecyclerView. here is error detail:

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.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)

Does anyone run into the same problem? any solution!?

like image 378
Mehdi Avatar asked Oct 21 '16 12:10

Mehdi


1 Answers

It's a bug of Android Support Library version 25.0.0, and have fixed in new 25.0.1!

compile 'com.android.support:recyclerview-v7:25.0.1'
like image 157
henry ren Avatar answered Nov 15 '22 00:11

henry ren