A simple wrapper on top of Google Play Games Services (GPGS), including auth, achievement, and more.

Overview

play_games

Use Google Play Games Services on your Flutter app; this allows for signin and achievements so far, but more additions are very welcome. If you like it, give us a star and feel free to help and contribute.

This is android only for now but iOS is gracefully handled so you can define what happens.

Part 1: Sign In

Call the sign in method to sign in; you must check if the login was successufully.

    SigninResult result = await PlayGames.signIn();
    if (result.success) {
        await PlayGames.setPopupOptions();
        this.account = result.account;
    } else {
        this.error = result.message;
    }
    this.loading = false;

But don't think it will be that easy! Actually, GPGS signin is quite a hassle to do, but this tutorial should help you out with this nefarious task.

Reasons for failure will be specified in the error property. Otherwhise, you can access the account property to get the account.

Part 2: Achievements

You can both award achievements (unlock/increment) and show the Achievements screen in your game.

In order to unlock or increment an achievement, use the provided APIs:

  PlayGames.unlockAchievementByName(name);

This is async and you wait for the return if desired. The name is the name in your games-ids.xml file, you can also call the by id method.

Also, there is a method to display a popup with your achievements:

    PlayGames.showAchievements();

Again, this is async and returns only when the player closes the popup. So maybe you want to pause your game until that happens.

Part 3: Saved Games

Firstly, you must enable Saved Games. Go to your Google Play Console > Game Services > Select your game > Game details and toggle Saved Games option on. Then Save and publish. Beware, this cannot be later turned off.

Example of Saved Games

Secondly, in order to use the Saved Games feature, you must required explicit permission upon logging in. Thankfully, the signIn method can be configured to ask for that permission via the scopeSnapshot option, like so:

    SigninResult result = await PlayGames.signIn(scopeSnapshot: true); // allow to load/save games later

By default that option is false, so be sure to check it in. In Saved Games, a snapshot is of one save slot, that is, one representation of the game state that can be reloaded later. It is comprised of content, a blob, and metadata, a structured key-value pairs set.

You can use the methods openSnapshot and saveSnaphost to load and save game data under a given snapshotName. If your game has several slots, use several differente names for then. Otherwise, use only a single snapshotName for everything. A few points to ponder:

  • You put your save data in the content field, which is a String. You can put anything there (json, custom format, etc).
  • Metadata are also retrieved but for now only the description can be set. These metadata are useful if you are using the default save game screen provided (not support by this lib). Otherwise you can get some information from it.
  • Whenever you save a snapshot, if you intend to save again, you must reopen. You can either keep it open util the player saves the game, then save and reopen, or keep it closed, when the player saves, you open and save. Whenever you save, it is closed.

Here follows an example of the usage of the APIs from the crystap sample open-source game used to showcase this plugin:

    Future<int> fetchStartAmount() async {
        Snapshot save = await PlayGames.openSnapshot('crystap.main'); // load the existing save or create a new empty one if none exists
        if (save.content == null || save.content.trim().isEmpty) {
            return 0; // default value when there is no save
        }
        return int.parse(save.content);
    }

    Future<bool> saveAmount(int amount) async {
        bool result = await PlayGames.saveSnapshot('crystap.main', amount.toString()); // save the current state to the snapshot
        await PlayGames.openSnapshot('crystap.main'); // reopen snapshot after save
        return result;
    }

Here our data is just a single integer, that we convert to a String in order to save it within the content. Again, your save can be an arbitrarily complex JSON or anything like that. See the full Crystap game for more in-depth details on how to use the API.

There are also APIs for conflict resolution. If you want more robuts integration, check those out in the source code.

Part 4: Leaderboards

To use Leaderboards, you must create one in the GPGS console. Also, you can regenerate your games-ids files to be able to use the leaderboard name instead of id.

Once that's done, you can use the following APIs that are available:

  static Future<SubmitScoreResults> submitScoreByName(String leaderboardName, int score) async;
  static Future<SubmitScoreResults> submitScoreById(String leaderboardId, int score) async;
  static Future<ScoreResults> loadPlayerCenteredScoresByName(String leaderboardName, TimeSpan timeSpan, CollectionType collectionType, int maxResults, { bool forceReload = false }) async;
  static Future<ScoreResults> loadPlayerCenteredScoresById(String leaderboardId, TimeSpan timeSpan, CollectionType collectionType, int maxResults, { bool forceReload = false }) async;
  static Future<bool> showLeaderboard(String leaderboardId) async;

These methods are pretty thin wrappers over the Java/Android APIs, so you can check details about that the official docs. Also, checkout the crystap game for more details on how to implement this feature (better docs are on the way!).

Comments
  • Unable to determine Swift version on IOS Platform

    Unable to determine Swift version on IOS Platform

    I'm using "play_games" lib on my game and the library works fine on Android, but I have a problem when I compile the app on iOS. The error is the next:

    [!] Unable to determine Swift version for the following pods:
    
        - `play_games` does not specify a Swift version and none of the targets (`Runner`) integrating it have the `SWIFT_VERSION` attribute set. Please contact the  author or set the `SWIFT_VERSION` attribute in at least one of the targets that integrate this pod.
    

    In my code, I don't show play_games for IOS users, but I need that the library loads in iOS Platform.

    I have tried for removing the ios folder and moving the code to my project, and it's not possible to use the library on iOS

    I don't want to use the library on iOS, I only want to load it

    opened by javipacheco 6
  • Unhandled Exception: PlatformException(error, The new embedding does not support the old FlutterView., null)

    Unhandled Exception: PlatformException(error, The new embedding does not support the old FlutterView., null)

    Testing the app I realized that the popup of the achivements were not shown, this error corrected at the beginning of the installation and configuration of the extension, I removed the line: await PlayGames.setPopupOptions ();

    As I realized that the notices for Records and Achivements did not open, I decided to uncomment the line and now brings this error:

    E/flutter (15426): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, The new embedding does not support the old FlutterView., null) E/flutter (15426): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7) E/flutter (15426): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321:33) E/flutter (15426): <asynchronous suspension> E/flutter (15426): #2 PlayGames.setPopupOptions (package:play_games/play_games.dart:148:10) E/flutter (15426): #3 GameServices.login (package:gamedabiblia/services/gameservices.dart:21:20) E/flutter (15426): <asynchronous suspension> E/flutter (15426): #4 _HomeState._login (package:gamedabiblia/main.dart:69:39) E/flutter (15426): #5 _HomeState.initState (package:gamedabiblia/main.dart:105:24) E/flutter (15426): #6 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4355:58) E/flutter (15426): #7 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5) E/flutter (15426): #8 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14) E/flutter (15426): #9 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12) E/flutter (15426): #10 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5445:14) E/flutter (15426): #11 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14) E/flutter (15426): #12 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12) E/flutter (15426): #13 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243:16) E/flutter (15426): #14 Element.rebuild (package:flutter/src/widgets/framework.dart:3947:5) E/flutter (15426): #15 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206:5) E/flutter (15426): #16 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5) E/flutter (15426): #17 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14) E/flutter (15426): #18 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12) E/flutter (15426): #19 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5445:14) E/flutter (15426): #20 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14) E/flutter (15426): #21 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12) E/flutter (15426): #22 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5445:14) E/flutter (15426): #23 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14) E/flutter (15426): #24 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12) E/flutter (15426): #25 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243:16) E/flutter (15426): #26 Element.rebuild (package:flutter/src/widgets/framework.dart:3947:5) E/flutter (15426): #27 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206:5) E/flutter (15426): #28 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4381:11) E/flutter (15426): #29 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5) E/flutter (15426): #30 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14) E/flutter (15426): #31 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12) E/flutter (15426): #32 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5445:14) E/flutter (15426): #33 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14) E/flutter (15426): #34 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12) E/flutter (15426): #35 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5445:14) E/flutter (15426): #36 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14) E/flutter (15426): #37 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12) E/flutter (15426): #38 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243:16) E/flutter (15426): #39 Element.rebuild (package:flutter/src/widgets/framework.dart:3947:5) E/flutter (15426): #40 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206:5) E/flutter (15426): #41 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4381:11) E/flutter (15426): #42 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5) E/flutter (15426): #43 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14) E/flutter (15426): #44 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12) E/flutter (15426): #45 ComponentElemen

    opened by marcoriesco 3
  • How to save Ranking and retrieve the profile image and the username?

    How to save Ranking and retrieve the profile image and the username?

    In my game I will only need to save and show the Ranking and I needed to log the user with Google Play Games and retrieve the image and username, do you have any tutorial for this? I couldn't find anything in readme.

    This is for my first game made in Flutter.

    Thank you.

    opened by d-apps 2
  • Login Error

    Login Error

    I followed all the instructions.

    Updated the manifest, connected my app to firebase, linked and updated sha1 and sha256, added test device, requested authorization and updated the onauth screen from the google console api, despite that I still have this annoying error 👍

    I/xyz.luan.games.play.playgames.PlayGamesPlugin(27003): Failed to silent signin, trying explicit signin I/xyz.luan.games.play.playgames.PlayGamesPlugin(27003): com.google.android.gms.common.api.ApiException: 4: 4: I/xyz.luan.games.play.playgames.PlayGamesPlugin(27003): at com.google.android.gms.common.internal.ApiExceptionUtil.fromStatus(com.google.android.gms:play-services-base@@17.1.0:4) I/xyz.luan.games.play.playgames.PlayGamesPlugin(27003): at com.google.android.gms.common.internal.zai.zaf(com.google.android.gms:play-services-base@@17.1.0:2) I/xyz.luan.games.play.playgames.PlayGamesPlugin(27003): at com.google.android.gms.common.internal.zak.onComplete(com.google.android.gms:play-services-base@@17.1.0:6) I/xyz.luan.games.play.playgames.PlayGamesPlugin(27003): at com.google.android.gms.common.api.internal.BasePendingResult.zaa(com.google.android.gms:play-services-base@@17.1.0:176) I/xyz.luan.games.play.playgames.PlayGamesPlugin(27003): at com.google.android.gms.common.api.internal.BasePendingResult.setResult(com.google.android.gms:play-services-base@@17.1.0:135) I/xyz.luan.games.play.playgames.PlayGamesPlugin(27003): at com.google.android.gms.auth.api.signin.internal.zzi.zzc(com.google.android.gms:play-services-auth@@18.1.0:5) I/xyz.luan.games.play.playgames.PlayGamesPlugin(27003): at com.google.android.gms.auth.api.signin.internal.zzs.zzc(com.google.android.gms:play-services-auth@@18.1.0:6) I/xyz.luan.games.play.playgames.PlayGamesPlugin(27003): at com.google.android.gms.internal.auth-api.zzc.onTransact(com.google.android.gms:play-services-auth@@18.1.0:13) I/xyz.luan.games.play.playgames.PlayGamesPlugin(27003): at android.os.Binder.execTransactInternal(Binder.java:1021) I/xyz.luan.games.play.playgames.PlayGamesPlugin(27003): at android.os.Binder.execTransact(Binder.java:994) W/ActivityThread(27003): handleWindowVisibility: no activity for token android.os.BinderProxy@4fd66b7 I/flutter (27003): ERROR Unexpected error Status{statusCode=unknown status code: 12501, resolution=null}

    anyone else in my situation? thanks

    opened by Jhon2524 1
  • Leaderboard Submit Score by ID

    Leaderboard Submit Score by ID

    What works and is consistent -- SignIn, unlocking & incrementing Achievements.

    I have not been able to submit a score successfully yet. This happens the same on hardware as well as emulators. This app is in beta and the scores are published in the Google Play Control Panel.

    I tried to reconnect right before the submission but that didn't help.

    ==============================

    Here is the error log:

    E/xyz.luan.games.play.playgames.Request( 2100): Could not submit leadderboard E/xyz.luan.games.play.playgames.Request( 2100): com.google.android.gms.common.api.ApiException: 26502: CLIENT_RECONNECT_REQUIRED E/xyz.luan.games.play.playgames.Request( 2100): at com.google.android.gms.common.internal.ApiExceptionUtil.fromStatus(com.google.android.gms:play-services-base@@17.1.0:4) E/xyz.luan.games.play.playgames.Request( 2100): at com.google.android.gms.games.internal.zzbb.zza(com.google.android.gms:play-services-games@@19.0.0:22) E/xyz.luan.games.play.playgames.Request( 2100): at com.google.android.gms.games.internal.zzbe.onComplete(Unknown Source:8) E/xyz.luan.games.play.playgames.Request( 2100): at com.google.android.gms.common.api.internal.BasePendingResult.zaa(com.google.android.gms:play-services-base@@17.1.0:176) E/xyz.luan.games.play.playgames.Request( 2100): at com.google.android.gms.common.api.internal.BasePendingResult.setResult(com.google.android.gms:play-services-base@@17.1.0:135) E/xyz.luan.games.play.playgames.Request( 2100): at com.google.android.gms.common.api.internal.BaseImplementation$ApiMethodImpl.setResult(com.google.android.gms:play-services-base@@17.1.0:36) E/xyz.luan.games.play.playgames.Request( 2100): at com.google.android.gms.games.internal.zzg$zzan.setResult(com.google.android.gms:play-services-games@@19.0.0:4) E/xyz.luan.games.play.playgames.Request( 2100): at com.google.android.gms.games.internal.zzaa.zzd(com.google.android.gms:play-services-games@@19.0.0:2) E/xyz.luan.games.play.playgames.Request( 2100): at com.google.android.gms.games.internal.zzbm.dispatchTransaction(com.google.android.gms:play-services-games@@19.0.0:23) E/xyz.luan.games.play.playgames.Request( 2100): at com.google.android.gms.internal.games.zza.onTransact(com.google.android.gms:play-services-games@@19.0.0:13) E/xyz.luan.games.play.playgames.Request( 2100): at android.os.Binder.execTransact(Binder.java:674)

    opened by jrmarkham 1
  • fix: cleanup pendingOperation variable after successful operation

    fix: cleanup pendingOperation variable after successful operation

    I just encountered and fixed the issue mentioned in #8 While working on fixing this issue I noticed that showAllLeaderboards() and showAchievements() have the same issue. To fix the issue I simply added a result(new HashMap<>()); to the onSuccess functions.

    close #8

    opened by r1sim 1
  • PlayGames.showLeaderboard concurrent exception

    PlayGames.showLeaderboard concurrent exception

    Oppening PlayGames.showLeaderboard("") closing and opening again throws exception: "Unhandled Exception: PlatformException(error, signIn/showAchievements/showLeaderboard/saved games/snapshots cannot be used concurrently!, null)"

    This does not happen when PlayGames.showAchievements() is called two times

    opened by krizda 1
  • Show default leaderboard

    Show default leaderboard

    Please implement a function to show default leaderboard of Game Play. Thank you for creating this lib.

    private static final int RC_LEADERBOARD_UI = 9004;
    
    private void showLeaderboard() {
      Games.getLeaderboardsClient(this, GoogleSignIn.getLastSignedInAccount(this))
          .getLeaderboardIntent(getString(R.string.leaderboard_id))
          .addOnSuccessListener(new OnSuccessListener<Intent>() {
            @Override
            public void onSuccess(Intent intent) {
              startActivityForResult(intent, RC_LEADERBOARD_UI);
            }
          });
    }
    

    https://developers.google.com/games/services/android/leaderboards

    opened by vimask 1
  • Issue #12: requested changes

    Issue #12: requested changes

    Resolves #12

    This is a fork of the PR from https://github.com/flame-engine/play_games/pull/16 with the requested changes. I also ran into the underlying issue of #12 and didn't want the PR to get too stale.

    Warning though, I'm having some issues verifying the changes due, I think, to the age of some of the settings in these projects (earlier sdks and gradle versions and androidx fun), so consider this untested.

    opened by azack 0
  • Feature/additional features

    Feature/additional features

    I closed original pull request and created it again, as I created it previous from forks master - which blocked me a little. This one pull request contain (if there will be next ones they will be smaller):

    • signOut method
    • getting last account
    • display leaderboard list method
    opened by kuba91 0
  • Work for iOS

    Work for iOS

    For iOS, there is no GPGS! The iOS implementation, for now, should just always return the iOS error code I've added to the enum, so that it can be easily handled by the application. Right now since there is no iOS implementation whatsoever it will just fail catastrophically.

    Later on, we might take a look into Apple Game Center stuff.

    opened by luanpotter 0
  • Duplicate class com.google.android.gms.common.api.internal.zza found in modules jetified-play-services-base-15.0.1-runtime

    Duplicate class com.google.android.gms.common.api.internal.zza found in modules jetified-play-services-base-15.0.1-runtime

    When I run flutter run --no-sound-null-safety this is an output: ` Launching lib/main.dart on LG H870 in debug mode... Running Gradle task 'assembleDebug'...

    FAILURE: Build failed with an exception.

    • What went wrong: Execution failed for task ':app:checkDebugDuplicateClasses'.

    A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable Duplicate class com.google.android.gms.common.api.internal.zza found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.6.0-runtime (com.google.android.gms:play-services-basement:17.6.0) Duplicate class com.google.android.gms.common.api.internal.zzb found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.6.0-runtime (com.google.android.gms:play-services-basement:17.6.0) Duplicate class com.google.android.gms.common.api.internal.zzc found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.6.0-runtime (com.google.android.gms:play-services-basement:17.6.0) Duplicate class com.google.android.gms.common.api.internal.zzd found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.6.0-runtime (com.google.android.gms:play-services-basement:17.6.0) Duplicate class com.google.android.gms.common.api.zza found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.6.0-runtime (com.google.android.gms:play-services-basement:17.6.0) Duplicate class com.google.android.gms.common.api.zzb found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.6.0-runtime (com.google.android.gms:play-services-basement:17.6.0) Duplicate class com.google.android.gms.common.internal.zzb found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.6.0-runtime (com.google.android.gms:play-services-basement:17.6.0) Duplicate class com.google.android.gms.common.internal.zzc found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.6.0-runtime (com.google.android.gms:play-services-basement:17.6.0) Duplicate class com.google.android.gms.common.internal.zzd found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.6.0-runtime (com.google.android.gms:play-services-basement:17.6.0) Duplicate class com.google.android.gms.common.internal.zzf found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.6.0-runtime (com.google.android.gms:play-services-basement:17.6.0) Duplicate class com.google.android.gms.common.internal.zzg found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.6.0-runtime (com.google.android.gms:play-services-basement:17.6.0) Duplicate class com.google.android.gms.common.internal.zzk found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.6.0-runtime (com.google.android.gms:play-services-basement:17.6.0) Duplicate class com.google.android.gms.common.internal.zzl found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.6.0-runtime (com.google.android.gms:play-services-basement:17.6.0) Duplicate class com.google.android.gms.common.internal.zzm found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.6.0-runtime (com.google.android.gms:play-services-basement:17.6.0) Duplicate class com.google.android.gms.common.internal.zzn found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.6.0-runtime (com.google.android.gms:play-services-basement:17.6.0) Duplicate class com.google.android.gms.common.zza found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.6.0-runtime (com.google.android.gms:play-services-basement:17.6.0) Duplicate class com.google.android.gms.dynamic.zza found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.6.0-runtime (com.google.android.gms:play-services-basement:17.6.0) Duplicate class com.google.android.gms.dynamic.zzb found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.6.0-runtime (com.google.android.gms:play-services-basement:17.6.0)

     Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.
    
    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    • Get more help at https://help.gradle.org

    Maybe some plugins don't like eachother.

    pubspec.yaml: dependencies: provider: ^5.0.0 intl: ^0.17.0 auto_size_text: ^3.0.0-nullsafety.0 flutter_staggered_animations: ^1.0.0 sqflite: ^2.0.0+3 shared_preferences: ^2.0.5 audioplayers: ^0.18.3 flutter_phoenix: ^1.0.0 url_launcher: ^6.0.3 in_app_purchase: ^1.0.4 play_games: ^0.5.5 quiver: ^3.0.1 google_mobile_ads: ^0.13.0 flutter_staggered_grid_view: ^0.4.0 flutter_screenutil: ^5.0.0+2 tuple: ^2.0.0 cupertino_icons: ^1.0.3 gradient_nav_bar: git: url: https://github.com/adam-podkowinski/gradient-nav-bar flutter: sdk: flutter dev_dependencies: icon_font_generator: ^2.0.0 pedantic: ^1.11.0 flutter_test: sdk: flutter

    opened by adam-podkowinski 0
  • Error while signing in

    Error while signing in

    Hi, I am getting following error while trying to signing in [VERBOSE-2:ui_dart_state.cc(177)] Unhandled Exception: type 'String' is not a subtype of type 'Map<dynamic, dynamic>' in type cast #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:167:41) #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:340:12) #2 PlayGames.signIn (package:play_games/play_games.dart:338:54)

    opened by chaitu750 1
  • The new embedding does not support the old FlutterView.

    The new embedding does not support the old FlutterView.

    Plugin Version: play_games 0.5.5

    Calling await PlayGames.setPopupOptions() after successful signin throws an exception:

    Looks like #12 that was resolved.

    E/MethodChannel#play_games(19979): java.lang.UnsupportedOperationException: The new embedding does not support the old FlutterView.
    E/MethodChannel#play_games(19979): 	at io.flutter.embedding.engine.plugins.shim.ShimRegistrar.view(ShimRegistrar.java:82)
    E/MethodChannel#play_games(19979): 	at xyz.luan.games.play.playgames.Request.setPopupOptions(Request.java:192)
    E/MethodChannel#play_games(19979): 	at xyz.luan.games.play.playgames.Request.handle(Request.java:95)
    E/MethodChannel#play_games(19979): 	at xyz.luan.games.play.playgames.PlayGamesPlugin.onMethodCall(PlayGamesPlugin.java:142)
    E/MethodChannel#play_games(19979): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:230)
    E/MethodChannel#play_games(19979): 	at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
    E/MethodChannel#play_games(19979): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:692)
    E/MethodChannel#play_games(19979): 	at android.os.MessageQueue.nativePollOnce(Native Method)
    E/MethodChannel#play_games(19979): 	at android.os.MessageQueue.next(MessageQueue.java:335)
    E/MethodChannel#play_games(19979): 	at android.os.Looper.loop(Looper.java:183)
    E/MethodChannel#play_games(19979): 	at android.app.ActivityThread.main(ActivityThread.java:7656)
    E/MethodChannel#play_games(19979): 	at java.lang.reflect.Method.invoke(Native Method)
    E/MethodChannel#play_games(19979): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
    E/MethodChannel#play_games(19979): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
    E/flutter (19979): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: PlatformException(error, The new embedding does not support the old FlutterView., null)
    E/flutter (19979): #0      StandardMethodCodec.decodeEnvelope 
    package:flutter/…/services/message_codecs.dart:572
    E/flutter (19979): #1      MethodChannel._invokeMethod 
    package:flutter/…/services/platform_channel.dart:161
    E/flutter (19979): <asynchronous suspension>
    E/flutter (19979): #2      MethodChannel.invokeMethod 
    package:flutter/…/services/platform_channel.dart:334
    E/flutter (19979): #3      PlayGames.setPopupOptions 
    package:play_games/play_games.dart:148
    E/flutter (19979): #4      UserService.loadUser 
    package:in_common/services/user-service.dart:23
    
    flutter doctor -v output
    [√] Flutter (Channel stable, 1.20.4, on Microsoft Windows [Version 10.0.18363.1082], locale en-IL)
        • Flutter version 1.20.4 at C:\bin\flutter
        • Framework revision fba99f6cf9 (2 weeks ago), 2020-09-14 15:32:52 -0700
        • Engine revision d1bc06f032
        • Dart version 2.9.2
    
     
    [√] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
        • Android SDK at C:\Users\tzachov\AppData\Local\Android\sdk
        • Platform android-30, build-tools 30.0.1
        • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
        • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
        • All Android licenses accepted.
    
    [√] Android Studio (version 4.0)
        • Android Studio at C:\Program Files\Android\Android Studio
        • Flutter plugin version 47.1.2
        • Dart plugin version 193.7361
        • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    
    [√] VS Code, 64-bit edition (version 1.49.2)
        • VS Code at C:\Program Files\Microsoft VS Code
        • Flutter extension version 3.15.0
    
    [√] Connected device (1 available)
        • sdk gphone x86 (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator)
    
    • No issues found!
    
    opened by tzachov 0
  • Error: Failed to silent signin, trying explicit signin - com.google.android.gms.common.api.ApiException: 4: 4:

    Error: Failed to silent signin, trying explicit signin - com.google.android.gms.common.api.ApiException: 4: 4:

    I am trying to test my project but when I call signIn method I get this error, I followed everything of this tutorial: https://github.com/flame-engine/play_games/blob/master/doc/signin.md

    My app isn't published yet on Play Store, could it be the problem?

    About meta-data, I am setting my appid directly, and I am confused about gms version, if i need to create @integers, and where etc...

    meta

    I/xyz.luan.games.play.playgames.PlayGamesPlugin( 9780): Failed to silent signin, trying explicit signin I/xyz.luan.games.play.playgames.PlayGamesPlugin( 9780): com.google.android.gms.common.api.ApiException: 4: 4: I/xyz.luan.games.play.playgames.PlayGamesPlugin( 9780): at com.google.android.gms.common.internal.ApiExceptionUtil.fromStatus(Unknown Source) I/xyz.luan.games.play.playgames.PlayGamesPlugin( 9780): at com.google.android.gms.common.internal.zai.zaf(Unknown Source) I/xyz.luan.games.play.playgames.PlayGamesPlugin( 9780): at com.google.android.gms.common.internal.zaj.onComplete(Unknown Source) I/xyz.luan.games.play.playgames.PlayGamesPlugin( 9780): at com.google.android.gms.common.api.internal.BasePendingResult.zaa(Unknown Source) I/xyz.luan.games.play.playgames.PlayGamesPlugin( 9780): at com.google.android.gms.common.api.internal.BasePendingResult.setResult(Unknown Source) I/xyz.luan.games.play.playgames.PlayGamesPlugin( 9780): at com.google.android.gms.auth.api.signin.internal.zzj.zzc(Unknown Source) I/xyz.luan.games.play.playgames.PlayGamesPlugin( 9780): at com.google.android.gms.auth.api.signin.internal.zzt.dispatchTransaction(Unknown Source) I/xyz.luan.games.play.playgames.PlayGamesPlugin( 9780): at com.google.android.gms.internal.auth-api.zzd.onTransact(Unknown Source) I/xyz.luan.games.play.playgames.PlayGamesPlugin( 9780): at android.os.Binder.execTransact(Binder.java:453)

    I/flutter (11282): ERRO GOOGLE PLAY GAMES: Unexpected error Status{statusCode=INTERNAL_ERROR, resolution=null}

        void signIn() async {
    
        isLoading = true;
    
        SigninResult result = await PlayGames.signIn();
        if (result.success) {
          await PlayGames.setPopupOptions();
    
          //user = User(result.account);
          Account profile = result.account;
    
          print("NOME DA CONTA: ${profile.displayName}");
          print("hiResImageUri DA CONTA: ${profile.hiResImageUri}");
          print("iconImageUri DA CONTA: ${profile.iconImageUri}");
    
        } else {
          String error = result.message;
          print("ERRO GOOGLE PLAY GAMES: $error");
        }
    
        isLoading = false;
      }
    
    opened by d-apps 8
  • I can't log in

    I can't log in

    Hi, there is a note: xyz/luan/games/play/playgames/Request.java uses or overrides a deprecated API. And a message: I/xyz.luan.games.play.playgames.PlayGamesPlugin(16663): Failed to silent signin, trying explicit signin The example application does not work either.

    opened by Schnurber 5
Owner
Flame Engine
2D game engine built on top of Flutter
Flame Engine
Games - Simple games created in flutter

games Simple games created in flutter UI

Bunyod 1 Jan 21, 2022
An awesome list that curates the best Flame games, projects, libraries, tools, tutorials, articles and more.

Awesome Flame A curated list of games, libraries, and articles related to the Flame Engine for Flutter. Flame is a minimalist 2D game engine for Flutt

Flame Engine 650 Jan 9, 2023
Ember 8 is a Fantasy Console built on top of Flutter/Flame

Ember 8 Ember 8 is a Fantasy Console built on top of Flutter/Flame. It will feature an editor to create games and a console app to play the created ga

Erick 12 Oct 21, 2022
SpriteWidget Viktor LidholtSpriteWidget [1143⭐] - Toolkit for building complex, high performance animations and 2D games by Viktor Lidholt.

SpriteWidget SpriteWidget is a toolkit for building complex, high performance animations and 2D games with Flutter. Your sprite render tree lives insi

null 1.2k Dec 7, 2022
A graphics engine for creating 2D games. Creating objects based on composition and painting on canvas.

A graphics engine for creating 2D games. Creating objects based on composition and painting on canvas.

Stanislav 10 Oct 26, 2022
An example Flutter app showing how to easily integrate with Flame games

space_burger A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if

Erick 4 Jun 4, 2021
A social media for games.

Gamiac A gaming social media app. Play, Post & Interact . Download Gamiac Are you a Gamer ?? ? If yes then GAMIAC is especially for YOU ?? . What is G

ANIKET SINDHU 20 Jul 15, 2021
Epic Games Flutter UI

Epic Games Flutter UI A flutter implementation of the Epic Games Concept Home Page by Andrey Artamonov. A screenshot: Getting Started ?? You need the

Albert Oboh 115 Nov 5, 2022
🃏 Get coinched ! Flutter app using Firebase SDK to save your card games

?? Get coinched ! Flutter app using Firebase SDK to save your card games. You can save your games of French Belote, Coinche Belote, Contrée Belote or Tarot and compare your statistics with your friends

Valentin REVERSAT 4 Dec 26, 2022
Games Poker developed using Flutter

Adeku Akur (Aku dan Kamu Devs Games Asian Poker User) Games Poker developed usin

Ananda Rauf 1 Dec 21, 2021
Mini Game Manager for games

Mini-Game-Manager Mini Game Manager for games that don't come on your favorite platforms such as steam or origin. The focus of this app is to create a

Mehrzad Bazhdanzadeh 2 Nov 3, 2022
EscapeGameKit is a package, entirely built using Flutter, that helps creating escape games.

??️‍♂️ EscapeGameKit EscapeGameKit is a package, entirely built using Flutter, that helps creating escape games. It is better suited for web and deskt

Hugo Delaunay 10 Dec 24, 2022
Frame is yet another map editor for Pokémon GBA games

Frame Frame is yet another map editor for Pokémon GBA games. Features Undo / redo ... and many more to come! This project is still in its very early s

null 8 Oct 31, 2022
Collection of 2D mobile games in a single mobile application.

Omaplay A Collection of 2D mobile games in a single mobile application Oma what ? Omaplay... I had the idea to create a mobile application that will c

Brice Kamhoua 2 Sep 14, 2022
Snake-Game - A flutter based classic snake game with nothing just and just a feel to have play

snake_game This is a simple snake Game under development made with the help of y

Shubham Kumar 2 Mar 22, 2022
A Flutter plugin to play multiple audio files simultaneously (Android/iOS)

AudioPlayers A Flutter plugin to play multiple simultaneously audio files, works for Android, iOS, macOS and web. Contributing We now have new rules f

Blue Fire 1.5k Dec 30, 2022
A Flutter plugin to play multiple audio files simultaneously (Android/iOS)

AudioPlayers A Flutter plugin to play multiple simultaneously audio files, works for Android, iOS, macOS and web. Contributing We now have new rules f

Blue Fire 1.5k Jan 7, 2023
Flutter Switch Game: Get Fun With Play This Game

switch_game A new Flutter project. Getting Started Try Swap red circle to green

Sermed Berwari 1 Jun 17, 2022
A slide puzzle game you can play with your friend on cross-platform.

slideparty Inspiration I want to make a puzzle game that runs on all platforms: Web, Android, iOS, Linux, Windows and MacOS. You can play with your fr

Duong Bui Dai 29 Nov 23, 2022