Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 supply a layout_height attribute.
    at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:491)
    at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:3602)
    at android.view.ViewGroup$LayoutParams.<init>(ViewGroup.java:3554)
    at android.widget.AbsListView$LayoutParams.<init>(AbsListView.java:4322)
    at android.widget.AbsListView.generateLayoutParams(AbsListView.java:4116)
    at android.widget.AbsListView.generateLayoutParams(AbsListView.java:74)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
    at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:332)
    at android.widget.ArrayAdapter.getView(ArrayAdapter.java:323)
    at android.webkit.WebTextView$AutoCompleteAdapter.getView(WebTextView.java:650)
    at android.widget.AbsListView.obtainView(AbsListView.java:1430)
    at android.widget.AutoCompleteTextView$DropDownListView.obtainView(AutoCompleteTextView.java:1548)
    at android.widget.ListView.measureHeightOfChildren(ListView.java:1216)
    at android.widget.AutoCompleteTextView.buildDropDown(AutoCompleteTextView.java:1376)
    at android.widget.AutoCompleteTextView.showDropDown(AutoCompleteTextView.java:1140)
    at android.widget.AutoCompleteTextView.updateDropDownForFilter(AutoCompleteTextView.java:1022)
    at android.widget.AutoCompleteTextView.onFilterComplete(AutoCompleteTextView.java:1005)
    at android.widget.Filter$ResultsHandler.handleMessage(Filter.java:285)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:130)
    at android.app.ActivityThread.main(ActivityThread.java:3717)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
    at dalvik.system.NativeStart.main(Native Method)"

Of course I've tried to google it and found that it is most likely caused by ActionBarScherlock (and I noticed that every user who encountered with this error uses android 2.3.*) but haven't found a solution. It's a bit disconcerting that I can't reproduce this error on my own 2.3.* device...

So, what causes this error?

like image 618
janot Avatar asked Jan 25 '13 20:01

janot


1 Answers

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!

<style name="AppTheme" parent="AppBaseTheme">

I changed this to

<style name="AppTheme" parent="Theme.Sherlock">

And my problem was solved.

like image 136
Larzzz Avatar answered Dec 09 '22 15:12

Larzzz