android - Using CardView and RecyclerView in my layout files throws an exception -


so i've been taking shot @ material design of android preview l. imported both cardview , recyclerview libraries.

i use android studio preview version 0.8.0. have latest sdk packages installed.

once use them in layout files though, previewer throws exception both of them.

here exception cardview:

java.lang.classformaterror: illegal field name "cardview.dark" in class android/support/v7/cardview/r$style @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclass(classloader.java:792) @ java.lang.classloader.defineclass(classloader.java:635) @ org.jetbrains.android.uipreview.projectclassloader.findclass(projectclassloader.java:63) @ java.lang.classloader.loadclass(classloader.java:424) @ java.lang.classloader.loadclass(classloader.java:411) @ java.lang.classloader.loadclass(classloader.java:357) @ android.support.v7.widget.cardview.initialize(cardview.java:69) @ android.support.v7.widget.cardview.<init>(cardview.java:60) @ sun.reflect.nativeconstructoraccessorimpl.newinstance0(native method) @ sun.reflect.nativeconstructoraccessorimpl.newinstance(nativeconstructoraccessorimpl.java:57) @ sun.reflect.delegatingconstructoraccessorimpl.newinstance(delegatingconstructoraccessorimpl.java:45) @ java.lang.reflect.constructor.newinstance(constructor.java:526) @ org.jetbrains.android.uipreview.viewloader.createnewinstance(viewloader.java:375) @ org.jetbrains.android.uipreview.viewloader.loadview(viewloader.java:100) @ com.android.tools.idea.rendering.layoutlibcallback.loadview(layoutlibcallback.java:172) @ android.view.bridgeinflater.loadcustomview(bridgeinflater.java:207) @ android.view.bridgeinflater.createviewfromtag(bridgeinflater.java:132) @ android.view.layoutinflater.inflate(layoutinflater.java:478) @ android.view.layoutinflater.inflate(layoutinflater.java:381) @ com.android.layoutlib.bridge.impl.rendersessionimpl.inflate(rendersessionimpl.java:395) @ com.android.layoutlib.bridge.bridge.createsession(bridge.java:329) @ com.android.ide.common.rendering.layoutlibrary.createsession(layoutlibrary.java:332) @ com.android.tools.idea.rendering.renderservice$3.compute(renderservice.java:575) @ com.android.tools.idea.rendering.renderservice$3.compute(renderservice.java:564) @ com.intellij.openapi.application.impl.applicationimpl.runreadaction(applicationimpl.java:932) @ com.android.tools.idea.rendering.renderservice.createrendersession(renderservice.java:564) @ com.android.tools.idea.rendering.renderservice.render(renderservice.java:691) @ org.jetbrains.android.uipreview.androidlayoutpreviewtoolwindowmanager.dorender(androidlayoutpreviewtoolwindowmanager.java:586) @ org.jetbrains.android.uipreview.androidlayoutpreviewtoolwindowmanager.access$1900(androidlayoutpreviewtoolwindowmanager.java:80) @ org.jetbrains.android.uipreview.androidlayoutpreviewtoolwindowmanager$6$1.run(androidlayoutpreviewtoolwindowmanager.java:528) @ com.intellij.openapi.progress.impl.progressmanagerimpl$2.run(progressmanagerimpl.java:178) @ com.intellij.openapi.progress.progressmanager.executeprocessunderprogress(progressmanager.java:209) @ com.intellij.openapi.progress.impl.progressmanagerimpl.executeprocessunderprogress(progressmanagerimpl.java:212) @ com.intellij.openapi.progress.impl.progressmanagerimpl.runprocess(progressmanagerimpl.java:171) @ org.jetbrains.android.uipreview.androidlayoutpreviewtoolwindowmanager$6.run(androidlayoutpreviewtoolwindowmanager.java:523) @ com.intellij.util.ui.update.mergingupdatequeue.execute(mergingupdatequeue.java:320) @ com.intellij.util.ui.update.mergingupdatequeue.execute(mergingupdatequeue.java:310) @ com.intellij.util.ui.update.mergingupdatequeue$2.run(mergingupdatequeue.java:254) @ com.intellij.util.ui.update.mergingupdatequeue.flush(mergingupdatequeue.java:269) @ com.intellij.util.ui.update.mergingupdatequeue.flush(mergingupdatequeue.java:227) @ com.intellij.util.ui.update.mergingupdatequeue.run(mergingupdatequeue.java:217) @ com.intellij.util.concurrency.queueprocessor.runsafely(queueprocessor.java:238) @ com.intellij.util.alarm$request$1.run(alarm.java:327) @ java.util.concurrent.executors$runnableadapter.call(executors.java:471) @ java.util.concurrent.futuretask$sync.innerrun(futuretask.java:334) @ java.util.concurrent.futuretask.run(futuretask.java:166) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615) @ java.lang.thread.run(thread.java:724) 

and here exception recyclerview:

java.lang.nullpointerexception @ android.support.v7.widget.recyclerview.onmeasure(recyclerview.java:1310) @ android.view.view.measure(view.java:16987) @ android.widget.relativelayout.measurechildhorizontal(relativelayout.java:722) @ android.widget.relativelayout.onmeasure(relativelayout.java:458) @ android.view.view.measure(view.java:16987) @ android.view.viewgroup.measurechildwithmargins(viewgroup.java:5257) @ android.widget.framelayout.onmeasure(framelayout.java:314) @ android.view.view.measure(view.java:16987) @ android.view.viewgroup.measurechildwithmargins(viewgroup.java:5257) @ com.android.internal.widget.actionbaroverlaylayout.onmeasure(actionbaroverlaylayout.java:447) @ android.view.view.measure(view.java:16987) @ android.view.viewgroup.measurechildwithmargins(viewgroup.java:5257) @ android.widget.linearlayout.measurechildbeforelayout(linearlayout.java:1436) @ android.widget.linearlayout.measurehorizontal(linearlayout.java:1083) @ android.widget.linearlayout.onmeasure(linearlayout.java:615) @ android.view.view.measure(view.java:16987) @ android.view.viewgroup.measurechildwithmargins(viewgroup.java:5257) @ android.widget.linearlayout.measurechildbeforelayout(linearlayout.java:1436) @ android.widget.linearlayout.measurevertical(linearlayout.java:722) @ android.widget.linearlayout.onmeasure(linearlayout.java:613) @ android.view.view.measure(view.java:16987) @ android.widget.linearlayout.measurevertical(linearlayout.java:875) @ android.widget.linearlayout.onmeasure(linearlayout.java:613) @ android.view.view.measure(view.java:16987) @ com.android.layoutlib.bridge.impl.rendersessionimpl.measureview(rendersessionimpl.java:621) @ com.android.layoutlib.bridge.impl.rendersessionimpl.render(rendersessionimpl.java:521) @ com.android.layoutlib.bridge.bridge.createsession(bridge.java:331) @ com.android.ide.common.rendering.layoutlibrary.createsession(layoutlibrary.java:332) @ com.android.tools.idea.rendering.renderservice$3.compute(renderservice.java:575) @ com.android.tools.idea.rendering.renderservice$3.compute(renderservice.java:564) @ com.intellij.openapi.application.impl.applicationimpl.runreadaction(applicationimpl.java:932) @ com.android.tools.idea.rendering.renderservice.createrendersession(renderservice.java:564) @ com.android.tools.idea.rendering.renderservice.render(renderservice.java:691) @ org.jetbrains.android.uipreview.androidlayoutpreviewtoolwindowmanager.dorender(androidlayoutpreviewtoolwindowmanager.java:586) @ org.jetbrains.android.uipreview.androidlayoutpreviewtoolwindowmanager.access$1900(androidlayoutpreviewtoolwindowmanager.java:80) @ org.jetbrains.android.uipreview.androidlayoutpreviewtoolwindowmanager$6$1.run(androidlayoutpreviewtoolwindowmanager.java:528) @ com.intellij.openapi.progress.impl.progressmanagerimpl$2.run(progressmanagerimpl.java:178) @ com.intellij.openapi.progress.progressmanager.executeprocessunderprogress(progressmanager.java:209) @ com.intellij.openapi.progress.impl.progressmanagerimpl.executeprocessunderprogress(progressmanagerimpl.java:212) @ com.intellij.openapi.progress.impl.progressmanagerimpl.runprocess(progressmanagerimpl.java:171) @ org.jetbrains.android.uipreview.androidlayoutpreviewtoolwindowmanager$6.run(androidlayoutpreviewtoolwindowmanager.java:523) @ com.intellij.util.ui.update.mergingupdatequeue.execute(mergingupdatequeue.java:320) @ com.intellij.util.ui.update.mergingupdatequeue.execute(mergingupdatequeue.java:310) @ com.intellij.util.ui.update.mergingupdatequeue$2.run(mergingupdatequeue.java:254) @ com.intellij.util.ui.update.mergingupdatequeue.flush(mergingupdatequeue.java:269) @ com.intellij.util.ui.update.mergingupdatequeue.flush(mergingupdatequeue.java:227) @ com.intellij.util.ui.update.mergingupdatequeue.run(mergingupdatequeue.java:217) @ com.intellij.util.concurrency.queueprocessor.runsafely(queueprocessor.java:238) @ com.intellij.util.alarm$request$1.run(alarm.java:327) @ java.util.concurrent.executors$runnableadapter.call(executors.java:471) @ java.util.concurrent.futuretask$sync.innerrun(futuretask.java:334) @ java.util.concurrent.futuretask.run(futuretask.java:166) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615) @ java.lang.thread.run(thread.java:724) 

this makes building layout near impossible using these 2 (amazing) views, i'm curious about.

is there fix already, or expected behaviour seeing they're "custom" views, in sense?

this bug in android studio. preview tool not know how initialize widgets. believe so, because same exception thrown app if forget call recyclerview.setlayoutmanager() in code.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -