The preview of a RecyclerView with the tools:listitem attribute doesn't work when RxBinding 3.0.0-alpha2 is a dependency.
The preview window launch the following error:
java.lang.ClassNotFoundException: androidx.recyclerview.widget.RecyclerView$Adapter
at org.jetbrains.android.uipreview.ModuleClassLoader.load(ModuleClassLoader.java:190)
at com.android.tools.idea.rendering.RenderClassLoader.findClass(RenderClassLoader.java:61)
at org.jetbrains.android.uipreview.ModuleClassLoader.findClass(ModuleClassLoader.java:124)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.jetbrains.android.uipreview.ModuleClassLoader.loadClass(ModuleClassLoader.java:224)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.lang.ClassLoader.defineClass(ClassLoader.java:642)
at com.android.tools.idea.rendering.RenderClassLoader.defineClassAndPackage(RenderClassLoader.java:197)
at org.jetbrains.android.uipreview.ModuleClassLoader.findClass(ModuleClassLoader.java:141)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.jetbrains.android.uipreview.ModuleClassLoader.loadClass(ModuleClassLoader.java:224)
at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:422)
at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:176)
at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:137)
at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadClass(LayoutlibCallbackImpl.java:306)
at com.android.layoutlib.bridge.android.support.RecyclerViewUtil.createAdapter(RecyclerViewUtil.java:122)
at com.android.layoutlib.bridge.android.support.RecyclerViewUtil.setAdapter(RecyclerViewUtil.java:64)
at android.view.BridgeInflater.setupViewInContext(BridgeInflater.java:467)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:350)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:863)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:837)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:394)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:325)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:385)
at com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:193)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:509)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$4(RenderTask.java:638)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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:745)
The issue can be easily recreated with a basic android project and the following layouts.
The preview of a RecyclerView with the tools:listitem attribute doesn't work when RxBinding 3.0.0-alpha2 is a dependency.
The preview window launch the following error:
The issue can be easily recreated with a basic android project and the following layouts.
item.xml
activity_main.xml
I am not sure the issue is totally on RxBinding