GrenderG / Toasty

The usual Toast, but with steroids 💪
GNU Lesser General Public License v3.0
6.57k stars 809 forks source link

ToastyUtils.java line 1 es.dmoral.toasty.ToastyUtils.getDrawable #182

Open Younes-Charfaoui opened 2 years ago

Younes-Charfaoui commented 2 years ago

Fatal Exception: android.content.res.Resources$NotFoundException Resource ID #0x7f08009d

Fatal Exception: android.content.res.Resources$NotFoundException: Resource ID #0x7f08009d at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:253) at android.content.res.Resources.getValue(Resources.java:1437) at androidx.appcompat.widget.ResourceManagerInternal.c(ResourceManagerInternal.java:18) at androidx.appcompat.widget.ResourceManagerInternal.getDrawable(ResourceManagerInternal.java:3) at androidx.appcompat.widget.ResourceManagerInternal.getDrawable(ResourceManagerInternal.java:2) at androidx.appcompat.content.res.AppCompatResources.getDrawable(AppCompatResources.java:4) at es.dmoral.toasty.ToastyUtils.getDrawable(ToastyUtils.java:1) at es.dmoral.toasty.Toasty.success(Toasty.java:1) at es.dmoral.toasty.Toasty.success(Toasty.java:2)

EvgenyPlaksin commented 2 years ago

Please, tell us more about your problem, and if you were able to solve it, tell us about the ways to solve it.

1selindursun commented 7 months ago

"This is almost certainly users sharing (sideloading) the app, either via P2P sharing programs, or uploading the APK to the web then other users downloading and installing from the web.

People used to dealing with non Android App Bundle apps just transfer and share the main APK. But your App bundle app has lots of "split APKs" for things like the resources, that is how the size saving happens. You can read all about this process on the help page. If a user installs the main APK without installing the right split APKs, then a "Resources Not found" crash will occur the first time the app tries to load a resource.

If you want to support users sideloading your app and just the main APK you could try to detect this situation and display a message to the user (without using any resources) that says "Please install from Google Play". Or you could just decide you aren't going to support users who share APKs in this way.

I suspect in the long run the websites and P2P sharing programs will get better at sharing such APKs properly, so I wouldn't spend too long worrying about it.

If you see this happening far more frequently on lower Android versions, this isn't probably due to a bug in lower Android versions. Instead, it is probably because in countries where users commonly P2P share apps (eg India) users also are far more likely to be on older version phones."

https://stackoverflow.com/a/53082301