joielechong/CountryCodePicker

Error in Inflating view in some device

priyanka221 opened this issue · 12 comments

I integrate this library in my app. I t is working fine till now. but yesterday it crash in some user's device .
Device list is as below:
Xioami Redmi 5A
Xioami Redmi 3S
YuLong 3600i
Samsung Galaxy J2 Pro
And Android api version is
Android 6.0.1
Android 8.1.0

Issues that is occurs:
Caused by android.content.res.Resources$NotFoundException
Unable to find resource ID #0x7f070175

android.content.res.Resources.getResourceName (Resources.java:3740)
android.content.res.Resources.loadDrawableForCookie (Resources.java:4246)
android.content.res.Resources.loadDrawable (Resources.java:4153)
android.content.res.Resources.loadDrawable (Resources.java:3998)
android.content.res.TypedArray.getDrawable (TypedArray.java:886)
android.widget.ImageView. (ImageView.java:157)
android.widget.ImageView. (ImageView.java:145)
androidx.appcompat.widget.AppCompatImageView. (AppCompatImageView.java:72)
androidx.appcompat.widget.AppCompatImageView. (AppCompatImageView.java:68)
androidx.appcompat.app.AppCompatViewInflater.createImageView (AppCompatViewInflater.java:182)
androidx.appcompat.app.AppCompatViewInflater.createView (AppCompatViewInflater.java:106)
androidx.appcompat.app.AppCompatDelegateImpl.createView (AppCompatDelegateImpl.java:1266)
androidx.appcompat.app.AppCompatDelegateImpl.onCreateView (AppCompatDelegateImpl.java:1316)
android.view.LayoutInflater.createViewFromTag (LayoutInflater.java:758)
android.view.LayoutInflater.createViewFromTag (LayoutInflater.java:716)
android.view.LayoutInflater.rInflate (LayoutInflater.java:847)
android.view.LayoutInflater.rInflateChildren (LayoutInflater.java:810)
android.view.LayoutInflater.rInflate (LayoutInflater.java:855)
android.view.LayoutInflater.rInflateChildren (LayoutInflater.java:810)
android.view.LayoutInflater.inflate (LayoutInflater.java:527)
android.view.LayoutInflater.inflate (LayoutInflater.java:429)
android.view.LayoutInflater.inflate (LayoutInflater.java:380)
android.view.View.inflate (View.java:21232)
com.rilixtech.CountryCodePicker.init (CountryCodePicker.java:140)
com.rilixtech.CountryCodePicker. (CountryCodePicker.java:124)
java.lang.reflect.Constructor.newInstance (Constructor.java)
android.view.LayoutInflater.createView (LayoutInflater.java:631)
android.view.LayoutInflater.createViewFromTag (LayoutInflater.java:776)
android.view.LayoutInflater.createViewFromTag (LayoutInflater.java:716)
android.view.LayoutInflater.rInflate (LayoutInflater.java:847)
android.view.LayoutInflater.rInflateChildren (LayoutInflater.java:810)
android.view.LayoutInflater.rInflate (LayoutInflater.java:855)
android.view.LayoutInflater.rInflateChildren (LayoutInflater.java:810)
android.view.LayoutInflater.inflate (LayoutInflater.java:527)
android.view.LayoutInflater.inflate (LayoutInflater.java:429)

Please help me to solve this issue.

What version of the library did you use?
Did you upgrade the version to the current version? If yes, you should update all the related layout too because the package name for the library is changed for the recent version.

This is seems related with the previous bug at issue #58. The resource layout of the library is being overrided by other layout. Please try using the latest version, 2.4.1.

yes, same with me, in my case my apk is working fine but while uploading the .aab, it throws android.content.res.Resources$NotFoundException, in some devices

Did you using proguard in your project?
What devices show the error?

Please provide the full log so I can investigate this issue asap.

Or, can you provide a minimum sample app to reproduce the problem?

Any updates on this issue? I have the same problem here for some devices and it keeps crashing for them.

I integrated with the latest version 'com.github.joielechong:countrycodepicker:2.4.1' but it still crashes.

My Proguard file:
-keep class androidx.appcompat.widget.** { ; }
-keep class cn.pedant.
* { ; }
-dontwarn afu.org.checkerframework.
*
-dontwarn org.checkerframework.**
-dontwarn com.google.errorprone.**
-dontwarn sun.misc.Unsafe
-dontwarn java.lang.ClassValue
-dontwarn com.google.android.material.snackbar.**

allow crashlytics to keep annotation and source stack for exceptions

-keepattributes Annotation
-keepattributes SourceFile,LineNumberTable
-keep public class * extends java.lang.Exception

Any updates? There are still many crashes

I also facing same error. Its working on my devices, but after uploading to playstore it is crashing on some devices.
In firebase crashalytics title is like this
XposedBridge.java (de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative)
inside description
it is like this:
android.view.InflateException: Binary XML file line #51: Binary XML file line #51: Error inflating class com.rilixtech.widget.countrycodepicker.CountryCodePicker
android.app.ActivityThread.performLaunchActivity

Devices facing crash are following:
POCO F2 PRO
Galaxy A21s
ONEPLUS A5000
Galaxy S10 5G
HOT5
Mi 9X
Pixel 3a
vivo S1
Huawei Enjoy 9s
Samsung Galaxy A70

The bug is still existing. You can add the Nexus 5X to that list.