我正在使用Eclipse开发android项目,为我的项目集成了RecyclerView。目前我使用Recyclerview作为图书馆项目。但是当我想要包含它的android-support-v7-recyclerview.jar
时,我在运行时会收到InflateException。我已经尝试了将jar包含到项目中的所有可能性,但它们都没有工作,给出与InflateException相同的错误。
有人通过Eclipse的RecyclerView集成解决了这个问题吗?
这是我的logcat,
12-11 15:29:33.007: E/AndroidRuntime(2324): Process: com.example.recyclerviewtest, PID: 2324
12-11 15:29:33.007: E/AndroidRuntime(2324): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.recyclerviewtest/com.example.recyclerviewtest.MainActivity}: android.view.InflateException: Binary XML file line #8: Error inflating class android.support.v7.widget.RecyclerView
12-11 15:29:33.007: E/AndroidRuntime(2324): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
12-11 15:29:33.007: E/AndroidRuntime(2324): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
12-11 15:29:33.007: E/AndroidRuntime(2324): at android.app.ActivityThread.access$800(ActivityThread.java:151)
12-11 15:29:33.007: E/AndroidRuntime(2324): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
12-11 15:29:33.007: E/AndroidRuntime(2324): at android.os.Handler.dispatchMessage(Handler.java:102)
12-11 15:29:33.007: E/AndroidRuntime(2324): at android.os.Looper.loop(Looper.java:135)
12-11 15:29:33.007: E/AndroidRuntime(2324): at android.app.ActivityThread.main(ActivityThread.java:5254)
12-11 15:29:33.007: E/AndroidRuntime(2324): at java.lang.reflect.Method.invoke(Native Method)
12-11 15:29:33.007: E/AndroidRuntime(2324): at java.lang.reflect.Method.invoke(Method.java:372)
12-11 15:29:33.007: E/AndroidRuntime(2324): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
12-11 15:29:33.007: E/AndroidRuntime(2324): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
12-11 15:29:33.007: E/AndroidRuntime(2324): Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class android.support.v7.widget.RecyclerView
12-11 15:29:33.007: E/AndroidRuntime(2324): at android.view.LayoutInflater.createView(LayoutInflater.java:633)
12-11 15:29:33.007: E/AndroidRuntime(2324): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
12-11 15:29:33.007: E/AndroidRuntime(2324): at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
12-11 15:29:33.007: E/AndroidRuntime(2324): at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
12-11 15:29:33.007: E/AndroidRuntime(2324): at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
12-11 15:29:33.007: E/AndroidRuntime(2324): at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
12-11 15:29:33.007: E/AndroidRuntime(2324): at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:256)
12-11 15:29:33.007: E/AndroidRuntime(2324): at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
12-11 15:29:33.007: E/AndroidRuntime(2324): at com.example.recyclerviewtest.MainActivity.onCreate(MainActivity.java:14)
12-11 15:29:33.007: E/AndroidRuntime(2324): at android.app.Activity.performCreate(Activity.java:5990)
12-11 15:29:33.007: E/AndroidRuntime(2324): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
12-11 15:29:33.007: E/AndroidRuntime(2324): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
12-11 15:29:33.007: E/AndroidRuntime(2324): ... 10 more
12-11 15:29:33.007: E/AndroidRuntime(2324): Caused by: java.lang.reflect.InvocationTargetException
12-11 15:29:33.007: E/AndroidRuntime(2324): at java.lang.reflect.Constructor.newInstance(Native Method)
12-11 15:29:33.007: E/AndroidRuntime(2324): at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
12-11 15:29:33.007: E/AndroidRuntime(2324): at android.view.LayoutInflater.createView(LayoutInflater.java:607)
12-11 15:29:33.007: E/AndroidRuntime(2324): ... 21 more
12-11 15:29:33.007: E/AndroidRuntime(2324): Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/recyclerview/R$styleable;
12-11 15:29:33.007: E/AndroidRuntime(2324): at android.support.v7.widget.RecyclerView.<init>(RecyclerView.java:481)
12-11 15:29:33.007: E/AndroidRuntime(2324): at android.support.v7.widget.RecyclerView.<init>(RecyclerView.java:450)
12-11 15:29:33.007: E/AndroidRuntime(2324): ... 24 more
12-11 15:29:33.007: E/AndroidRuntime(2324): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.recyclerview.R$styleable" on path: DexPathList[[zip file "/data/app/com.example.recyclerviewtest-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
12-11 15:29:33.007: E/AndroidRuntime(2324): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
12-11 15:29:33.007: E/AndroidRuntime(2324): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
12-11 15:29:33.007: E/AndroidRuntime(2324): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
12-11 15:29:33.007: E/AndroidRuntime(2324): ... 26 more
12-11 15:29:33.007: E/AndroidRuntime(2324): Suppressed: java.lang.ClassNotFoundException: android.support.v7.recyclerview.R$styleable
12-11 15:29:33.007: E/AndroidRuntime(2324): at java.lang.Class.classForName(Native Method)
12-11 15:29:33.007: E/AndroidRuntime(2324): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
12-11 15:29:33.007: E/AndroidRuntime(2324): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
12-11 15:29:33.007: E/AndroidRuntime(2324): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
12-11 15:29:33.007: E/AndroidRuntime(2324): ... 27 more
12-11 15:29:33.007: E/AndroidRuntime(2324): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available