AutoCompleteTextView crashes on OS kitkat and below , i have attached the xml and the exception logs
<AutoCompleteTextView
android:id="#+id/auto_complete_text"
android:layout_width="70dp"
android:layout_height="30dp"
android:layout_margin="#dimen/eight_dp"
android:layout_marginLeft="#dimen/eight_dp"
android:layout_marginStart="#dimen/eight_dp"
android:layout_marginTop="#dimen/eight_dp"/>
Here is my log :
exception logs android.view.InflateException: Binary XML file line #26: Error inflating class AutoCompleteTextView at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:719) at android.view.LayoutInflater.rInflate(LayoutInflater.java:761) at android.view.LayoutInflater.rInflate(LayoutInflater.java:769) at android.view.LayoutInflater.inflate(LayoutInflater.java:498) at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
Related
We are seeing this crash on Firebase for few of our users during layout inflation:
Fatal Exception: java.lang.RuntimeException: Unable to resume activity {com.abc.xyz/com.abc.xyz.onboarding.activity.OnboardingActivity}: android.view.InflateException: Binary XML file line #17: Binary XML file line #17: Error inflating class <unknown>
Caused by java.lang.NullPointerException: Attempt to read from field 'androidx.viewpager2.widget.FakeDrag androidx.viewpager2.widget.ViewPager2.mFakeDragger' on a null object reference
at androidx.viewpager2.widget.ViewPager2.fakeDragBy(ViewPager2.java:735)
at androidx.viewpager2.widget.ViewPager2$PageAwareAccessibilityProvider.updatePageAccessibilityActions(ViewPager2.java:1494)
at androidx.viewpager2.widget.ViewPager2$PageAwareAccessibilityProvider.onSetOrientation(ViewPager2.java:1408)
at androidx.viewpager2.widget.ViewPager2.setOrientation(ViewPager2.java:569)
at androidx.viewpager2.widget.ViewPager2.setOrientation(ViewPager2.java:297)
at androidx.viewpager2.widget.ViewPager2.initialize(ViewPager2.java:190)
at androidx.viewpager2.widget.ViewPager2.<init>(ViewPager2.java:163)
at java.lang.reflect.Constructor.newInstance0(Constructor.java)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at android.view.LayoutInflater.createView(LayoutInflater.java:652)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:800)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:740)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:873)
We are not using FakeDrag ourself anywhere. Below is the XML code:
<androidx.viewpager2.widget.ViewPager2
android:id="#+id/welcome_screen_vp2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="-22dp"
app:layout_constraintTop_toBottomOf="#id/welcome_screen_hike_logo"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
And in Kotlin file we are just attaching Viewpager2 to the TabLayout
TabLayoutMediator(mBinding.welcomeScreenVp2TabLayout, mPager) { tab, position ->
}.attach()
Any idea what could be the reason for this crash?
We are seeing a crash Error inflating class androidx.appcompat.widget.AppCompatSpinner on the play console,but we are not able to reproduce it.
Here is my xml :
<androidx.appcompat.widget.AppCompatSpinner
android:id="#+id/spinnerState"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/xMargin_42_156"
android:layout_marginEnd="#dimen/xMargin_42_156"
android:background="#drawable/spinner_down_arrow"
android:focusableInTouchMode="true"
android:overlapAnchor="false"/>
In build.gradle
implementation 'androidx.appcompat:appcompat:1.2.0'
Logs:
Fatal Exception: java.lang.RuntimeException
Unable to start activity ComponentInfo{com.wrap/com.wrap.activities.NewIntroActivity}: android.view.InflateException: Binary XML file line #129 in com.wrap:layout/activity_new_intro: Binary XML file line #129 in com.wrap:layout/activity_new_intro: Error inflating class androidx.appcompat.widget.AppCompatSpinner
I want to use TextInputLayout inside my project, but I'm using androidX library
implementation "androidx.appcompat:appcompat:1.0.2"
/*this don't work*/
implementation "com.android.support:design:28.0.0"
This is the exception which I'm facing
android.view.InflateException: Binary XML file line #30: Binary XML file line #30: Error inflating class android.support.design.widget.TextInputLayout
Caused by: android.view.InflateException: Binary XML file line #30: Error inflating class android.support.design.widget.TextInputLayout
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.design.widget.TextInputLayout" on path: DexPathList[[zip file "/data/app/com.example
Error inflating class android.support.design.widget.TextInputLayout
Caused by: java.lang.ClassNotFoundException: Didn't find class
This error thrown when the Java Virtual Machine (JVM) tries to load a particular class and the specified class cannot be found in the classpath.
You should use
com.google.android.material.textfield.TextInputLayout
DEMO
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</com.google.android.material.textfield.TextInputLayout>
Then Clean-Rebuild-Run.
App crashes with error error inflating class com.google.android.material.bottomnavigation.BottomNavigationView when generating signed apk. Running the app with debug apk from android studio directly to device has no problem. I have migrated my project to androidX as well.
I've read some other post saying the drawable or colors might have problem so I've confirm that there are no other drawable folders (e.g. drawable-v21, drawable-v24). Im not sure why but it only happens when I generate a signed apk.
app:itemIconTint="#drawable/drawable_selector"
app:itemTextColor="#drawable/drawable_selector"
app:itemBackground="#color/primary"
but it doesn't work
line 15 error starts here:
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="#+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:menu="#menu/bottom_navigation"
android:elevation="8dp"
app:itemIconTint="#drawable/drawable_selector"
app:itemTextColor="#drawable/drawable_selector"
app:itemBackground="#color/primary"
android:background="?android:attr/windowBackground"/>
have already included this in my gradle:
implementation 'com.google.android.material:material:1.1.0-alpha06'
implementation 'androidx.appcompat:appcompat:1.1.0-alpha05'
Caused by: android.view.InflateException: Binary XML file line #15: Binary XML file line #15: Error inflating class com.google.android.material.bottomnavigation.BottomNavigationView
Caused by: android.view.InflateException: Binary XML file line #15: Error inflating class com.google.android.material.bottomnavigation.BottomNavigationView
Caused by: java.lang.reflect.InvocationTargetException
I am trying to display an AlertDialog but I am getting below error because of the TextView (code is given below). The dialog works fine when I comment out this TextView code.
Here's the TextView code,
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter OTP"
android:textSize="20dp"
android:padding="#dimen/min_padding"/>
Here's the Logcat error,
android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class TextView
Caused by: android.view.InflateException: Binary XML file line #0: Error inflating class TextView
Caused by: java.lang.UnsupportedOperationException: Can't convert value at index 14 to dimension: type=0x4
Check the value of min_padding
You should create dimens.xml in the values folder .And min_padding has value .
Like this .
<resources>
<dimen name="min_padding">10dp</dimen>
</resources>
Id is missing in textView
I think you are not accessing valid id
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter OTP"
android:textSize="20dp"
android:id="#+id/textview"
android:padding="5dp"/>