Skip to content

_InternalLinkedHashMap<Object?, Object?>' is not a subtype of type 'Map<String, dynamic> error while purchasePackage() called #300

Closed
@abeyshiferaw0

Description

@abeyshiferaw0

Describe the bug
calling purchasePackage() would throw this error after subscription purchase is complete

_InternalLinkedHashMap<Object?, Object?>' is not a subtype of type 'Map<String, dynamic>

  1. Environment

    1. Output of flutter doctor [✓] Flutter (Channel stable, 2.8.0, on macOS 11.5.2 20G95 darwin-x64, locale en-ET) [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0) [!] Xcode - develop for iOS and macOS (Xcode 12.5.1) ! Flutter recommends a minimum Xcode version of 13.0.0. Download the latest version or update via the Mac App Store. [✓] Chrome - develop for the web [✓] Android Studio (version 2020.3) [✓] VS Code (version 1.63.2) [✓] Connected device (2 available)
    2. How widespread is the issue. Percentage of devices affected

    I only tested on Android.

  2. Debug logs that reproduce the issue

Issue is not caught by package but error thrown is type '_InternalLinkedHashMap<Object?, Object?>' is not a subtype of type 'Map<String, dynamic>'

  1. Steps to reproduce, with a description of expected vs. actual behavior
    call purchasePackage method with subscription packages should reproduce the error
    PurchaserInfo purchaserInfo = await Purchases.purchasePackage( offering.availablePackages.first, );

  2. Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)

final prorationMode = upgradeInfo?.prorationMode; final response = await _channel.invokeMethod('purchasePackage', { 'packageIdentifier': packageToPurchase.identifier, 'offeringIdentifier': packageToPurchase.offeringIdentifier, 'oldSKU': upgradeInfo?.oldSKU, 'prorationMode': prorationMode?.index }); return PurchaserInfo.fromJson(response['purchaserInfo']);

return PurchaserInfo.fromJson(response['purchaserInfo']); seems to be where the error is happening

Additional context
none

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingstatus: needs-additional-infoIssues that are missing steps from bug template

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions