Iku
Iku

Reputation: 1

play-games-plugin-for-unity.Status from wire: NeedPermission status: NEED_PERMISSION

I'm using play-games-plugin-for-unity 0.8.01. I setup all configs(androidmanifest.xml,ids.xml,google play console,and etc...),and iOS succeed. But Android(Galaxy S2 LTE) failed at "Social.localUser.Authenticate".

the code is

    Social.localUser.Authenticate((bool success) => {
        // handle success or failure
        if (success) {
            Debug.Log("Login Success");
            loginflag = true;
        } else {
            ((PlayGamesPlatform) Social.Active).SignOut();
            Debug.Log("Login Failed");
        }
    });

Here is log I got in Logcat:

I/Unity   (15007): [Play Games Plugin DLL] AUTH: Initial achievement load call made.
I/Unity   (15007):  
I/Unity   (15007): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 53)
I/Unity   (15007): 
W/SurfaceFlinger(  164): id=745 Removed idx=4 Map Size=5
W/GameHelper(15007): GameHelper: client was already connected on onStart()
W/SurfaceFlinger(  164): id=745 Removed idx=-2 Map Size=5
D/PluginSupport/SignInHelperActivity(15007): onStop()
D/GameHelper(15007): GameHelper: onStop
D/GameHelper(15007): GameHelper: Disconnecting client due to onStop
I/AchievementAgent( 5962): Sending achievement batch...
W/GLSUser ( 5925): GoogleAccountDataService.getToken()
V/GLSUser ( 5925): DEBUG: loginOption to be added: clientPackageName
V/GLSUser ( 5925): DEBUG: loginOption to be added: callerUid
V/GLSUser ( 5925): DEBUG: loginOption to be added: request_visible_actions
V/GLSUser ( 5925): DEBUG: loginOption to be added: androidPackageName
V/GLSUser ( 5925): DEBUG: loginOption to be added: suppressProgressScreen
I/APACHE HTTP (thCr=3674) - NafHttpAuthStrategyDefault( 5925): (thUse=3723)    cached value : gbaSupportIsPossible=false
I/APACHE HTTP (thCr=3674) - NafHttpAuthStrategyDefault( 5925): (thUse=3723) It is impossible to support GBA now (many possible reasons: no Android Context, current client is GBA service, etc.), then it will be just usual HTTP.
I/APACHE HTTP (thCr=3723) - NafRequestExecutorWrapperRedirectionHandler( 5925): (thUse=3723)    It isn't GBA flow, redirection responses are not handled.
I/AndroidHttpClient$2( 5925): executeRequestSending()   director.getClass()=class org.apache.http.impl.client.DefaultRequestDirector
I/AndroidHttpClient$2( 5925): execute()   finalHttpResponse.getStatusLine()=HTTP/1.1 200 OK
I/AndroidHttpClient$2( 5925): execute()#finished

W/GLSActivity( 5925): [anc] Status from wire: NeedPermission status: NEED_PERMISSION
E/DataHolderOperation( 5962): Auth error while performing operation, requesting reconnect
E/DataHolderOperation( 5962): alg: NeedPermission
E/DataHolderOperation( 5962):   at akt.a(SourceFile:371)
E/DataHolderOperation( 5962):   at bjn.b(SourceFile:91)
E/DataHolderOperation( 5962):   at biy.b(SourceFile:834)
E/DataHolderOperation( 5962):   at dec.b(SourceFile:133)
E/DataHolderOperation( 5962):   at biy.b(SourceFile:451)
E/DataHolderOperation( 5962):   at biy.a(SourceFile:421)
E/DataHolderOperation( 5962):   at biy.a(SourceFile:400)
E/DataHolderOperation( 5962):   at dec.a(SourceFile:147)
E/DataHolderOperation( 5962):   at coz.a(SourceFile:676)
E/DataHolderOperation( 5962):   at coz.a(SourceFile:637)
E/DataHolderOperation( 5962):   at coz.a(SourceFile:1055)
E/DataHolderOperation( 5962):   at coz.a(SourceFile:980)
E/DataHolderOperation( 5962):   at cph.b(SourceFile:1403)
E/DataHolderOperation( 5962):   at dko.b(SourceFile:33)
E/DataHolderOperation( 5962):   at dkb.a(SourceFile:47)
E/DataHolderOperation( 5962):   at com.google.android.gms.games.service.GamesIntentService.a(SourceFile:617)
E/DataHolderOperation( 5962):   at bcd.run(SourceFile:150)
E/DataHolderOperation( 5962):   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
E/DataHolderOperation( 5962):   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
E/DataHolderOperation( 5962):   at java.util.concurrent.FutureTask.run(FutureTask.java:137)
E/DataHolderOperation( 5962):   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
E/DataHolderOperation( 5962):   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
E/DataHolderOperation( 5962):   at java.lang.Thread.run(Thread.java:856)
I/Unity   (15007): [Play Games Plugin DLL] OnAchievementsLoadedResultProxy invoked
I/Unity   (15007):  
I/Unity   (15007): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 53)
I/Unity   (15007): 
I/Unity   (15007): [Play Games Plugin DLL]     result=UnityEngine.AndroidJavaObject
I/Unity   (15007):  
I/Unity   (15007): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 53)
I/Unity   (15007): 
I/Unity   (15007): [Play Games Plugin DLL] AUTH: Initial achievement load finished.
I/Unity   (15007):  
I/Unity   (15007): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 53)
I/Unity   (15007): 
W/Unity   (15007): !!! [Play Games Plugin DLL]  WARNING: AUTH: Failed to load achievements, status code 2
W/Unity   (15007):  
W/Unity   (15007): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 53)
W/Unity   (15007): 
I/Unity   (15007): [Play Games Plugin DLL] AUTH: Calling auth callback: success=False
I/Unity   (15007):  
I/Unity   (15007): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 53)
I/Unity   (15007): 
I/Unity   (15007): [Play Games Plugin DLL] AndroidClient.SignOut
I/Unity   (15007):  
I/Unity   (15007): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 53)
I/Unity   (15007): 
I/Unity   (15007): [Play Games Plugin DLL] Action scheduled for later (connection currently in progress).
I/Unity   (15007):  
I/Unity   (15007): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 53)
I/Unity   (15007): 
I/Unity   (15007): [Play Games Plugin DLL] AndroidClient.SignOut
I/Unity   (15007):  
I/Unity   (15007): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 53)
I/Unity   (15007): 
I/Unity   (15007): [Play Games Plugin DLL] Action scheduled for later (connection currently in progress).
I/Unity   (15007):  
I/Unity   (15007): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 53)
I/Unity   (15007): 
I/Unity   (15007): Google Login Failed

manifest permission is below:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />

and also add below :

    <meta-data android:name="android.app.lib_name" android:value="unity" />
    <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
    <meta-data android:name="com.google.android.gms.games.APP_ID" android:value="@string/app_id" />
    <meta-data android:name="com.google.android.gms.appstate.APP_ID" android:value="@string/app_id" />
    <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />

Although various methods were tried or being searched, solution is completely troubled by the ability not to do. It signs out once as it is, and if it tries again, it becomes impossible to log in in the error same again, although it may succeed very rarely. I would like to solve somehow -- counsel -- I would appreciate your favor.

Sorry for my bad english.

Upvotes: 0

Views: 1683

Answers (2)

Iku
Iku

Reputation: 1

I solved this problem myself.

Sorry,I deleted the google directory on my Android.

So,I play another application which have google achievement that made another google api. My Android made the google directory(Perhaps,com.android.apps.genie.geniewidget.news-content-cache or com.google.android.youtube). And then,this problem doesn't happen.

Perhaps,play-games-plugin-for-unity have issue that the necessary directory does not make if does not exist. So,now I searching this solution.

Upvotes: 0

Ian Barber
Ian Barber

Reputation: 19980

If you're getting bad NEEDS_PERMISSION errors on a specific device, can you check the clock on the device? If it is too out of sync then the grant from Google might be expiring before the user has been marked as signed in.

Upvotes: 1

Related Questions