crashing on com.google.android.material.textfield.TextInputLayout
nityanandTTL opened this issue · 9 comments
Error inflating class com.google.android.material.textfield.TextInputLayout
Caused by: android.view.InflateException: Binary XML file line #45 in
getting this issue after integration, please help here
Error inflating class com.google.android.material.textfield.TextInputLayout
Caused by: android.view.InflateException: Binary XML file line #45 in
Could you at least provide the full stacktrace?
Hi,
facing challenge with
<com.google.android.material.textfield.TextInputLayout
adding fullstacktrace below,
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.thyrocare.btechapp, PID: 15476
android.view.InflateException: Binary XML file line #45 in com.thyrocare.btechapp:layout/validate_otp_dialog: Binary XML file line #45 in com.thyrocare.btechapp:layout/validate_otp_dialog: Error inflating class com.google.android.material.textfield.TextInputLayout
Caused by: android.view.InflateException: Binary XML file line #45 in com.thyrocare.btechapp:layout/validate_otp_dialog: Error inflating class com.google.android.material.textfield.TextInputLayout
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at android.view.LayoutInflater.createView(LayoutInflater.java:858)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1010)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:965)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1127)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1130)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1130)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1130)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088)
at android.view.LayoutInflater.inflate(LayoutInflater.java:686)
at android.view.LayoutInflater.inflate(LayoutInflater.java:538)
at android.view.LayoutInflater.inflate(LayoutInflater.java:485)
at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:461)
at android.app.Dialog.setContentView(Dialog.java:574)
at com.thyrocare.btechapp.NewScreenDesigns.Activities.StartAndArriveActivity.ShowDialogToVerifyOTP(StartAndArriveActivity.java:940)
at com.thyrocare.btechapp.NewScreenDesigns.Activities.StartAndArriveActivity.access$1200(StartAndArriveActivity.java:159)
at com.thyrocare.btechapp.NewScreenDesigns.Activities.StartAndArriveActivity$13.onResponse(StartAndArriveActivity.java:918)
at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:71)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7839)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
Caused by: java.lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.MaterialComponents (or a descendant).
at com.google.android.material.internal.ThemeEnforcement.checkTheme(ThemeEnforcement.java:243)
at com.google.android.material.internal.ThemeEnforcement.checkMaterialTheme(ThemeEnforcement.java:217)
at com.google.android.material.internal.ThemeEnforcement.checkCompatibleTheme(ThemeEnforcement.java:145)
at com.google.android.material.internal.ThemeEnforcement.obtainTintedStyledAttributes(ThemeEnforcement.java:115)
at com.google.android.material.textfield.TextInputLayout.(TextInputLayout.java:460)
at com.google.android.material.textfield.TextInputLayout.(TextInputLayout.java:419)
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at android.view.LayoutInflater.createView(LayoutInflater.java:858)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1010)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:965)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1127)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1130)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1130)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1130)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088)
at android.view.LayoutInflater.inflate(LayoutInflater.java:686)
at android.view.LayoutInflater.inflate(LayoutInflater.java:538)
at android.view.LayoutInflater.inflate(LayoutInflater.java:485)
at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:461)
at android.app.Dialog.setContentView(Dialog.java:574)
at com.thyrocare.btechapp.NewScreenDesigns.Activities.StartAndArriveActivity.ShowDialogToVerifyOTP(StartAndArriveActivity.java:940)
at com.thyrocare.btechapp.NewScreenDesigns.Activities.StartAndArriveActivity.access$1200(StartAndArriveActivity.java:159)
at com.thyrocare.btechapp.NewScreenDesigns.Activities.StartAndArriveActivity$13.onResponse(StartAndArriveActivity.java:918)
at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:71)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7839)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
Caused by: java.lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.MaterialComponents
I believe we should migrate away from Material Components as this is causing more friction than benefits for the library (or have it as a compileOnly
dependency maybe 🤔).
@nityanandTTL does this crash happens consistently?
I'm facing the issue.
@nityanandTTL do you got any solution?
@wellyogui not yet, we are searching for the solution.
we are planning to replace the view.
I believe we should migrate away from Material Components as this is causing more friction than benefits for the library (or have it as a
compileOnly
dependency maybe 🤔).
I would go compileOnly
way.
I would go
compileOnly
way.
The problem I see with the compileOnly
approach are:
- We don't know if the Chucker UI is backward compatible with a previous version of MDC.
- We assume users will add a dependency on MDC regardless. So if a users don't want to use MDC, they cannot.
Could you find any solution i'm still having this issue ?
@melihkaptan We have replace the theme with
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
Updated theme -->
<style name="AppTheme" parent="Theme.MaterialComponents.Light.Bridge">
and it is worked for us.