eclipse Binary XML file line #7: Error inflating class android.support.v7.widget.RecyclerView
eclipse 下使用RecyclerView 出錯
Binary XML file line #7: Error inflating class android.support.v7.widget.RecyclerView
下載我上傳的資源下的recyclerview-v7-21.0.0.jar (此jar包剛上傳,估計需要稽核,還沒有連結,所以沒有貼出連結,可執行在我的資源中查詢,過兩天我會貼出連結)即可解決此問題。或者按下面的解決方式
試了很多方法都不行,整了半天,終於搞定,原來在eclipse中使用RecyclerView只能匯入API21.0.0中的包才可以使用。
解決辦法:進入sdk\extras\android\m2repository\com\android\support\recyclerview-v7\21.0.0
http://www.myexception.cn/xml-soap/1971343.html
01-06 09:25:04.582: D/AndroidRuntime(3686): Shutting down VM
01-06 09:25:04.583: E/AndroidRuntime(3686): FATAL EXCEPTION: main
01-06 09:25:04.583: E/AndroidRuntime(3686): Process: com.goach.client, PID: 3686
01-06 09:25:04.583: E/AndroidRuntime(3686): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.goach.client/com.goach.client.ui.activity.NewsActivity}: android.view.InflateException: Binary XML file line #6: Error inflating class android.support.v7.widget.RecyclerView
01-06 09:25:04.583: E/AndroidRuntime(3686): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
01-06 09:25:04.583: E/AndroidRuntime(3686): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
01-06 09:25:04.583: E/AndroidRuntime(3686): at android.app.ActivityThread.access$800(ActivityThread.java:151)
01-06 09:25:04.583: E/AndroidRuntime(3686): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
01-06 09:25:04.583: E/AndroidRuntime(3686): at android.os.Handler.dispatchMessage(Handler.java:102)
01-06 09:25:04.583: E/AndroidRuntime(3686): at android.os.Looper.loop(Looper.java:135)
01-06 09:25:04.583: E/AndroidRuntime(3686): at android.app.ActivityThread.main(ActivityThread.java:5254)
01-06 09:25:04.583: E/AndroidRuntime(3686): at java.lang.reflect.Method.invoke(Native Method)
01-06 09:25:04.583: E/AndroidRuntime(3686): at java.lang.reflect.Method.invoke(Method.java:372)
01-06 09:25:04.583: E/AndroidRuntime(3686): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
01-06 09:25:04.583: E/AndroidRuntime(3686): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
01-06 09:25:04.583: E/AndroidRuntime(3686): Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class android.support.v7.widget.RecyclerView
01-06 09:25:04.583: E/AndroidRuntime(3686): at android.view.LayoutInflater.createView(LayoutInflater.java:633)
01-06 09:25:04.583: E/AndroidRuntime(3686): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
01-06 09:25:04.583: E/AndroidRuntime(3686): at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
01-06 09:25:04.583: E/AndroidRuntime(3686): at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
01-06 09:25:04.583: E/AndroidRuntime(3686): at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
01-06 09:25:04.583: E/AndroidRuntime(3686): at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
01-06 09:25:04.583: E/AndroidRuntime(3686): at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:276)
01-06 09:25:04.583: E/AndroidRuntime(3686): at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
01-06 09:25:04.583: E/AndroidRuntime(3686): at com.goach.client.ui.activity.BaseActivity.setContentView(BaseActivity.java:23)
01-06 09:25:04.583: E/AndroidRuntime(3686): at com.goach.client.ui.activity.NewsActivity.onCreate(NewsActivity.java:30)
01-06 09:25:04.583: E/AndroidRuntime(3686): at android.app.Activity.performCreate(Activity.java:5990)
01-06 09:25:04.583: E/AndroidRuntime(3686): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
01-06 09:25:04.583: E/AndroidRuntime(3686): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
01-06 09:25:04.583: E/AndroidRuntime(3686): ... 10 more
01-06 09:25:04.583: E/AndroidRuntime(3686): Caused by: java.lang.reflect.InvocationTargetException
01-06 09:25:04.583: E/AndroidRuntime(3686): at java.lang.reflect.Constructor.newInstance(Native Method)
01-06 09:25:04.583: E/AndroidRuntime(3686): at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
01-06 09:25:04.583: E/AndroidRuntime(3686): at android.view.LayoutInflater.createView(LayoutInflater.java:607)
01-06 09:25:04.583: E/AndroidRuntime(3686): ... 22 more
01-06 09:25:04.583: E/AndroidRuntime(3686): Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/recyclerview/R$styleable;
01-06 09:25:04.583: E/AndroidRuntime(3686): at android.support.v7.widget.RecyclerView.<init>(RecyclerView.java:487)
01-06 09:25:04.583: E/AndroidRuntime(3686): at android.support.v7.widget.RecyclerView.<init>(RecyclerView.java:456)
01-06 09:25:04.583: E/AndroidRuntime(3686): ... 25 more
01-06 09:25:04.583: E/AndroidRuntime(3686): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.recyclerview.R$styleable" on path: DexPathList[[zip file "/data/app/com.goach.client-1/base.apk"],nativeLibraryDirectories=[/vendor/lib,
/system/lib]]
01-06 09:25:04.583: E/AndroidRuntime(3686): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
01-06 09:25:04.583: E/AndroidRuntime(3686): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
01-06 09:25:04.583: E/AndroidRuntime(3686): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
01-06 09:25:04.583: E/AndroidRuntime(3686): ... 27 more
01-06 09:25:04.583: E/AndroidRuntime(3686): Suppressed: java.lang.ClassNotFoundException: android.support.v7.recyclerview.R$styleable
01-06 09:25:04.583: E/AndroidRuntime(3686): at java.lang.Class.classForName(Native Method)
01-06 09:25:04.583: E/AndroidRuntime(3686): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
01-06 09:25:04.583: E/AndroidRuntime(3686): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
01-06 09:25:04.583: E/AndroidRuntime(3686): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
01-06 09:25:04.583: E/AndroidRuntime(3686): ... 28 more
01-06 09:25:04.583: E/AndroidRuntime(3686): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available