-
Notifications
You must be signed in to change notification settings - Fork 177
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
XmlPullParserException: getNamespacePrefix() not supported #1245
Comments
👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out! |
Thank you for reporting, is this only happening on Pixel 5 Android 13, or does Crashlytics provide more information about the distribution? We are wondering if it's a particular paywall icon that's causing this issue on certain devices only |
It's becoming a really big problem, apparently none of my users are able to purchase. |
Hey @bharel we looked into this a bit and didn't see anything concerning on our end. Are you able to reproduce it consistently? It looks like the exception occurs when loading the ✔ icon in your paywall's features section. If it's consistently failing, do you mind checking if another icon makes it crash? Just in case there's a particular issue with that icon (if it's corrupted) or if it's a general issue loading icons |
@vegaro I'm able to reproduce consistently now. Switched to a different icon and it doesn't work. It worked before so I highly doubt its the tick icon. |
Seems like it doesn't happen on debug mode, only on release. Managed to grab a full traceback:
flutter clean, dart pub upgrade -> purchases_flutter + purchases_ui_flutter @ 8.4.3, still happens. |
Hmm that's actually very good information. can you try setting shrinkresources to false and see if it fixes it on release mode? I suspect the drawables might be getting removed You can disable
|
Doesn't work unfortunately, with and without
|
Can you also try setting both |
🎉 minification. Works on release:
Now I need to know what to do as I obviously wish to ship minified and shrinked 😄 Awesome job helping me find it out, thanks! |
That's great news. I think we need to add a keep.xml file to our plugin In the meantime, to make sure that fixes it. Do you mind adding this file to
If that works, we'll make a release with the file so it's automatically added to everyone |
Does not work in
File content:
|
I figured it out @bharel . It looks like it's actually related to the
You have two alternatives, adding this rule to your
Don't forget to tell gradle to use that file:
Or fully disabling R8 full mode by adding the following into your
I would be more inclined to use the first option, but I am not sure there would be a need to keep any other class (although that rule is already fairly aggressive). If you get other runtime issues around XML, that might be the reason. Here is a related stripe issue flutter-stripe/flutter_stripe#1909. As far as I understand, this comes enabled by default with AGP 8, and it’s fairly aggressive. It only happens when having The real fix would be that |
That is so random. I'm sorry for the nuisance :-( |
Works like magic 🎉 Thanks so much! Now on to the next one! Firebase bugs here we come! ❤🗡 |
For reference, we are going to add a proguard rule to our plugin to prevent this from happening (even if we are not the ones overriding the dependency) since we keep getting reports. See #1270 for more if you are interested. |
Fixes: - #1245 - #1269 - https://community.revenuecat.com/general-questions-7/app-crashing-when-paywall-is-open-on-flutter-5826?postid=20041#post20041 This is not really caused by us, as we don't have a direct dependency on `org.xmlpull` but we keep getting reports so we have decided to add it to our own proguard rules. This library is bundled by the OS, and if the library doesn't exist it won't have any effect, but if one of the dependencies of the app adding our plugin has a direct dependency and overrides it, it will the classes. I think the key here (and why this doesn’t happen for purchases-android) is that in flutter apps, packages are compiled by the developers as Android modules. So if one of the flutter packages has a dependency on a different version of `org.xmlpull.v1` than the one the system bundles (and the one we compile purchases-android against), the app will be compiled using that version. Since R8 optimizes each app individually, it will analyze `org.xmlpull.v1` and strip out “unused” code from that direct dependency, and our code crashes because it was compiled to depend on those references that have been stripped.
Do not remove any of the steps from the template below. If a step is not applicable to your issue, please leave that step empty.
There are a lot of things that can contribute to things not working. Having a very basic understanding of your environment will help us understand your issue faster!
Environment
flutter doctor
purchases-flutter
Flutter doctor
[✓] Flutter (Channel stable, 3.27.2, on macOS 14.5 23F79 darwin-x64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.2)
[✓] VS Code (version 1.95.2)
[✓] VS Code (version 1.97.0-insider)
[✓] Connected device (2 available)
[✓] Network resources
Package versions
purchases_flutter 8.4.1
purchases_ui_flutter 8.4.1
Device
Android 13, model: Redfin 64-bit Only (pixel 5?)
Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)
Stacktrace:
Describe the bug
Happens infrequently upon trying to view the revenuecat purchase screen. As I see this error only through crashlytics I'm unable to further analyze it.
Additional context
The text was updated successfully, but these errors were encountered: