CountryCodePickerProject icon indicating copy to clipboard operation
CountryCodePickerProject copied to clipboard

InflateException related to hbb20 CountryCodePicker

Open david-young-fax opened this issue 5 years ago • 32 comments

I tried to debug for long time and the exception is happening for some old version phones.

== Crash phone device examples ==

Device Brand: Trend Model: TaintArt for x86 Orientation: Portrait RAM free: 761.6 MB Disk free: 1.91 GB plat_android Operating System Version: 7.1.2 Orientation: Portrait Rooted: Yes

Device Brand: LGE Model: Nexus 5X Orientation: Portrait RAM free: 1.41 GB Disk free: 542.95 MB plat_android Operating System Version: 8.1.0 Orientation: Portrait Rooted: No

Device Brand: Huawei Model: Huawei Enjoy 9s Orientation: Portrait RAM free: 19.55 GB Disk free: 17.41 GB plat_android Operating System Version: 5.1 Orientation: Portrait Rooted: Yes

== Stack Trace ==

Caused by android.content.res.Resources$NotFoundException: Unable to find resource ID #0x7f070069 at android.content.res.Resources.getResourceName(Resources.java:2070) at android.content.res.Resources.loadDrawableForCookie(Resources.java:2441) at android.content.res.Resources.loadDrawable(Resources.java:2381) at android.content.res.TypedArray.getDrawable(TypedArray.java:749) at android.widget.ImageView.(ImageView.java:146) at android.widget.ImageView.(ImageView.java:135) at androidx.appcompat.widget.AppCompatImageView.(AppCompatImageView.java:74) at androidx.appcompat.widget.AppCompatImageView.(AppCompatImageView.java:69) at androidx.appcompat.app.AppCompatViewInflater.createImageView(AppCompatViewInflater.java:199) at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:119) at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1548) at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1599) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:725) at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) at android.view.LayoutInflater.rInflate(LayoutInflater.java:809) at android.view.LayoutInflater.inflate(LayoutInflater.java:504) at android.view.LayoutInflater.inflate(LayoutInflater.java:414) at com.hbb20.CountryCodePicker.init(CountryCodePicker.java:212) at com.hbb20.CountryCodePicker.(CountryCodePicker.java:160) at java.lang.reflect.Constructor.newInstance(Constructor.java) at java.lang.reflect.Constructor.newInstance(Constructor.java:288) at android.view.LayoutInflater.createView(LayoutInflater.java:607) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743) at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) at android.view.LayoutInflater.rInflate(LayoutInflater.java:809) at android.view.LayoutInflater.inflate(LayoutInflater.java:504) at android.view.LayoutInflater.inflate(LayoutInflater.java:414) at com.faxgun.faxgun.adapter.ListViewAdapter.setListViewHeaderFooter$550b9414(ListViewAdapter.java:41) at com.faxgun.faxgun.views.SendFaxTab.setListView(SendFaxTab.java:417) at com.faxgun.faxgun.views.SendFaxTab.showListView(SendFaxTab.java:328) at com.faxgun.faxgun.adapter.TabViewAdapter.showSendFaxTabListView(TabViewAdapter.java:138) at com.faxgun.faxgun.views.MainTab.processFinish(MainTab.java:160) at com.faxgun.faxgun.task.AppStartInitTask.onPostExecute(AppStartInitTask.java:67) at com.faxgun.faxgun.task.AppStartInitTask.onPostExecute(AppStartInitTask.java:20) at android.os.AsyncTask.finish(AsyncTask.java:636) at android.os.AsyncTask.access$500(AsyncTask.java:177) at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:653) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5314) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:374) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

david-young-fax avatar May 20 '20 23:05 david-young-fax

Anyone could help take a look? It's a long time bug and exception inside the hbb20 lib. Don't know how to solve it.

david-young-fax avatar May 20 '20 23:05 david-young-fax

Thanks for reporting. I know this is critical issue but this is puzzling because it happens on certain devices which I don't have physically and I can not test. I would like some help from developers who can test my potential solution. Do you have any of these devices to reproduce the problem?

On Wed, May 20, 2020 at 17:50 david-young-fax [email protected] wrote:

Anyone could help take a look? It's a long time bug and exception inside the hbb20 lib. Don't know how to solve it.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hbb20/CountryCodePickerProject/issues/403#issuecomment-631796865, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFQ32HUZIL6XADA3DJ5443RSRUEPANCNFSM4NGMV3CQ .

hbb20 avatar May 21 '20 14:05 hbb20

sorry.. I don't have such devices either... Anyone can help??

david-young-fax avatar May 21 '20 16:05 david-young-fax

@hbb20 maybe you can publish the changes into the latest release after normal testing? i can integrate and see if this bug will happen or not? it's still crashing for certain devices...

david-young-fax avatar May 23 '20 03:05 david-young-fax

I just tried with Nexus 5x (one of the devices that you listed) on emulator and could not reproduce the issue.

hbb20 avatar May 23 '20 05:05 hbb20

Are you using Proguard on your production app?

hbb20 avatar May 23 '20 05:05 hbb20

@hbb20 yes, I'm using it to reduce the app file size. does it matter?

david-young-fax avatar May 23 '20 05:05 david-young-fax

Just trying to figure out any clue. I wanna reproduce this somehow so that I can fix. It's surprising that it works on the same emulator. Did you get firebase report for these devices?

hbb20 avatar May 23 '20 08:05 hbb20

what is the parent theme of your app?

hbb20 avatar May 23 '20 08:05 hbb20

@hbb20 yes i found it on the firebase report for these devices.

here is the parent theme definition:

david-young-fax avatar May 23 '20 17:05 david-young-fax

Hello all. I know this is critical issue but it is puzzling because it happens on certain devices which I don't have physically and so I can not test. I would like some help from developers who can confirm the issue on physical device and test my potential solution. Do you have any device that can reproduce the problem with CCP library version 2.3.9?

hbb20 avatar May 24 '20 05:05 hbb20

@hbb20 i removed the lib from proguard rules and it's still crashing. It's small percentage for certain devices, but it's crashing so it has very high risk for these users to give us bad reviews.

This one is the latest device:

Device Brand: LGE Model: Nexus 5X Orientation: Portrait RAM free: 1.35 GB Disk free: 541.63 MB Operating System Version: 8.1.0 Orientation: Portrait Rooted: No

Caused by android.content.res.Resources$NotFoundException Unable to find resource ID #0x7f070069

android.content.res.ResourcesImpl.getResourceName (ResourcesImpl.java:253) android.content.res.ResourcesImpl.loadDrawableForCookie (ResourcesImpl.java:760) android.content.res.ResourcesImpl.loadDrawable (ResourcesImpl.java:630) android.content.res.Resources.loadDrawable (Resources.java:886) android.content.res.TypedArray.getDrawableForDensity (TypedArray.java:953) android.content.res.TypedArray.getDrawable (TypedArray.java:928) android.content.res.XResources$XTypedArray.getDrawable (XResources.java:1363) android.widget.ImageView. (ImageView.java:188) android.widget.ImageView. (ImageView.java:171) androidx.appcompat.widget.AppCompatImageView. (AppCompatImageView.java:74) androidx.appcompat.widget.AppCompatImageView. (AppCompatImageView.java:69) androidx.appcompat.app.AppCompatViewInflater.createImageView (AppCompatViewInflater.java:199) androidx.appcompat.app.AppCompatViewInflater.createView (AppCompatViewInflater.java:119) androidx.appcompat.app.AppCompatDelegateImpl.createView (AppCompatDelegateImpl.java:1548) androidx.appcompat.app.AppCompatDelegateImpl.onCreateView (AppCompatDelegateImpl.java:1599) android.view.LayoutInflater.createViewFromTag (LayoutInflater.java:772) android.view.LayoutInflater.createViewFromTag (LayoutInflater.java:730) android.view.LayoutInflater.rInflate (LayoutInflater.java:863) android.view.LayoutInflater.rInflateChildren (LayoutInflater.java:824) android.view.LayoutInflater.rInflate (LayoutInflater.java:866) android.view.LayoutInflater.rInflateChildren (LayoutInflater.java:824) android.view.LayoutInflater.inflate (LayoutInflater.java:515) android.view.LayoutInflater.inflate (LayoutInflater.java:423) arrow_right com.hbb20.CountryCodePicker.init (CountryCodePicker.java:212) com.hbb20.CountryCodePicker. (CountryCodePicker.java:160) java.lang.reflect.Constructor.newInstance0 (Constructor.java) java.lang.reflect.Constructor.newInstance (Constructor.java:334) android.view.LayoutInflater.createView (LayoutInflater.java:647) android.view.LayoutInflater.createViewFromTag (LayoutInflater.java:790) android.view.LayoutInflater.createViewFromTag (LayoutInflater.java:730) android.view.LayoutInflater.rInflate (LayoutInflater.java:863) android.view.LayoutInflater.rInflateChildren (LayoutInflater.java:824) android.view.LayoutInflater.rInflate (LayoutInflater.java:866) android.view.LayoutInflater.rInflateChildren (LayoutInflater.java:824) android.view.LayoutInflater.inflate (LayoutInflater.java:515) android.view.LayoutInflater.inflate (LayoutInflater.java:423) com.faxgun.faxgun.adapter.ListViewAdapter.setListViewHeaderFooter$550b9414 (ListViewAdapter.java:41)

david-young-fax avatar May 27 '20 18:05 david-young-fax

@hbb20 What could be the problem? Any way to fix? Maybe you can release the fix and let me upgrade and see if the crash will go away?

david-young-fax avatar May 27 '20 18:05 david-young-fax

Great. Let's try this. I published a version with possible fix so please try 2.4.1-alpha1 and let me know.

hbb20 avatar May 27 '20 20:05 hbb20

@david-young-fax did you get chance to test ☝️ alpha version?

hbb20 avatar May 29 '20 04:05 hbb20

@hbb20 we have deployed with the alpha version. However it's still crashing.

Caused by android.content.res.Resources$NotFoundException Unable to find resource ID #0x7f070069

android.content.res.ResourcesImpl.getResourceName (ResourcesImpl.java:253) android.content.res.ResourcesImpl.loadDrawableForCookie (ResourcesImpl.java:760) android.content.res.ResourcesImpl.loadDrawable (ResourcesImpl.java:630) android.content.res.Resources.loadDrawable (Resources.java:886) android.content.res.TypedArray.getDrawableForDensity (TypedArray.java:953) android.content.res.TypedArray.getDrawable (TypedArray.java:928) android.content.res.XResources$XTypedArray.getDrawable (XResources.java:1363) android.widget.ImageView. (ImageView.java:188) android.widget.ImageView. (ImageView.java:171) androidx.appcompat.widget.AppCompatImageView. (AppCompatImageView.java:74) androidx.appcompat.widget.AppCompatImageView. (AppCompatImageView.java:69) androidx.appcompat.app.AppCompatViewInflater.createImageView (AppCompatViewInflater.java:199) androidx.appcompat.app.AppCompatViewInflater.createView (AppCompatViewInflater.java:119) androidx.appcompat.app.AppCompatDelegateImpl.createView (AppCompatDelegateImpl.java:1548) androidx.appcompat.app.AppCompatDelegateImpl.onCreateView (AppCompatDelegateImpl.java:1599) android.view.LayoutInflater.createViewFromTag (LayoutInflater.java:772) android.view.LayoutInflater.createViewFromTag (LayoutInflater.java:730) android.view.LayoutInflater.rInflate (LayoutInflater.java:863) android.view.LayoutInflater.rInflateChildren (LayoutInflater.java:824) android.view.LayoutInflater.rInflate (LayoutInflater.java:866) android.view.LayoutInflater.rInflateChildren (LayoutInflater.java:824) android.view.LayoutInflater.inflate (LayoutInflater.java:515) android.view.LayoutInflater.inflate (LayoutInflater.java:423) arrow_right com.hbb20.CountryCodePicker.init (CountryCodePicker.java:213) com.hbb20.CountryCodePicker. (CountryCodePicker.java:161) java.lang.reflect.Constructor.newInstance0 (Constructor.java)

david-young-fax avatar May 29 '20 04:05 david-young-fax

@david-young-fax thank you for trying that out. Can you try another potential solution with
version 2.4.1-alpha2?

hbb20 avatar May 29 '20 05:05 hbb20

@hbb20 yes, we updated with 2.4.1-alpha2 and released again. Unfortunately there are still crashes.

Quite frustrated... what could be the issue?

david-young-fax avatar Jun 01 '20 23:06 david-young-fax

@hbb20 what could be the issue?

here is another device that crashed:

Device Brand: Trend Model: TaintArt for x86 Orientation: Portrait RAM free: 747.13 MB Disk free: 1.91 GB

Operating System Version: 7.1.2 Orientation: Portrait Rooted: Yes

david-young-fax avatar Jun 04 '20 19:06 david-young-fax

Yeah. It's frustrating but thank you for trying our different solutions here. Do you have "shrinkResources true" for your app?

hbb20 avatar Jun 05 '20 12:06 hbb20

I uploaded my demo app with shrinkResources true. And I was expecting to see some issue in pre-launch report but unfortunately I see nothing.. 😞 image

hbb20 avatar Jun 06 '20 17:06 hbb20

I too have had this crash in our app. The only user that is having issues is: Samsung J5, version 7.1.1.

Caused by android.content.res.Resources$NotFoundException: Unable to find resource ID #0x7f080220

walkerdan5 avatar Jun 09 '20 03:06 walkerdan5

I am also getting the same issue for same device, I too also using proguard, shrink resource and android bundles.

Caused by android.view.InflateException Binary XML file line #108: Binary XML file line #108: Error inflating class com.hbb20.CountryCodePicker

Device Brand: LGE Model: Nexus 5X Orientation: Portrait RAM free: 1.33 GB Disk free: 537.46 MB Operating System Version: 8.1.0 Orientation: Portrait Rooted: No Crash Date: Jun 20, 2020, 10:23:00 PM App version: 3.1.2 (89)

deepak-patidar-dev avatar Jun 21 '20 12:06 deepak-patidar-dev

Hi Deepak,

Can I ask for little more help to identify the issue?

  • Full crash report
  • Is this firebase test lab reporting or user crash?
  • Did you get a chance to test it on a physical device (Nexus 5X)?
  • Can I get apk and/or download link for your app? I would like to try on emulator of this device.

Thanks, Harsh Bhakta

On Sun, Jun 21, 2020 at 06:05 deepak-patidar-dev [email protected] wrote:

I am also getting the same issue for same device, I too also using proguard, shrink resource and android bundles.

Caused by android.view.InflateException Binary XML file line #108 https://github.com/hbb20/CountryCodePickerProject/issues/108: Binary XML file line #108 https://github.com/hbb20/CountryCodePickerProject/issues/108: Error inflating class com.hbb20.CountryCodePicker

Device Brand: LGE Model: Nexus 5X Orientation: Portrait RAM free: 1.33 GB Disk free: 537.46 MB Operating System Version: 8.1.0 Orientation: Portrait Rooted: No Crash Date: Jun 20, 2020, 10:23:00 PM App version: 3.1.2 (89)

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/hbb20/CountryCodePickerProject/issues/403#issuecomment-647119118, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFQ32DC4YWIJZ7JAZZR74DRXXZPZANCNFSM4NGMV3CQ .

hbb20 avatar Jun 21 '20 15:06 hbb20

I have 3 users with this crash; Spark Pro (Android 7.0) and L8 Lite (Android 6.0) both are "TECHNO" phones. And Samsun J5 (android 7.1.1.)

walkerdan5 avatar Jun 21 '20 20:06 walkerdan5

@walkerdan5, sorry about that. I am trying to figure out a solution. @david-young-fax has been a great help in trying out different solutions since I can not reproduce it. I have new alpha version 2.4.1-alpha3 with possible fix. Can someone try that an confirm if problem is there or not?

hbb20 avatar Jun 21 '20 21:06 hbb20

@walkerdan5, sorry about that. I am trying to figure out a solution. @david-young-fax has been a great help in trying out different solutions since I can not reproduce it. I have new alpha version 2.4.1-alpha3 with possible fix. Can someone try that an confirm if problem is there or not? Yeah no problem, sorry i can't help much. I have not been able to reproduce it myself. Only affected about 3 out of 40,000 users. So isn't too much of an issue.

walkerdan5 avatar Jun 21 '20 22:06 walkerdan5

I have crash reports on Crashlytics for "TECHNO", "LGE" and "HUAWEI" devices on Android 7/8/9. The crash is same as @david-young-fax The crash happens when ImageView tries rendering @drawable/ccp_down_arrow For some reason, this solution (https://stackoverflow.com/a/44686625/8183406) looks promising. Can someone tell if this should theoretically work?

firefinchdev avatar Jul 04 '20 09:07 firefinchdev

@firefinchdev please try 2.4.1 (with this potential solution) and let me know if it worked.

hbb20 avatar Jul 18 '20 07:07 hbb20

@firefinchdev please try 2.4.1 (with this potential solution) and let me know if it worked.

2.4.1 fixed it I was having a similar crush on 2.4.0 on x86 emulator API 22 with pixel device profile after updating the error is gone but yet to test further

ebundala avatar Oct 10 '20 04:10 ebundala