android.view.InflateException: Binary XML file line (which doesn't exist)
up vote
0
down vote
favorite
I have this layout:
<?xml version="1.0" encoding="utf-8"?>
<merge>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/has_selected_account"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/account_display_name"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/account_menu_name_and_display_vertical_padding"
android:layout_marginBottom="@dimen/account_menu_name_and_display_vertical_padding"
app:layout_constraintBottom_toTopOf="@+id/account_name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:text="DisplayNameIsLongSoItShouldBeTruncatedAtSomePoint"/>
<TextView
android:id="@+id/account_name"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/account_menu_name_and_display_vertical_padding"
android:layout_marginBottom="@dimen/account_menu_name_and_display_vertical_padding"
android:includeFontPadding="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/account_display_name"
tools:text="emailisverylongaswellwewantittogettruncated@gmail.longdomain.com"/>
</android.support.constraint.ConstraintLayout>
</merge>
And I get a very general inflation error:
Caused by: android.view.InflateException: Binary XML file line #39: Error inflating class com.me.AccountParticle
at android.view.LayoutInflater.createView(Layo
(Cut like this)
I have tried to simplify my XML. How can I tackle the inflation error?
Plus my layout XML doesn't have like #39
so where does this refer to?
android layout android-constraintlayout layout-inflater
add a comment |
up vote
0
down vote
favorite
I have this layout:
<?xml version="1.0" encoding="utf-8"?>
<merge>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/has_selected_account"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/account_display_name"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/account_menu_name_and_display_vertical_padding"
android:layout_marginBottom="@dimen/account_menu_name_and_display_vertical_padding"
app:layout_constraintBottom_toTopOf="@+id/account_name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:text="DisplayNameIsLongSoItShouldBeTruncatedAtSomePoint"/>
<TextView
android:id="@+id/account_name"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/account_menu_name_and_display_vertical_padding"
android:layout_marginBottom="@dimen/account_menu_name_and_display_vertical_padding"
android:includeFontPadding="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/account_display_name"
tools:text="emailisverylongaswellwewantittogettruncated@gmail.longdomain.com"/>
</android.support.constraint.ConstraintLayout>
</merge>
And I get a very general inflation error:
Caused by: android.view.InflateException: Binary XML file line #39: Error inflating class com.me.AccountParticle
at android.view.LayoutInflater.createView(Layo
(Cut like this)
I have tried to simplify my XML. How can I tackle the inflation error?
Plus my layout XML doesn't have like #39
so where does this refer to?
android layout android-constraintlayout layout-inflater
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have this layout:
<?xml version="1.0" encoding="utf-8"?>
<merge>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/has_selected_account"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/account_display_name"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/account_menu_name_and_display_vertical_padding"
android:layout_marginBottom="@dimen/account_menu_name_and_display_vertical_padding"
app:layout_constraintBottom_toTopOf="@+id/account_name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:text="DisplayNameIsLongSoItShouldBeTruncatedAtSomePoint"/>
<TextView
android:id="@+id/account_name"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/account_menu_name_and_display_vertical_padding"
android:layout_marginBottom="@dimen/account_menu_name_and_display_vertical_padding"
android:includeFontPadding="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/account_display_name"
tools:text="emailisverylongaswellwewantittogettruncated@gmail.longdomain.com"/>
</android.support.constraint.ConstraintLayout>
</merge>
And I get a very general inflation error:
Caused by: android.view.InflateException: Binary XML file line #39: Error inflating class com.me.AccountParticle
at android.view.LayoutInflater.createView(Layo
(Cut like this)
I have tried to simplify my XML. How can I tackle the inflation error?
Plus my layout XML doesn't have like #39
so where does this refer to?
android layout android-constraintlayout layout-inflater
I have this layout:
<?xml version="1.0" encoding="utf-8"?>
<merge>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/has_selected_account"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/account_display_name"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/account_menu_name_and_display_vertical_padding"
android:layout_marginBottom="@dimen/account_menu_name_and_display_vertical_padding"
app:layout_constraintBottom_toTopOf="@+id/account_name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:text="DisplayNameIsLongSoItShouldBeTruncatedAtSomePoint"/>
<TextView
android:id="@+id/account_name"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/account_menu_name_and_display_vertical_padding"
android:layout_marginBottom="@dimen/account_menu_name_and_display_vertical_padding"
android:includeFontPadding="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/account_display_name"
tools:text="emailisverylongaswellwewantittogettruncated@gmail.longdomain.com"/>
</android.support.constraint.ConstraintLayout>
</merge>
And I get a very general inflation error:
Caused by: android.view.InflateException: Binary XML file line #39: Error inflating class com.me.AccountParticle
at android.view.LayoutInflater.createView(Layo
(Cut like this)
I have tried to simplify my XML. How can I tackle the inflation error?
Plus my layout XML doesn't have like #39
so where does this refer to?
android layout android-constraintlayout layout-inflater
android layout android-constraintlayout layout-inflater
edited Nov 11 at 11:25
Zoe
10.6k73575
10.6k73575
asked Nov 11 at 11:12
Elad Benda
12.6k58179332
12.6k58179332
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
You're missing android:layout_height
for both TextView
, that's how you get view inflation error. When the view is being inflated, it needs to resolve the merge
tag possibly by another class or method, which seems to have a different way of parsing errors. Otherwise you would have seen a clearer error with android:layout_height
being missing.
how could i have debugged it?
– Elad Benda
Nov 11 at 11:24
It could have shown you a clearer error, but because ofmerge
tag it can become unclear when it is delegated to whichever the class is parsing it.
– Aaron
Nov 11 at 11:32
so i could just paste the xml instead of using the merge.
– Elad Benda
Nov 11 at 11:40
Using merge is one way to optimize your views, and so it's fine using merge. I think the IDE or Android Studio should have given you the warnings when missing one of the important attributes. Maybe there's a plugin for it, but whenever there's a view inflation error, chances are it's within the XML layouts.
– Aaron
Nov 11 at 11:43
add a comment |
up vote
0
down vote
Please use this.
<?xml version="1.0" encoding="utf-8"?>
<merge>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/has_selected_account"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/account_display_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/account_menu_name_and_display_vertical_padding"
android:layout_marginBottom="@dimen/account_menu_name_and_display_vertical_padding"
app:layout_constraintBottom_toTopOf="@+id/account_name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:text="DisplayNameIsLongSoItShouldBeTruncatedAtSomePoint"/>
<TextView
android:id="@+id/account_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/account_menu_name_and_display_vertical_padding"
android:layout_marginBottom="@dimen/account_menu_name_and_display_vertical_padding"
android:includeFontPadding="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/account_display_name"
tools:text="emailisverylongaswellwewantittogettruncated@gmail.longdomain.com"/>
</android.support.constraint.ConstraintLayout>
</merge>
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
You're missing android:layout_height
for both TextView
, that's how you get view inflation error. When the view is being inflated, it needs to resolve the merge
tag possibly by another class or method, which seems to have a different way of parsing errors. Otherwise you would have seen a clearer error with android:layout_height
being missing.
how could i have debugged it?
– Elad Benda
Nov 11 at 11:24
It could have shown you a clearer error, but because ofmerge
tag it can become unclear when it is delegated to whichever the class is parsing it.
– Aaron
Nov 11 at 11:32
so i could just paste the xml instead of using the merge.
– Elad Benda
Nov 11 at 11:40
Using merge is one way to optimize your views, and so it's fine using merge. I think the IDE or Android Studio should have given you the warnings when missing one of the important attributes. Maybe there's a plugin for it, but whenever there's a view inflation error, chances are it's within the XML layouts.
– Aaron
Nov 11 at 11:43
add a comment |
up vote
2
down vote
accepted
You're missing android:layout_height
for both TextView
, that's how you get view inflation error. When the view is being inflated, it needs to resolve the merge
tag possibly by another class or method, which seems to have a different way of parsing errors. Otherwise you would have seen a clearer error with android:layout_height
being missing.
how could i have debugged it?
– Elad Benda
Nov 11 at 11:24
It could have shown you a clearer error, but because ofmerge
tag it can become unclear when it is delegated to whichever the class is parsing it.
– Aaron
Nov 11 at 11:32
so i could just paste the xml instead of using the merge.
– Elad Benda
Nov 11 at 11:40
Using merge is one way to optimize your views, and so it's fine using merge. I think the IDE or Android Studio should have given you the warnings when missing one of the important attributes. Maybe there's a plugin for it, but whenever there's a view inflation error, chances are it's within the XML layouts.
– Aaron
Nov 11 at 11:43
add a comment |
up vote
2
down vote
accepted
up vote
2
down vote
accepted
You're missing android:layout_height
for both TextView
, that's how you get view inflation error. When the view is being inflated, it needs to resolve the merge
tag possibly by another class or method, which seems to have a different way of parsing errors. Otherwise you would have seen a clearer error with android:layout_height
being missing.
You're missing android:layout_height
for both TextView
, that's how you get view inflation error. When the view is being inflated, it needs to resolve the merge
tag possibly by another class or method, which seems to have a different way of parsing errors. Otherwise you would have seen a clearer error with android:layout_height
being missing.
edited Nov 11 at 11:38
answered Nov 11 at 11:18
Aaron
1,6151212
1,6151212
how could i have debugged it?
– Elad Benda
Nov 11 at 11:24
It could have shown you a clearer error, but because ofmerge
tag it can become unclear when it is delegated to whichever the class is parsing it.
– Aaron
Nov 11 at 11:32
so i could just paste the xml instead of using the merge.
– Elad Benda
Nov 11 at 11:40
Using merge is one way to optimize your views, and so it's fine using merge. I think the IDE or Android Studio should have given you the warnings when missing one of the important attributes. Maybe there's a plugin for it, but whenever there's a view inflation error, chances are it's within the XML layouts.
– Aaron
Nov 11 at 11:43
add a comment |
how could i have debugged it?
– Elad Benda
Nov 11 at 11:24
It could have shown you a clearer error, but because ofmerge
tag it can become unclear when it is delegated to whichever the class is parsing it.
– Aaron
Nov 11 at 11:32
so i could just paste the xml instead of using the merge.
– Elad Benda
Nov 11 at 11:40
Using merge is one way to optimize your views, and so it's fine using merge. I think the IDE or Android Studio should have given you the warnings when missing one of the important attributes. Maybe there's a plugin for it, but whenever there's a view inflation error, chances are it's within the XML layouts.
– Aaron
Nov 11 at 11:43
how could i have debugged it?
– Elad Benda
Nov 11 at 11:24
how could i have debugged it?
– Elad Benda
Nov 11 at 11:24
It could have shown you a clearer error, but because of
merge
tag it can become unclear when it is delegated to whichever the class is parsing it.– Aaron
Nov 11 at 11:32
It could have shown you a clearer error, but because of
merge
tag it can become unclear when it is delegated to whichever the class is parsing it.– Aaron
Nov 11 at 11:32
so i could just paste the xml instead of using the merge.
– Elad Benda
Nov 11 at 11:40
so i could just paste the xml instead of using the merge.
– Elad Benda
Nov 11 at 11:40
Using merge is one way to optimize your views, and so it's fine using merge. I think the IDE or Android Studio should have given you the warnings when missing one of the important attributes. Maybe there's a plugin for it, but whenever there's a view inflation error, chances are it's within the XML layouts.
– Aaron
Nov 11 at 11:43
Using merge is one way to optimize your views, and so it's fine using merge. I think the IDE or Android Studio should have given you the warnings when missing one of the important attributes. Maybe there's a plugin for it, but whenever there's a view inflation error, chances are it's within the XML layouts.
– Aaron
Nov 11 at 11:43
add a comment |
up vote
0
down vote
Please use this.
<?xml version="1.0" encoding="utf-8"?>
<merge>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/has_selected_account"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/account_display_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/account_menu_name_and_display_vertical_padding"
android:layout_marginBottom="@dimen/account_menu_name_and_display_vertical_padding"
app:layout_constraintBottom_toTopOf="@+id/account_name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:text="DisplayNameIsLongSoItShouldBeTruncatedAtSomePoint"/>
<TextView
android:id="@+id/account_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/account_menu_name_and_display_vertical_padding"
android:layout_marginBottom="@dimen/account_menu_name_and_display_vertical_padding"
android:includeFontPadding="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/account_display_name"
tools:text="emailisverylongaswellwewantittogettruncated@gmail.longdomain.com"/>
</android.support.constraint.ConstraintLayout>
</merge>
add a comment |
up vote
0
down vote
Please use this.
<?xml version="1.0" encoding="utf-8"?>
<merge>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/has_selected_account"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/account_display_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/account_menu_name_and_display_vertical_padding"
android:layout_marginBottom="@dimen/account_menu_name_and_display_vertical_padding"
app:layout_constraintBottom_toTopOf="@+id/account_name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:text="DisplayNameIsLongSoItShouldBeTruncatedAtSomePoint"/>
<TextView
android:id="@+id/account_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/account_menu_name_and_display_vertical_padding"
android:layout_marginBottom="@dimen/account_menu_name_and_display_vertical_padding"
android:includeFontPadding="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/account_display_name"
tools:text="emailisverylongaswellwewantittogettruncated@gmail.longdomain.com"/>
</android.support.constraint.ConstraintLayout>
</merge>
add a comment |
up vote
0
down vote
up vote
0
down vote
Please use this.
<?xml version="1.0" encoding="utf-8"?>
<merge>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/has_selected_account"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/account_display_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/account_menu_name_and_display_vertical_padding"
android:layout_marginBottom="@dimen/account_menu_name_and_display_vertical_padding"
app:layout_constraintBottom_toTopOf="@+id/account_name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:text="DisplayNameIsLongSoItShouldBeTruncatedAtSomePoint"/>
<TextView
android:id="@+id/account_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/account_menu_name_and_display_vertical_padding"
android:layout_marginBottom="@dimen/account_menu_name_and_display_vertical_padding"
android:includeFontPadding="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/account_display_name"
tools:text="emailisverylongaswellwewantittogettruncated@gmail.longdomain.com"/>
</android.support.constraint.ConstraintLayout>
</merge>
Please use this.
<?xml version="1.0" encoding="utf-8"?>
<merge>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/has_selected_account"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/account_display_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/account_menu_name_and_display_vertical_padding"
android:layout_marginBottom="@dimen/account_menu_name_and_display_vertical_padding"
app:layout_constraintBottom_toTopOf="@+id/account_name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:text="DisplayNameIsLongSoItShouldBeTruncatedAtSomePoint"/>
<TextView
android:id="@+id/account_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/account_menu_name_and_display_vertical_padding"
android:layout_marginBottom="@dimen/account_menu_name_and_display_vertical_padding"
android:includeFontPadding="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/account_display_name"
tools:text="emailisverylongaswellwewantittogettruncated@gmail.longdomain.com"/>
</android.support.constraint.ConstraintLayout>
</merge>
answered Nov 11 at 11:23
Vishal Sharma
7702212
7702212
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53248143%2fandroid-view-inflateexception-binary-xml-file-line-which-doesnt-exist%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown