The following classes could not be instantiated: android.support.v7.widget.RecyclerView v7中找不到的终极方法

首先贴一下我的项目build.gradle文件


默认情况下只有appcompat的v7包,没有Recyclerview的v7包,在布局文件中添加

<android.support.v7.widget.RecyclerView/>

预览布局时会报错如下:


因此我们在dependicens加入

compile 'com.android.support:recyclerview-v7:25.0.0'
然后Sync项目,发现布局试图预览正常。

————————————————————————————————

打完。。。。。。。。。。。收工


发布了145 篇原创文章 · 获赞 226 · 访问量 76万+
展开阅读全文

android studio运行时的rendering problems如下,如何解决?

03-29

The following classes could not be instantiated: - android.support.design.widget.FloatingActionButton (Open Class, Show Exception, Clear Cache) - com.baidu.mapapi.map.MapView (Open Class, Show Exception, Clear Cache) Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE Exception Details android.content.res.Resources$NotFoundException: Unable to find resource ID #0x1080029    at android.content.res.Resources.getResourceName(Resources.java:2235)    at android.content.res.Resources.loadDrawableForCookie(Resources.java:2602)   at android.content.res.Resources.loadDrawable(Resources.java:2540)   at android.content.res.Resources.getDrawable(Resources.java:806)   at android.content.Context.getDrawable(Context.java:458)   at android.support.v4.content.ContextCompatApi21.getDrawable(ContextCompatApi21.java:26)    at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:321)   at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:180)   at android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:70)    at android.support.v7.widget.AppCompatImageHelper.loadFromAttributes(AppCompatImageHelper.java:39)   at android.support.v7.widget.AppCompatImageButton.<init>(AppCompatImageButton.java:65)    at android.support.design.widget.VisibilityAwareImageButton.<init>(VisibilityAwareImageButton.java:37)   at android.support.design.widget.FloatingActionButton.<init>(FloatingActionButton.java:109)    at android.support.design.widget.FloatingActionButton.<init>(FloatingActionButton.java:105)    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:835)    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)   at android.view.LayoutInflater.rInflate(LayoutInflater.java:811)    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)   at android.view.LayoutInflater.inflate(LayoutInflater.java:515)    at android.view.LayoutInflater.inflate(LayoutInflater.java:394) Copy stack to clipboard Using an obsolete version of the 6.0 layout library which contains many known bugs: Install Update, Ignore For Now 问答

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览