InflateException:二进制XML文件行:错误输出类<unknown> </unknown>

时间:2013-05-01 14:17:40

标签: android android-layout

我有一个可怕的时间,这个错误只发生在一个特定的手机LG E405,有Android版本2.3.6。该应用程序适用于所有其他设备和模拟器。在其他情况下建议的所有解决方案都不适用于我的。

05-01 14:10:31.549: W/dalvikvm(3060): threadid=1: thread exiting with uncaught exception (group=0x401ff560)
05-01 14:10:31.569: E/AndroidRuntime(3060): FATAL EXCEPTION: main
05-01 14:10:31.569: E/AndroidRuntime(3060): java.lang.RuntimeException: Unable to start activity ComponentInfo{mf.sgh.activity/mf.sgh.activity.LoginScreenActivity}: android.view.InflateException: Binary XML file line #29: Error inflating class 
05-01 14:10:31.569: E/AndroidRuntime(3060):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1658)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1674)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:942)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at android.os.Handler.dispatchMessage(Handler.java:99)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at android.os.Looper.loop(Looper.java:130)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at android.app.ActivityThread.main(ActivityThread.java:3735)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at java.lang.reflect.Method.invokeNative(Native Method)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at java.lang.reflect.Method.invoke(Method.java:507)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:662)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at dalvik.system.NativeStart.main(Native Method)
05-01 14:10:31.569: E/AndroidRuntime(3060): Caused by: android.view.InflateException: Binary XML file line #29: Error inflating class 
05-01 14:10:31.569: E/AndroidRuntime(3060):     at android.view.LayoutInflater.createView(LayoutInflater.java:518)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:2240)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:2295)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:203)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at android.app.Activity.setContentView(Activity.java:1657)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at mf.sgh.activity.LoginScreenActivity.onCreate(LoginScreenActivity.java:40)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1622)
05-01 14:10:31.569: E/AndroidRuntime(3060):     ... 11 more
05-01 14:10:31.569: E/AndroidRuntime(3060): Caused by: java.lang.reflect.InvocationTargetException
05-01 14:10:31.569: E/AndroidRuntime(3060):     at java.lang.reflect.Constructor.constructNative(Native Method)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at android.view.LayoutInflater.createView(LayoutInflater.java:505)
05-01 14:10:31.569: E/AndroidRuntime(3060):     ... 25 more
05-01 14:10:31.569: E/AndroidRuntime(3060): Caused by: java.lang.StringIndexOutOfBoundsException
05-01 14:10:31.569: E/AndroidRuntime(3060):     at java.lang.String.substring(String.java:1651)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at android.provider.Settings$System.getSystemLocaleR2L(Settings.java:884)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at android.provider.Settings$System.getCursorDirection(Settings.java:878)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at android.widget.TextView.getImeWritingLanguageR2L(TextView.java:1045)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at android.widget.TextView.chkCurrentDirection(TextView.java:1031)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at android.widget.TextView.setPadding(TextView.java:1751)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at android.view.View.(View.java:2264)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at android.widget.TextView.(TextView.java:390)
05-01 14:10:31.569: E/AndroidRuntime(3060):     at android.widget.TextView.(TextView.java:383)
05-01 14:10:31.569: E/AndroidRuntime(3060):     ... 28 more
05-01 14:10:31.579: E/AndroidRuntime(3060): [Blue Error Handler] Make Debugging Report file for main
05-01 14:10:31.579: E/AndroidRuntime(3060): java.lang.RuntimeException: Unable to start activity ComponentInfo{mf.sgh.activity/mf.sgh.activity.LoginScreenActivity}: android.view.InflateException: Binary XML file line #29: Error inflating class 
05-01 14:10:31.579: E/AndroidRuntime(3060):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1658)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1674)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:942)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at android.os.Handler.dispatchMessage(Handler.java:99)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at android.os.Looper.loop(Looper.java:130)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at android.app.ActivityThread.main(ActivityThread.java:3735)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at java.lang.reflect.Method.invokeNative(Native Method)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at java.lang.reflect.Method.invoke(Method.java:507)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:662)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at dalvik.system.NativeStart.main(Native Method)
05-01 14:10:31.579: E/AndroidRuntime(3060): Caused by: android.view.InflateException: Binary XML file line #29: Error inflating class 
05-01 14:10:31.579: E/AndroidRuntime(3060):     at android.view.LayoutInflater.createView(LayoutInflater.java:518)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:2240)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:2295)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:203)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at android.app.Activity.setContentView(Activity.java:1657)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at mf.sgh.activity.LoginScreenActivity.onCreate(LoginScreenActivity.java:40)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1622)
05-01 14:10:31.579: E/AndroidRuntime(3060):     ... 11 more
05-01 14:10:31.579: E/AndroidRuntime(3060): Caused by: java.lang.reflect.InvocationTargetException
05-01 14:10:31.579: E/AndroidRuntime(3060):     at java.lang.reflect.Constructor.constructNative(Native Method)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at android.view.LayoutInflater.createView(LayoutInflater.java:505)
05-01 14:10:31.579: E/AndroidRuntime(3060):     ... 25 more
05-01 14:10:31.579: E/AndroidRuntime(3060): Caused by: java.lang.StringIndexOutOfBoundsException
05-01 14:10:31.579: E/AndroidRuntime(3060):     at java.lang.String.substring(String.java:1651)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at android.provider.Settings$System.getSystemLocaleR2L(Settings.java:884)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at android.provider.Settings$System.getCursorDirection(Settings.java:878)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at android.widget.TextView.getImeWritingLanguageR2L(TextView.java:1045)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at android.widget.TextView.chkCurrentDirection(TextView.java:1031)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at android.widget.TextView.setPadding(TextView.java:1751)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at android.view.View.(View.java:2264)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at android.widget.TextView.(TextView.java:390)
05-01 14:10:31.579: E/AndroidRuntime(3060):     at android.widget.TextView.(TextView.java:383)
05-01 14:10:31.579: E/AndroidRuntime(3060):     ... 28 more

我真的需要帮助

2 个答案:

答案 0 :(得分:0)

建议:xml可能无法加载由于内存超出内存而无法在运行时对xml进行充气的图像。减小图像的大小。

答案 1 :(得分:0)

解决方案是首先确保所有字符串都是默认语言,然后再在语言环境文件中输入它们。