Binary XML file line #31: Binary XML file line #31: Error inflating class MaskedEditText
tim-teacher opened this issue · 11 comments
Crash on Nexus 5, Android 6.0.1. I tried different attributes - the same result
Hey, I have Nexus 5X and had Nexus 5 before, so it seems I need to check your code. Could you share it with me?
Hi,
lib "ru.egslava:MaskedEditText:1.0.5"
xml code:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<br.com.sapereaude.maskedEditText.MaskedEditText
android:inputType="phone"
mask:allowed_chars="1234567890"
mask:mask="+7(###)###-##-##"
android:hint="1234567890"
app:keep_hint="true"
android:text="@={viewModel.inputPhone}" />
</LinearLayout>
No any other code.
I use bindings but I try without it and I have the same result
Thanks, let me check...
It works. Have you added:
android:layout_height="match_parent"
android:layout_width="match_parent"
To your layout?
yes,
I Use android:layout_width="match_parent"
android:layout_height="50dp"
sorry, messed copy past
What's the stack trace?
I've checked again and it works, so any additional info is very welcome.
I found error, I try add to hint "+7" instead of "7".
thanks, sorry for disturbing!
You're welcome :) Could you, please, provide the exact code with the problem?
Work:
<br.com.sapereaude.maskedEditText.MaskedEditText android:layout_width="match_parent" android:layout_height="50dp" app:allowed_chars="1234567890" app:mask="+7(###)###-##-##" android:hint="1234567890" android:inputType="phone" android:text="@={viewModel.inputPhone}" app:keep_hint="true" />
Not work:
<br.com.sapereaude.maskedEditText.MaskedEditText android:layout_width="match_parent" android:layout_height="50dp" app:allowed_chars="1234567890" app:mask="+7(###)###-##-##" android:hint="123456789" android:inputType="phone" android:text="@={viewModel.inputPhone}" app:keep_hint="true" />
As I see there is a problem in "hint",If I want to have visible at the start only county code +7 - crash
I had same issue,
Fixed by replacing:
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:mask="http://schemas.android.com/tools"
with:
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:mask="http://schemas.android.com/apk/res-auto"
Because by default Android Studio, Add first one with auto completion.