0

I put an application on Play Store and I received a Crash report that I'm having an hard time to reproduce.

It comes from a V858 (hwu8160) device running Android 2.2. The exception it raised is the following:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mariosangiorgio.FutsalCoach/com.mariosangiorgio.FutsalCoach.FutsalCoachActivity}: android.view.InflateException: Binary XML file line #10: Error inflating class <unknown>
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
at android.app.ActivityThread.access$2300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #10: Error inflating class <unknown>
at android.view.LayoutInflater.createView(LayoutInflater.java:513)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:201)
at android.app.Activity.setContentView(Activity.java:1647)
at com.mariosangiorgio.FutsalCoach.FutsalCoachActivity.onCreate(FutsalCoachActivity.java:89)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
... 11 more
Caused by: java.lang.reflect.InvocationTargetException
at android.widget.TextView.<init>(TextView.java:352)
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
at android.view.LayoutInflater.createView(LayoutInflater.java:500)
... 22 more
Caused by: java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x1
at android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:463)
at android.widget.TextView.<init>(TextView.java:677)
... 26 more

I setup an emulator running Android 2.2 but I cannot reproduce the issue. Do you have any suggestion about what I should to in order to find the cause of the error and fix it?

This is what I have in the activity layout file at line 10:

<TextView
    android:id="@+id/match_timer"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="20dp"
    android:text="@string/default_time"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:textSize="@dimen/bigClockFontSize"
    android:singleLine="true" />

It seems that for some reason the device is not loading the @dimen/bigClockFontSize value. I managed to trigger the error in the emulator by removing the value from res/values/dimens.xml.

The device presenting the error is using the italian locale and the device has a small screen. I have the following resources files:

values/dimens.xml
values/strings.xml
values/styles.xml
values-it/strings.xml
values-normal-hdpi/dimens.xml
values-normal-xxhdpi/dimens.xml

I assume that the device should resolve the values/dimes.xml file. Does it do that?

mariosangiorgio
  • 5,520
  • 4
  • 32
  • 46
  • I found this resource that may be useful: http://stackoverflow.com/questions/2605999/android-how-to-track-down-the-origin-of-a-inflateexception?lq=1 – mariosangiorgio Nov 20 '13 at 12:58

1 Answers1

1

Try these links:

Android View inflateException

android.view.InflateException: Binary XML file line #30: Error inflating class <unknown>

android.view.InflateException: Binary XML file line #12: Error inflating class <unknown>

Hope you find your answer from here.

Community
  • 1
  • 1
Chintan Soni
  • 24,761
  • 25
  • 106
  • 174