程序导入友盟微社区2.3后,运行正常,后来替换微社区2.4版本后,出现了错误如下:
03-22 13:48:53.089: E/xxxxxx(32070): get point=10
03-22 13:48:53.095: E/UmengPushImpl(32070): ### 默认的推送实现 : com.umeng.comm.push.UmengPushImpl@4152c2b0
03-22 13:48:53.097: E/com.umeng.message.UmengRegistrar(32070): isRegisteredToUmeng: empty registration id
03-22 13:48:53.200: E/com.umeng.message.UTrack(32070): RegistrationId is empty
03-22 13:48:53.221: E/com.umeng.message.UTrack(32070): RegistrationId is empty
03-22 13:48:53.281: E/push(32070): #### umeng push addAlias failed.
03-22 13:48:53.373: E/umeng_default_location(32070): ### 默认的定位实现 : com.umeng.community.location.DefaultLocationImpl@415fcd10
03-22 13:48:53.398: E/TAG(32070): onFinishInflate
03-22 13:48:54.107: E/xxxxxx(32070): get point=10
03-22 13:49:04.238: E/MtaSDK(32070): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.chinavalueline.activity/com.umeng.comm.ui.activities.FindActivity}: android.view.InflateException: Binary XML file line #81: Error inflating class com.umeng.comm.ui.imagepicker.widgets.RoundImageView
03-22 13:49:04.238: E/MtaSDK(32070): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2351)
03-22 13:49:04.238: E/MtaSDK(32070): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2403)
03-22 13:49:04.238: E/MtaSDK(32070): at android.app.ActivityThread.access$600(ActivityThread.java:165)
03-22 13:49:04.238: E/MtaSDK(32070): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1373)
03-22 13:49:04.238: E/MtaSDK(32070): at android.os.Handler.dispatchMessage(Handler.java:107)
03-22 13:49:04.238: E/MtaSDK(32070): at android.os.Looper.loop(Looper.java:194)
03-22 13:49:04.238: E/MtaSDK(32070): at android.app.ActivityThread.main(ActivityThread.java:5391)
03-22 13:49:04.238: E/MtaSDK(32070): at java.lang.reflect.Method.invokeNative(Native Method)
03-22 13:49:04.238: E/MtaSDK(32070): at java.lang.reflect.Method.invoke(Method.java:525)
03-22 13:49:04.238: E/MtaSDK(32070): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
03-22 13:49:04.238: E/MtaSDK(32070): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
03-22 13:49:04.238: E/MtaSDK(32070): at dalvik.system.NativeStart.main(Native Method)
03-22 13:49:04.238: E/MtaSDK(32070): Caused by: android.view.InflateException: Binary XML file line #81: Error inflating class com.umeng.comm.ui.imagepicker.widgets.RoundImageView
03-22 13:49:04.238: E/MtaSDK(32070): at android.view.LayoutInflater.createView(LayoutInflater.java:613)
03-22 13:49:04.238: E/MtaSDK(32070): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
03-22 13:49:04.238: E/MtaSDK(32070): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
03-22 13:49:04.238: E/MtaSDK(32070): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
03-22 13:49:04.238: E/MtaSDK(32070): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
03-22 13:49:04.238: E/MtaSDK(32070): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
03-22 13:49:04.238: E/MtaSDK(32070): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
03-22 13:49:04.238: E/MtaSDK(32070): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
03-22 13:49:04.238: E/MtaSDK(32070): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
03-22 13:49:04.238: E/MtaSDK(32070): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
03-22 13:49:04.238: E/MtaSDK(32070): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:274)
03-22 13:49:04.238: E/MtaSDK(32070): at android.app.Activity.setContentView(Activity.java:1895)
03-22 13:49:04.238: E/MtaSDK(32070): at com.umeng.comm.ui.imagepicker.activities.BaseFragmentActivity.setContentView(BaseFragmentActivity.java:111)
03-22 13:49:04.238: E/MtaSDK(32070): at com.umeng.comm.ui.activities.FindActivity.getLayout(FindActivity.java:69)
03-22 13:49:04.238: E/MtaSDK(32070): at com.umeng.comm.ui.imagepicker.activities.FindBaseActivity.onCreate(FindBaseActivity.java:50)
03-22 13:49:04.238: E/MtaSDK(32070): at com.umeng.comm.ui.activities.FindActivity.onCreate(FindActivity.java:65)
03-22 13:49:04.238: E/MtaSDK(32070): at android.app.Activity.performCreate(Activity.java:5176)
03-22 13:49:04.238: E/MtaSDK(32070): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1146)
03-22 13:49:04.238: E/MtaSDK(32070): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2315)
03-22 13:49:04.238: E/MtaSDK(32070): ... 11 more
03-22 13:49:04.238: E/MtaSDK(32070): Caused by: java.lang.reflect.InvocationTargetException
03-22 13:49:04.238: E/MtaSDK(32070): at java.lang.reflect.Constructor.constructNative(Native Method)
03-22 13:49:04.238: E/MtaSDK(32070): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
03-22 13:49:04.238: E/MtaSDK(32070): at android.view.LayoutInflater.createView(LayoutInflater.java:587)
03-22 13:49:04.238: E/MtaSDK(32070): ... 29 more
03-22 13:49:04.238: E/MtaSDK(32070): Caused by: java.lang.ArrayIndexOutOfBoundsException: length=408; index=414
03-22 13:49:04.238: E/MtaSDK(32070): at android.content.res.TypedArray.getColor(TypedArray.java:310)
03-22 13:49:04.238: E/MtaSDK(32070): at com.umeng.comm.ui.imagepicker.widgets.RoundImageView.<init>(RoundImageView.java:88)
03-22 13:49:04.238: E/MtaSDK(32070): ... 32 more
03-22 13:49:04.275: E/AndroidRuntime(32070): FATAL EXCEPTION: main
03-22 13:49:04.275: E/AndroidRuntime(32070): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.chinavalueline.activity/com.umeng.comm.ui.activities.FindActivity}: android.view.InflateException: Binary XML file line #81: Error inflating class com.umeng.comm.ui.imagepicker.widgets.RoundImageView
03-22 13:49:04.275: E/AndroidRuntime(32070): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2351)
03-22 13:49:04.275: E/AndroidRuntime(32070): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2403)
03-22 13:49:04.275: E/AndroidRuntime(32070): at android.app.ActivityThread.access$600(ActivityThread.java:165)
03-22 13:49:04.275: E/AndroidRuntime(32070): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1373)
03-22 13:49:04.275: E/AndroidRuntime(32070): at android.os.Handler.dispatchMessage(Handler.java:107)
03-22 13:49:04.275: E/AndroidRuntime(32070): at android.os.Looper.loop(Looper.java:194)
03-22 13:49:04.275: E/AndroidRuntime(32070): at android.app.ActivityThread.main(ActivityThread.java:5391)
03-22 13:49:04.275: E/AndroidRuntime(32070): at java.lang.reflect.Method.invokeNative(Native Method)
03-22 13:49:04.275: E/AndroidRuntime(32070): at java.lang.reflect.Method.invoke(Method.java:525)
03-22 13:49:04.275: E/AndroidRuntime(32070): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
03-22 13:49:04.275: E/AndroidRuntime(32070): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
03-22 13:49:04.275: E/AndroidRuntime(32070): at dalvik.system.NativeStart.main(Native Method)
03-22 13:49:04.275: E/AndroidRuntime(32070): Caused by: android.view.InflateException: Binary XML file line #81: Error inflating class com.umeng.comm.ui.imagepicker.widgets.RoundImageView
03-22 13:49:04.275: E/AndroidRuntime(32070): at android.view.LayoutInflater.createView(LayoutInflater.java:613)
03-22 13:49:04.275: E/AndroidRuntime(32070): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
03-22 13:49:04.275: E/AndroidRuntime(32070): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
03-22 13:49:04.275: E/AndroidRuntime(32070): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
03-22 13:49:04.275: E/AndroidRuntime(32070): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
03-22 13:49:04.275: E/AndroidRuntime(32070): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
03-22 13:49:04.275: E/AndroidRuntime(32070): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
03-22 13:49:04.275: E/AndroidRuntime(32070): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
03-22 13:49:04.275: E/AndroidRuntime(32070): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
03-22 13:49:04.275: E/AndroidRuntime(32070): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
03-22 13:49:04.275: E/AndroidRuntime(32070): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:274)
03-22 13:49:04.275: E/AndroidRuntime(32070): at android.app.Activity.setContentView(Activity.java:1895)
03-22 13:49:04.275: E/AndroidRuntime(32070): at com.umeng.comm.ui.imagepicker.activities.BaseFragmentActivity.setContentView(BaseFragmentActivity.java:111)
03-22 13:49:04.275: E/AndroidRuntime(32070): at com.umeng.comm.ui.activities.FindActivity.getLayout(FindActivity.java:69)
03-22 13:49:04.275: E/AndroidRuntime(32070): at com.umeng.comm.ui.imagepicker.activities.FindBaseActivity.onCreate(FindBaseActivity.java:50)
03-22 13:49:04.275: E/AndroidRuntime(32070): at com.umeng.comm.ui.activities.FindActivity.onCreate(FindActivity.java:65)
03-22 13:49:04.275: E/AndroidRuntime(32070): at android.app.Activity.performCreate(Activity.java:5176)
03-22 13:49:04.275: E/AndroidRuntime(32070): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1146)
03-22 13:49:04.275: E/AndroidRuntime(32070): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2315)
03-22 13:49:04.275: E/AndroidRuntime(32070): ... 11 more
03-22 13:49:04.275: E/AndroidRuntime(32070): Caused by: java.lang.reflect.InvocationTargetException
03-22 13:49:04.275: E/AndroidRuntime(32070): at java.lang.reflect.Constructor.constructNative(Native Method)
03-22 13:49:04.275: E/AndroidRuntime(32070): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
03-22 13:49:04.275: E/AndroidRuntime(32070): at android.view.LayoutInflater.createView(LayoutInflater.java:587)
03-22 13:49:04.275: E/AndroidRuntime(32070): ... 29 more
03-22 13:49:04.275: E/AndroidRuntime(32070): Caused by: java.lang.ArrayIndexOutOfBoundsException: length=408; index=414
03-22 13:49:04.275: E/AndroidRuntime(32070): at android.content.res.TypedArray.getColor(TypedArray.java:310)
03-22 13:49:04.275: E/AndroidRuntime(32070): at com.umeng.comm.ui.imagepicker.widgets.RoundImageView.<init>(RoundImageView.java:88)
03-22 13:49:04.275: E/AndroidRuntime(32070): ... 32 more
这是一个什么错误?
android.view.InflateException: Binary XML file line #81: Error inflating class com.umeng.comm.ui.imagepicker.widgets.RoundImageView
自定义控件注入失败。经过一番折腾,终于找到了原因
value文件下的attrs.xml文件中
<declare-styleable name="RotateImageView">
<attr name="angle" format="integer" />
</declare-styleable>
多了 一个这个,估计是导入微社区2.3留存的,与2.4版本有冲突,导致自定义控件RoundImageView没有正确加载,而导致了上面的错误。
把这三行去掉后,在运行,程序终于跑起来了。