Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by TadeuszSynZygmunta · Oct 12, 2014 at 11:08 AM · android

Google Play Game Services plugin problem

I want to implement Google Play Game Services in my android game. I'm using this plugin: https://github.com/playgameservices/play-games-plugin-for-unity

I downloaded latest version (0.9.06) and imported to my unity project. I've done everything like in this video: https://www.youtube.com/watch?v=XmHXl-UFTqM I turn on the game and I log in to my play games account correctly, but when I want to post score, unlock achivement, open leaderboard screen or achivements screen, absolutely nothing is happen, I don't know why, do you think that is because I'm using Unity beta 4.6.0b20?

Here is my code:

 using UnityEngine.UI;
 using UnityEngine;
 using System.Collections;
 using UnityEngine.SocialPlatforms;
 using GooglePlayGames;
 
 
 public class MainMenu : MonoBehaviour {
  
     void Awake () {
         PlayGamesPlatform.Activate();
     }
 
     void Start () {
         Social.Active.localUser.Authenticate((bool success) => {
             // handle success or failure
         });
     }
 
     public void HighScoresButtonClicked () {
         Social.Active.ShowLeaderboardUI();
     }
          
         public void Unlock Achivement () {
                 Social.ReportProgress("achivementID", 100.0f, (bool success) => {
                       // handle success or failure
                 });        
         }
 
     public void ExitClicked () {
         Application.Quit();
     }
 
 }
 
Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image santino94 · Oct 12, 2014 at 03:39 PM 0
Share

I have the same problem...

avatar image liortal · Oct 12, 2014 at 08:38 PM 0
Share

are you testing this on a device? if so, can you please attach the logcat output from the device?

avatar image TadeuszSynZygmunta · Oct 13, 2014 at 04:13 PM 0
Share

W/Unity (12589): *** [Play Games Plugin DLL] ERROR: Show$$anonymous$$erboardUI can only be called after authentication.

But I did authentication on start.

EDIT: I don't know how, but it works now, I do nothing and it works :D

avatar image Mosy · Oct 27, 2014 at 04:30 PM 0
Share

I am also having this problem, I am using Unity 4.6 Beta 20, Google Play Services Rev. 20 and I am also using a first gen Nexus 7 tablet, with Google Play Games set to automatically the latest updates. The problem that I seem to get the most is when it says Show$$anonymous$$erboardUI not implemented. This is the only thing that I really need to get fixed before my game can be published.

avatar image harikishan · Apr 03, 2015 at 11:07 AM 0
Share

how can i know whether user authenticated or not, am unable to find whether user is logged in or not. Social.Active.localUser.Authenticate((bool success) => { // handle success or failure });

I used above code for user authentication and also i activated googleplaygames in start method

Help me regarding this authentication issue

4 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by santino94 · Oct 13, 2014 at 04:12 PM

This is my LogCat:

I/Unity ( 4300): [Play Games Plugin DLL] GHM/GameHelperListener got onSignInSucceeded, origin 1000, notifying GHM.

I/Unity ( 4300): I/Unity ( 4300): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49) I/Unity ( 4300):

I/Unity ( 4300): [Play Games Plugin DLL] GHM got onSignInSucceeded, origin 1000, notifying AndroidClient. I/Unity ( 4300): I/Unity ( 4300): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49) I/Unity ( 4300):

I/Unity ( 4300): [Play Games Plugin DLL] AndroidClient got OnSignInSucceeded. I/Unity ( 4300):

I/Unity ( 4300): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49) I/Unity ( 4300): I/Unity ( 4300): [Play Games Plugin DLL] Attempting to retrieve player info. I/Unity ( 4300): I/Unity ( 4300): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49) I/Unity ( 4300):

I/Unity ( 4300): AndroidJavaException: java.lang.NoSuchMethodError: no methodwith name='getClass' signature='()Ljava/lang/Object;' in class Lcom/google/android/gms/common/api/b; I/Unity ( 4300): at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in :0

I/Unity ( 4300): at UnityEngine.AndroidJNISafe.GetMethodID (IntPtr obj, System.String name,System.String sig) [0x00000] in :0

I/Unity ( 4300): at UnityEngine._AndroidJNIHelper.GetMethodID (IntPtr jclass, System.String methodName, System.String signature, Boolean isStatic) [0x00000] in :0

I/Unity ( 4300): at UnityEngine.AndroidJNIHelper.GetMethodID (IntPtr javaClass, System.String methodName, System.String signature, Boolean isStatic) [0x00000] in :0

I/Unity ( 4300): at UnityEngine._AndroidJNIHelper.GetMethodID[AndroidJavaObject] (IntPtr jclass, System.String methodName, System.Object[] args, Boolean isStatic) [0x00000] in :0

I/Unity ( 4300): at UnityEngine.AndroidJNIHelper.GetMethodID[AndroidJavaObject] (IntPtr jclass, System.String methodName, System.Object[] arg

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image liortal · Oct 13, 2014 at 09:26 PM 0
Share

What device are you using? Can you verify what version of Google Play Services is installed there?

avatar image santino94 · Oct 14, 2014 at 10:24 AM 0
Share

I'm using: http://phonepad.mediacomeurope.it/Prodotti/Scheda.aspx?XRC=$$anonymous$$-PPAS501 with Google Play Services 6.1.11

I'm using too: Unity 4.5.4f1 GPG 0.9.06

avatar image
0

Answer by AlfonsoC · Nov 05, 2014 at 05:52 PM

Hi, i think the problem is in how you call the showLeaderBoard method, only use Social.ShowLeaderBoard() instead of Social.Active.ShowLeaderBoard() for me worked fine and in the github doc says this way too showing the leaderboard

good luck

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by TheOtherJoJo · Sep 01, 2015 at 08:48 PM

I had success only when I have created the app on the production tab. Don't publish it until you are ready to push it the store though, but it will still allow you to test achievements and such.

When i published to beta or alpha I never got it to authenticate.

Here is a youtube video of the whole process. https://www.youtube.com/watch?v=XmHXl-UFTqM

If you get those DEX errors just make sure you read the log in the console to find the offending file that keeps it from compiling. When you find the file(s), do a search in your project folder and delete the duplicates. You get these duplicates when you use plugins that uses the same .jar files.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by wuym67123 · Feb 16, 2017 at 01:53 PM

You can Use Google Service Unity Plugin

Google Service Unity Plugin is a Unity Plugin For Google Service.Include Google Admob Unity,Firebase Analytic Unity,Google Game API Unity. Login,Achievement,Leaderboard,Event,Quest,Snapshot,RealTimePlayGame,TurnbasedPlayGame API are supported and easy to use with c# or js.

Unity Plugin Wiki and Documentation

Unity Admob API Unity Firebase Analytic API Unity Google Game API Unity Admob Tutorial Unity Firebase Analytic Tutorial Unity Play Game Service Tutorial Firebase Remote config and log Quick Start

Installation Google Play Game Service Unity Plugin

Open your project in the Unity editor. Navigate to Assets -> Import Package -> Custom Package. Select the google_service_unity_plugin.unitypackage file. Import all of the files for the plugins by selecting Import. Make sure to check for any conflicts with files.playgamedemo.cs and game.unity is demo file can be ignored. replace all "com.google.demo" with your app package id in AndroidManifest.xml replace app_id content with your google play game id,replace google_app_id content with your google firebase app id in ids.xml Show Admob Ads in Unity game

using admob; Admob.Instance().initAdmob("ca-app-pub-3940256099942544/2934735716", "ca-app-pub-3940256099942544/4411468910"); Admob.Instance().showBannerRelative(AdSize.Banner, AdPosition.BOTTOM_CENTER, 30, "defaultBanner"); just 2 line code,admob banner will been shown on screen.for more usage Unity Admob Tutorial

Analytic Unity game with firebase Analytic

using google.service.game; FirebaseAnalytic.Instance().logEvent("appstart", "{\"time\":\"112222\",\"name\":\"demouser\"}"); Log Event with Firebase Analytic.For more usage about Firebase Analytic Unity Unity Firebase Analytic Tutorial

Using Google Play Game Achievements and Leaderboards in Unity game

Login with google play service using google.service.game; GoogleGame.Instance().login (true, false); You can call google play game api after login success such as show Leaderboards with default UI GoogleGame.Instance().showLeaderboards(); Show Google play game Achievements with default UI GoogleGame.Instance().showAchievements(); 4.Fore more usage about google play game service in unity Unity Google Play Game Tutorial

https://github.com/unity-plugins/google-service-unity

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Require In App Billing suggestions for android 2 Answers

Help with c# script for new google play adverts 0 Answers

Failed to recompile android resource files. 1 Answer

After updating android sdk getting error “Package name is not a valid java package name” 0 Answers

Google Play Services Authentication Problem 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges