Eclipse中使用recyclerview时出现Caused by: java.lang.NoClassDefFoundError: android.support.v7.recyclerview.R$styleable

转自:

http://blog.csdn.net/chenleicpp/article/details/46848785

程序崩溃,错误提示:

Caused by: java.lang.NoClassDefFoundError: android.support.v7.recyclerview.R$styleable

原因:

在eclipse中使用RecyclerView,编译没有问题,但是运行时候会出现如下错误,百思不得其解,又说v4包与v7包版本不一致,有说没有导入v7-compat包的,经反复实验,得出结论跟v4包、v7compat包都没有关系,跟recyclerview的版本有关系,eclipse只能导入21.0.0的才可以使用。

解决方法: 
在android-sdk/extras/android/m2repository/com/android/support/recyclerview-v7目录下根据版本号21.0.0目录可以找到一个名为recyclerview-v7-21.0.0.aar的文件。解压此文件里面有classes.jar,引用此jar包。 
错误 
在android-sdk/extras/android/support/v7/recyclerview目录下面有libs,里面有jar包,引用此jar包。

时间: 2024-10-13 07:40:57

Eclipse中使用recyclerview时出现Caused by: java.lang.NoClassDefFoundError: android.support.v7.recyclerview.R$styleable的相关文章

多线程AsyncTask中使用Jsoup 报错Caused by: java.lang.NoClassDefFoundError: org.jsoup.Jsoup

代码如下,在多线程AsyncTask类中的doInBackground调用Jsoup protected String doInBackground(String... params) { // TODO Auto-generated method stub Log.i(TAG, "doInBackground(Params... params) called"); try { Document doc=Jsoup.connect(params[0]).get(); Elements

从无到有构建大型电商微服务架构(一),eclipse构建springcloud消费者方引起的问题(Caused by: java.lang.NoClassDefFoundError: feign/Feign$Builder)

1 2018-12-31 14:28:38.180 INFO 37860 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.spring[email protected]a9cd3b1: startup date [Mon Dec 31 14:28:38 CST 2018]; root of context hierarchy 2 2018-12-31 14:28:38.519 INFO 37860 ---

Caused by: java.lang.NoClassDefFoundError:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'identityService': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [com.example.new_oa.identity.se

异常:Caused by: java.lang.NoClassDefFoundError: Could not initialize class net.sf.log4jdbc.Properties

参考文章: 使用Log4jdbc-log4j2监听MyBatis中运行的SQL和Connection 使用 log4jdbc格式化输出SQL,maven配置如下: <dependency> <groupId>org.bgee.log4jdbc-log4j2</groupId> <artifactId>log4jdbc-log4j2-jdbc4</artifactId> <version>1.16</version> <

Caused by: java.lang.NoClassDefFoundError: javax/servlet/ServletContext

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.linewell.wechat.WechatApplication]; nested exception is java.lang.IllegalStateException: Failed to introspect annotated methods on class org.spri

Caused by: java.lang.NoClassDefFoundError: freemarker/cache/TemplateLoader

1.错误描写叙述 usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { -help | start | stop } 2014-7-10 23:28:16 org.apache.catalina.core.AprLifecycleListener init 信息: Loaded APR based Apache Tomcat Native library 1.1.29 usi

Selenium 运行时出现错误(java.lang.NoClassDefFoundError: com/google/common/base/Function)

已经写好了java脚本,点击运行的过程中如果出现如下的错误提示时: java.lang.NoClassDefFoundError: com/google/common/base/Function 问题出现的原因是: 没有将Selenium server的相关包导入到“Referenced Libraries”中: 可以使用如下的方法解决这个问题: 将鼠标放到已经创建好的Project上,右键点击 -->“Build Path”-->"Configure Build Path"

Caused by: java.lang.NoClassDefFoundError: org/springframework/web/context/WebApplicationContext

1.错误描述 严重: A child container failed during start java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/smp]] at java.util.concurre

Caused by: java.lang.NoClassDefFoundError: org/apache/neethi/AssertionBuilderFactory

1.错误描述 严重: StandardWrapper.Throwable org.apache.cxf.bus.extension.ExtensionException at org.apache.cxf.bus.extension.Extension.tryClass(Extension.java:167) at org.apache.cxf.bus.extension.Extension.getClassObject(Extension.java:179) at org.apache.cxf