java.lang.RuntimeException: Unable to start activity ComponentInfo{com.coam.shangyun/com.coam.ui.menu.activity.CommonServiceCircleActivity}: android.view.InflateException: BinaryXMLfile line #77: Error inflating class android.support.v7.widget.RecyclerView at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2201) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2250) at android.app.ActivityThread.access$800(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1213) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5065) atjava.lang.reflect.Method.invokeNative(Native Method) atjava.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609) at dalvik.system.NativeStart.main(Native Method) Caused by: android.view.InflateException: BinaryXMLfile line #77: Error inflating class android.support.v7.widget.RecyclerView at android.view.LayoutInflater.createView(LayoutInflater.java:623) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:699) at android.view.LayoutInflater.rInflate(LayoutInflater.java:758) at android.view.LayoutInflater.rInflate(LayoutInflater.java:761) at android.view.LayoutInflater.inflate(LayoutInflater.java:495) at android.view.LayoutInflater.inflate(LayoutInflater.java:400) at android.view.LayoutInflater.inflate(LayoutInflater.java:353) at android.support.v7.app.AppCompatDelegateImplV7.a(UnknownSource) at android.support.v7.app.AppCompatActivity.setContentView(UnknownSource) at com.coam.ui.menu.activity.CommonServiceCircleActivity.onCreate(UnknownSource) at android.app.Activity.performCreate(Activity.java:5249) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2165) ... 11 more
在 proguard-rules.pro 文件下添加如下代码解决错误:
1 2 3
-keep public class*extendsandroid.support.v7.widget.RecyclerView$LayoutManager { public <init>(...); }