Skip to content Skip to sidebar Skip to footer

What Causes "runtimeexception: Binary Xml File Line #20: You Must Supply A Layout_height Attribute." (actionbarscherlock Is Suspected)?

I have app with ActionBarScherlock and I use ACRA. I receive crash reports from some users with following error: 'java.lang.RuntimeException: Binary XML file line #20: You must sup

Solution 1:

In my case this was due to a problem with ActionBarsherlock.

In my Android manifest I had android:theme="@style/AppTheme" then when you go to styles, i saw my AppTheme's parent was "AppBaseTheme". This was the problem!

<stylename="AppTheme"parent="AppBaseTheme">

I changed this to

<stylename="AppTheme"parent="Theme.Sherlock">

And my problem was solved.

Solution 2:

One of our #1 crashes came from this issue, especially on ZTE devices. While the actionbar worked on most screens, we were getting this crash when users interacted with a Webview Edittext/InputBox. The crash happened as a result of autocomplete on the Webview. Disabling autocomplete seemed to eliminate the crashes. Why autocomplete should have anything to do with the Actionbar is still a mystery.

Here we disable the autocomplete just for ZTE devices. We may expand the list later if we have problems on other devices.

publicstaticbooleandisableWebViewAutoCompleteForDevicesThatCrash(WebView webView)
{
    // We may add some other bizarre devices to this list if the ZTE fix works well.if ("ZTE".equals(Build.MANUFACTURER))
    {
        webView.getSettings().setSaveFormData(false);
        webView.clearFormData();
        returntrue;
    }
    else
    {
        returnfalse;
    }
}

Solution 3:

The layout_height in this instance is defined as ?attr/actionBarSize which is a theme attribute with a value of @dimen/action_bar_height that is defined in three places: values/, values-land/, and values-sw600dp/.

This is usually cased by OEMs who've tinkered with the resource system causing some aspect of this chain to not load correctly. There's nothing we can really do, as far as I'm aware.

Solution 4:

I had same problem and solve it by change in AndroidManifest.xml. You have to set theme of particular Activity or complete application to Theme.Sherlock.Light (I think you can specify only Theme.Sherlock).

In code it will be:

<application...android:theme="@style/Theme.Sherlock.Light">

or

<activity...android:theme="@style/Theme.Sherlock.Light">

Post a Comment for "What Causes "runtimeexception: Binary Xml File Line #20: You Must Supply A Layout_height Attribute." (actionbarscherlock Is Suspected)?"