Search code examples
fluttergoogle-play-servicesflutter-dependenciesgoogle-play-games

games_services always returning null when calling signIn()


I followed all the steps here: https://akdebuging.com/posts/integrate-gamekit-and-google-play-services/

Added to AndroidManifest:

    <meta-data
        android:name="com.google.android.gms.games.APP_ID"
        android:value="MY_ID" />
    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
</application>

In Google Play Console everything seems fine (the SDK is not marked as done, not sure if related):

image

When I call this it returns just null:

Future<void> signIn() async {
    final result = await GameAuth.signIn();
    print(result);
}

Solution

  • To resume everything:

    • Add test users for both OAuth consent screen and Google Play Console --> Play Games Services --> Testers
    • Get debug and release key from running ./gradlew signingReport

    If last command fails:

    • Upgrade Android Studio and Flutter
    • Check THIS and update gradle-wrapper.properties if necessary

    Real demo: https://play.google.com/store/apps/details?id=com.drodriguez.time_tap

    More info: https://github.com/Abedalkareem/games_services/issues/129