Skip to content

[google_sign_in] GoogleUserCircleAvatar throws "Invalid image data" #88329

@JCKodel

Description

@JCKodel

Steps to Reproduce

GoogleUserCircleAvatar throws "Invalid Image Data" because of this line:

https://github.com/flutter/plugins/blob/b548ae18646d1725a8e1f004c26bf42e4d362aa8/packages/google_sign_in/google_sign_in/lib/widgets.dart#L109

placeholder: Uint8List((size.round() * size.round())),

This generates an empty array with 0 (which is NOT a valid image).

Changing the above line to

placeholder: base64Decode("R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="),

fixes the problem (this is an transparent 1x1 gif image as base-64).

Logs
[✓] Flutter (Channel stable, 2.2.3, on Microsoft Windows [Version 10.0.19042.1165], locale pt-BR)
    • Flutter version 2.2.3 at C:\flutter
    • Framework revision f4abaa0735 (7 weeks ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at C:\AndroidSDK
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = C:\AndroidSDK
    • Java binary at: c:\Java\bin\java.exe
    • Java version Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).

[✓] VS Code (version 1.59.0)
    • VS Code at C:\Users\jckod\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.23.0

[✓] Connected device (4 available)
    • SM J415G (mobile)           • 785dd05b      • android-arm    • Android 9 (API 28)
    • sdk gphone x86 arm (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
    • Chrome (web)                • chrome        • web-javascript • Google Chrome 92.0.4515.131
    • Edge (web)                  • edge          • web-javascript • Microsoft Edge 92.0.902.73

! Doctor found issues in 1 category.

(Flutter 2.2.3 can't detect my Android Studio, but it is there)

Metadata

Metadata

Assignees

No one assigned

    Labels

    found in release: 2.2Found to occur in 2.2found in release: 2.5Found to occur in 2.5good first issueRelatively approachable for first-time contributorshas reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: google_sign_inThe Google Sign-In pluginpackageflutter/packages repository. See also p: labels.r: duplicateIssue is closed as a duplicate of an existing issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions