Skip to content
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

Error: type '_Map<String, dynamic>' is not a subtype of type 'bool?' in type cast #2072

Open
kieranmccwayleadr opened this issue Feb 10, 2025 · 3 comments
Assignees
Labels
Android Issue related to Android native bindings bug Something isn't working needs triage Needs triage

Comments

@kieranmccwayleadr
Copy link

kieranmccwayleadr commented Feb 10, 2025

Describe the bug
There is a good number of Firebase Crashlytics getting fired when we try ti call .isPlatformPaySupported. This seems to happen to Android only.

StackTrace:

Error: type '_Map<String, dynamic>' is not a subtype of type 'bool?' in type cast, StackTrace: #1335 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:334) <asynchronous suspension>
#1572 MethodChannelStripe.isPlatformPaySupported
(package:stripe_platform_interface/src/method_channel_stripe.dart:428
<asynchronous suspension> #2027 
Stripe.isPlatformPaySupported (package:flutter_stripe/src/stripe.dart:135 <asynchronous suspension>

We are trying to use Stripe.instance.isPlatformPaySupportedListenable.value where value is expecting a bool, yet for some reason, we are getting _Map<String, dynamic>. I assume there is an exception happening and we can try catch it, but nothing is standing out as to why this error is coming from the library?

To Reproduce
Haven't been able to reproduce ourselves

Expected behavior
No crash alerts coming into crashlytics.

Smartphone / tablet - OS: Android 13 & 14

  • Package version: 11.1.0
  • Flutter version 3.24.3

Additional context

@kieranmccwayleadr kieranmccwayleadr added the needs triage Needs triage label Feb 10, 2025
@kieranmccwayleadr
Copy link
Author

Hi I wanted to check in again on this, we have gotten around 100+ reports of this on Android?

@remonh87
Copy link
Member

Hey that seems like a bug in the library. I am currently a bit swamped but wil try to take a look at it in the weekend.

@remonh87 remonh87 self-assigned this Feb 13, 2025
@remonh87 remonh87 added bug Something isn't working Android Issue related to Android native bindings labels Feb 13, 2025
@kieranmccwayleadr
Copy link
Author

No rush to check it on the weekend, last thing you'd want to do if you are swamped is to work during the weekend.

We removed it for now as it wasn't necessarily needed. But would be good to keep the ticket open at least for review!

remonh87 pushed a commit that referenced this issue Feb 16, 2025
remonh87 pushed a commit that referenced this issue Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Issue related to Android native bindings bug Something isn't working needs triage Needs triage
Projects
None yet
Development

No branches or pull requests

2 participants