-
Notifications
You must be signed in to change notification settings - Fork 810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fatal Exception: ResourcesNotFoundException #84
Comments
I'm also seeing a similar
Coming from Doesn't reproduce on Pixel, but it does on a Samsung Galaxy Note 9 (SM-N960F). I haven't tried building as APK to see if it reproduces, but it is convenient just as I switch to app bundles this starts happening. Will investigate, please update if you find anything. EDIT To add, the error is happening in an |
I haven't used App bundles yet. Any help debugging this will be much appreciated! And of course, PRs are very welcomed. I'll try to look into this too. EDIT: After searching for this issue in StackOverflow seems like more people are having ResourcesNotFoundException in their apps using App bundles. Maybe it can be an Android related bug? |
Looks like it's most likely due to users side-loading an APK? With App bundling Google intentionally splits APKs and if a user when side-loading doesn't do it correctly then it makes sense it'll fail. If this were a wider-spread issue I feel like I'd be seeing more reports than just 1 from 1 user so far. |
I still get a lot of crashes, even with version 1.4.2.
@GrenderG Can you please reopen this issue?
I'd like to have this in the lib itself. Otherwise I would have to check for this exception whenever I show a toast. I agree it's not the best solution, but I prefer having a toast w/o an icon instead of a crash. |
I guess I found the issue. Please have a look at the stacktrace. Toasty tries to get the resource with ID #0xffff5722:
Here's the code calling Toasty: https:/openhab/openhab-android/blob/master/mobile/src/main/java/org/openhab/habdroid/core/VoiceService.java#L97 Toast#custom() is overloaded, most of them take colors as res, but one takes them as int: https:/GrenderG/Toasty/blob/master/toasty/src/main/java/es/dmoral/toasty/Toasty.java#L288-L299 |
After reading all comments , i plan to use custom() message App will show toast with or without icon and crash will be prevented. I have 5 crashes of ResourceNotFound Exception Toasty in 3 days and my active users is 5000. |
Was facing the same issue that Resource NotFoundException. Seems in my case I was getting on Android 11+. And no impact when doing So, when I tried:
Then there is no issue. Ref: https://developer.android.com/studio/build/shrink-code#shrink-resources |
Oh shit, here we go again... |
Seems like all the library drawable resources have to be added to |
"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." |
Crash when app trying init
Toasty.warning
ToastyUtils.getDrawable(context, drawable.ic_error_outline_white_48dp)
I never see this issue before but after building as App bundle it's happens.
The text was updated successfully, but these errors were encountered: