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

Unhandled Exception: type 'List<dynamic>' is not a subtype of type 'Map<String, dynamic>' in type cast #299

Closed
SercanKaya0 opened this issue Sep 22, 2021 · 7 comments

Comments

@SercanKaya0
Copy link

Flutter google admob apis issue.

[VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: type 'List' is not a subtype of type 'Map<String, dynamic>' in type cast

@kevmoo
Copy link
Collaborator

kevmoo commented Sep 22, 2021

Please include the versions of flutter, the packages you're using, and the API call you made!

@SercanKaya0
Copy link
Author

Flutter : 2.5.1
googleapis : 5.0.1

await _googleSignIn.signInSilently();
final client = await _googleSignIn.authenticatedClient();
if (client != null) {
final AdMobApi admobApi = AdMobApi(client);

    GenerateNetworkReportResponse admobAdUnits =
        await admobApi.accounts.networkReport.generate(
            GenerateNetworkReportRequest(
              reportSpec: (NetworkReportSpec(
                  dateRange:
                      DateRange(endDate: endDate, startDate: startDate),
                  metrics: [
                    "AD_REQUESTS",
                    "CLICKS",
                    "ESTIMATED_EARNINGS",
                    "IMPRESSIONS",
                    "IMPRESSION_CTR",
                    "IMPRESSION_RPM",
                    "MATCHED_REQUESTS",
                    "MATCH_RATE",
                    "SHOW_RATE"
                  ],
                  dimensions: [
                    "DATE",
                    // "MONTH",
                    // "WEEK",
                    "AD_UNIT",
                    "APP",
                    "COUNTRY",
                    "FORMAT",
                    "PLATFORM",
                    "MOBILE_OS_VERSION",
                    "GMA_SDK_VERSION",
                    "APP_VERSION_NAME",
                    "SERVING_RESTRICTION"
                  ],)),
            ),
            parent);

    return Result.success(admobAdUnits);

errorMessage type 'List' is not a subtype of type 'Map<String, dynamic>' in type cast

@no-response no-response bot removed the needs-info label Sep 22, 2021
@kevmoo
Copy link
Collaborator

kevmoo commented Sep 22, 2021

Duplicate of #183 – but thanks for the repro!

@kevmoo kevmoo closed this as completed Sep 22, 2021
@SercanKaya0
Copy link
Author

Ok, I see but i dont fixed

@kevmoo
Copy link
Collaborator

kevmoo commented Sep 22, 2021

@SercanKaya0 – see the other issue. I need to dig to see if I can figure out a work-around.

@SercanKaya0
Copy link
Author

Hmm, Okey, I'm waiting for your good news. :)

@kevmoo
Copy link
Collaborator

kevmoo commented Oct 17, 2021

Fixed in b418af3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants