为了账号安全,请及时绑定邮箱和手机立即绑定

Error inflating class android.support.v7.widget.RecyclerView

06-17 02:28:45.691: E/AndroidRuntime(1851): FATAL EXCEPTION: main

06-17 02:28:45.691: E/AndroidRuntime(1851): Process: com.qx.recyclerview, PID: 1851

06-17 02:28:45.691: E/AndroidRuntime(1851): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.qx.recyclerview/com.qx.recyclerview.MainActivity}: android.view.InflateException: Binary XML file line #11: Error inflating class android.support.v7.widget.RecyclerView

06-17 02:28:45.691: E/AndroidRuntime(1851): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184)

06-17 02:28:45.691: E/AndroidRuntime(1851): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)

06-17 02:28:45.691: E/AndroidRuntime(1851): at android.app.ActivityThread.access$800(ActivityThread.java:135)

06-17 02:28:45.691: E/AndroidRuntime(1851): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)

06-17 02:28:45.691: E/AndroidRuntime(1851): at android.os.Handler.dispatchMessage(Handler.java:102)

06-17 02:28:45.691: E/AndroidRuntime(1851): at android.os.Looper.loop(Looper.java:136)

06-17 02:28:45.691: E/AndroidRuntime(1851): at android.app.ActivityThread.main(ActivityThread.java:5001)

06-17 02:28:45.691: E/AndroidRuntime(1851): at java.lang.reflect.Method.invokeNative(Native Method)

06-17 02:28:45.691: E/AndroidRuntime(1851): at java.lang.reflect.Method.invoke(Method.java:515)

06-17 02:28:45.691: E/AndroidRuntime(1851): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)

06-17 02:28:45.691: E/AndroidRuntime(1851): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)

06-17 02:28:45.691: E/AndroidRuntime(1851): at dalvik.system.NativeStart.main(Native Method)

06-17 02:28:45.691: E/AndroidRuntime(1851): Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class android.support.v7.widget.RecyclerView

06-17 02:28:45.691: E/AndroidRuntime(1851): at android.view.LayoutInflater.createView(LayoutInflater.java:620)

06-17 02:28:45.691: E/AndroidRuntime(1851): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)

06-17 02:28:45.691: E/AndroidRuntime(1851): at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)

06-17 02:28:45.691: E/AndroidRuntime(1851): at android.view.LayoutInflater.inflate(LayoutInflater.java:492)

06-17 02:28:45.691: E/AndroidRuntime(1851): at android.view.LayoutInflater.inflate(LayoutInflater.java:397)

06-17 02:28:45.691: E/AndroidRuntime(1851): at android.view.LayoutInflater.inflate(LayoutInflater.java:353)

06-17 02:28:45.691: E/AndroidRuntime(1851): at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:249)

06-17 02:28:45.691: E/AndroidRuntime(1851): at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:106)

06-17 02:28:45.691: E/AndroidRuntime(1851): at com.qx.recyclerview.MainActivity.onCreate(MainActivity.java:22)

06-17 02:28:45.691: E/AndroidRuntime(1851): at android.app.Activity.performCreate(Activity.java:5231)

06-17 02:28:45.691: E/AndroidRuntime(1851): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)

06-17 02:28:45.691: E/AndroidRuntime(1851): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)

06-17 02:28:45.691: E/AndroidRuntime(1851): ... 11 more

06-17 02:28:45.691: E/AndroidRuntime(1851): Caused by: java.lang.reflect.InvocationTargetException

06-17 02:28:45.691: E/AndroidRuntime(1851): at java.lang.reflect.Constructor.constructNative(Native Method)

06-17 02:28:45.691: E/AndroidRuntime(1851): at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

06-17 02:28:45.691: E/AndroidRuntime(1851): at android.view.LayoutInflater.createView(LayoutInflater.java:594)

06-17 02:28:45.691: E/AndroidRuntime(1851): ... 22 more

06-17 02:28:45.691: E/AndroidRuntime(1851): Caused by: java.lang.NoClassDefFoundError: android.support.v7.recyclerview.R$styleable

06-17 02:28:45.691: E/AndroidRuntime(1851): at android.support.v7.widget.RecyclerView.<init>(RecyclerView.java:434)

06-17 02:28:45.691: E/AndroidRuntime(1851): at android.support.v7.widget.RecyclerView.<init>(RecyclerView.java:404)

06-17 02:28:45.691: E/AndroidRuntime(1851): ... 25 more

06-17 02:28:54.619: I/Process(1851): Sending signal. PID: 1851 SIG: 9


正在回答

8 回答

由于每个人的SDK的版本可能不一致,所以一定要拷贝自己SDK目录下:extra/android/support/v7/recyclerview/libs/android-support-v7-recyclerview.jar ,不要随意下载一个使用,如果eclipse版本过低没有该文件,建议升级adt或者使用android studio。

0 回复 有任何疑惑可以回复我~
#1

qq_叶总会_0

都是22.2的support library里的lib和jar包 照样不行
2015-06-24 回复 有任何疑惑可以回复我~
#2

mox113

一样的呀... 还是上面那个错...
2015-09-25 回复 有任何疑惑可以回复我~

应该是得把recyclerview这个工程作为library导入吧,只拷贝jar貌似就是不行

0 回复 有任何疑惑可以回复我~

怎么解决的??

0 回复 有任何疑惑可以回复我~

我是用的eclipse,可以通过这个解决http://blog.csdn.net/u010351494/article/details/47022601

7 回复 有任何疑惑可以回复我~
#1

Summer500

谢谢,正解
2015-08-12 回复 有任何疑惑可以回复我~

就是 直接下载最新的还是不行

0 回复 有任何疑惑可以回复我~

一样一样 ,不知道怎么回事

0 回复 有任何疑惑可以回复我~

导入jar包了,还是报这个异常,怎么回事?

0 回复 有任何疑惑可以回复我~

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

没有找到类,导入jar了吗

0 回复 有任何疑惑可以回复我~
#1

qq_叶总会_0

编译错误和运行时错误分得出来吗你
2015-06-24 回复 有任何疑惑可以回复我~
#2

orangesweet 回复 qq_叶总会_0

呵呵,现在的年轻人说话语气真是有礼貌
2015-06-25 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
明日之星-RecyclerView
  • 参与学习       40772    人
  • 解答问题       116    个

带领大家学习百变RecyclerView,绝对干货,告别加班不是梦

进入课程

Error inflating class android.support.v7.widget.RecyclerView

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信