"java.lang.RuntimeException: Unable to start activity ComponentInfo : android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.LinearLayout"
I am getting this error can anyone help me?
We'd need a little more of your output to know for sure but my bet is your layout is lacking either layout_width or layout_height. Can you please post a little more extended context for your exceptions (a few lines before, a few lines after the line you already posted) ?
Same problem i faced,
At one of my inflate view i getting "android.view.InflateException", because
i am using image of 1200x1200. I conveted it to 100x100 and now it working.
You may try removing tags like android:divider in the XML file.
Related
I found this error on my crashlytics and i don't know what the problem is.
So by just looking to the code i thought it could be something with one of the images.
So by researching i realized it could be one of these two things: I put the image in drawable-24 and it should be in drawable folder. So i checked and all the images are in the drawable folder. Then i thought it could be because i should use app:srcCompat instead of android:src. The problem is if i changed the gradle file to use this, it would affect the entire module and i would get the error : When using VectorDrawableCompat, you need to use app:srcCompat.
I try to refer to ?attr/actionBarSize in dimens.xml in two ways:
<dimen name="bottom_margin">?attr/actionBarSize</dimen>
<dimen name="bottom_margin">#attr/actionBarSize</dimen>
The first one is compiling but I get runtime error from inflanter:
RuntimeException: Unable to resume activity {pl.example/pl.example.ui.gui.MainActivity}: android.view.InflateException: Binary XML file line #12: Error inflating class <unknown>
So question is: how to refer to that value?
Next I will use this value in animator or use from code.
Actually I don't see if there is a sense to declare own dimensions if it already declared in theme, so it would be better to use ?attr/actionBarSize directly where you need that.
But if you really need it for some reason try as following:
<dimen name="bottom_margin">?actionBarSize</dimen>
The correct syntax is:
?android:attr/actionBarSize
Use it like this with android key.
android:layout_width="?android:actionBarSize"
after any search document i like this link to set font with custom layout for actionbar. but after use this tutorials i get an error as this:
FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.kol.app/ ... }: android.view.InflateException: Binary XML file line #7: Error inflating class com.kol.app.CustomTextView
i dont see any class such as CustomTextView into that link, whats exactly CustomTextView in this sample?
If you see that example you'll see <com.your.package.CustomTextView mentioned in the xml. This is the custom TextView for the Actionbar. You can have a class that extends TextView and customize it according to your needs. That's probably missing since you haven't defined it.
I am Developing an Android Application, by default it is running in English properly then i Translate it in to Welsh and Urdu by translate String file into corresponding language and placed it into values-cy and values-ur.When i run it show error message like
' 02-09 05:07:35.083: ERROR/AndroidRuntime(584): Caused by: java.lang.RuntimeException: Binary XML file line #11:'
You must supply a layout_width attribute..I studied that particular xml but it didn't noticed any problem in that line but it worked in engish properly(I used Styles/String and Theme in my resource).After that i create a new xml file with only one Textview here i gave all styles within that Tag..
.Now i locked with this problem.So please help me to solve this problem.
I think you are using custom theme. If so,call styles from theme. May be it will work.
Try it.. Happy coding :)
Hi
I am facing a problem
I want my application to pick up resources from the framework. Here is my code snippet of an xml.
For this to be achieved following changes were made in attrs.xml
and themes.xml at the framework level
#android:drawable/btn_minus_ss
The drawable btn_minus_ss.png is added to drawable-hdpi folder at the location framework/base/core/res/res/drawable-hdpi
Whenever I open the application, it crashes.
I get the following error in logs
ERROR/AndroidRuntime(3701): Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #5: tag requires a 'drawable' attribute or child tag defining a drawable
However, when I use this
android:background="?android:attr/theme_btn_minus_ss"
I don't get any error. I want to use
android:drawable
What is the cause and how can this problem be solved.
Thanks & Regards
Aviral
The error
ERROR/AndroidRuntime(3701): Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #5: tag requires a 'drawable' attribute or child tag defining a drawable
has to do with the format of your xml, you are setting something like
<item android:background="#foo-value-here" />
What the error is telling you is that it should be like this
<item android:drawable="#foo-value-here" />
i think i had the same problem, it seems to be a bug in the android eclipse-plugin. the solution is the same as for this question (close eclipse and restart it): android include tag - invalid layout reference
Also make android:drawable the first attribute of item tag - it worked for me.