android - Google Drive Authorization Error with Unity 3D plugin -


i've got problem google drive service android app. it's unity 3d project includes plugin use google drive api https://github.com/midworld/unity-googledrive

i used plugin on pc builds , works fine. oauth2 authorization works, working token, , can write, delete, download, etc. files google drive of logged in google user account. on pc plugin uses web requests comunicate google drive.

but when try use plugin on android device can't authorize , oauth2 token google service. on android devices plugin uses google drive api. think error rooted in manifest.xml, since still not sure should contain.

the error messages:

i/unity   (17269): start authorization d/unity-googledriveplugin(17269): setunityactivity: com.unity3d.player.unityplayernativeactivity@423bbdd0 d/unity-googledriveplugin(17269): auth accountname: dino******@******.com w/abstractgoogleclient(17269): application name not set. call builder#setapplicationname. d/unity-googledriveplugin(17269): google drive service: com.google.api.services.drive.drive@423aa280 w/dalvikvm(17269): vfy: unable resolve static field 634 (auth_client_play_services_err_notification_msg) in lcom/google/android/gms/r$string; d/dalvikvm(17269): vfy: replacing opcode 0x60 @ 0x001a i/dalvikvm(17269): dexopt: unable optimize static field ref 0x027b @ 0x42 in lcom/google/android/gms/auth/googleauthutil;.a i/dalvikvm(17269): dexopt: unable optimize static field ref 0x0279 @ 0x4d in lcom/google/android/gms/auth/googleauthutil;.a w/dalvikvm(17269): vfy: unable resolve static field 642 (common_google_play_services_install_title) in lcom/google/android/gms/r$string; d/dalvikvm(17269): vfy: replacing opcode 0x60 @ 0x0041 w/dalvikvm(17269): vfy: unable resolve static field 638 (common_google_play_services_enable_title) in lcom/google/android/gms/r$string; d/dalvikvm(17269): vfy: replacing opcode 0x60 @ 0x004c w/dalvikvm(17269): vfy: unable resolve static field 648 (common_google_play_services_update_title) in lcom/google/android/gms/r$string; d/dalvikvm(17269): vfy: replacing opcode 0x60 @ 0x0057 w/dalvikvm(17269): vfy: unable resolve static field 645 (common_google_play_services_unsupported_title) in lcom/google/android/gms/r$string; d/dalvikvm(17269): vfy: replacing opcode 0x60 @ 0x0069 w/dalvikvm(17269): vfy: unable resolve static field 639 (common_google_play_services_install_button) in lcom/google/android/gms/r$string; d/dalvikvm(17269): vfy: replacing opcode 0x60 @ 0x0009 w/dalvikvm(17269): vfy: unable resolve static field 636 (common_google_play_services_enable_button) in lcom/google/android/gms/r$string; d/dalvikvm(17269): vfy: replacing opcode 0x60 @ 0x0010 w/dalvikvm(17269): vfy: unable resolve static field 646 (common_google_play_services_update_button) in lcom/google/android/gms/r$string; d/dalvikvm(17269): vfy: replacing opcode 0x60 @ 0x0017 w/dalvikvm(17269): vfy: unable resolve static field 643 (common_google_play_services_unknown_issue) in lcom/google/android/gms/r$string; d/dalvikvm(17269): vfy: replacing opcode 0x60 @ 0x0004 i/dalvikvm(17269): dexopt: unable optimize static field ref 0x0281 @ 0x18 in lcom/google/android/gms/common/googleplayservicesutil;.c i/dalvikvm(17269): dexopt: unable optimize static field ref 0x0280 @ 0x38 in lcom/google/android/gms/common/googleplayservicesutil;.c i/dalvikvm(17269): dexopt: unable optimize static field ref 0x027d @ 0x3f in lcom/google/android/gms/common/googleplayservicesutil;.c i/dalvikvm(17269): dexopt: unable optimize static field ref 0x0287 @ 0x46 in lcom/google/android/gms/common/googleplayservicesutil;.c i/dalvikvm(17269): dexopt: unable optimize static field ref 0x0284 @ 0x66 in lcom/google/android/gms/common/googleplayservicesutil;.c w/glsuser ( 5447): googleaccountdataservice.gettoken() w/glsactivity( 5447): [art] status wire: invalid_key status: null w/glsactivity( 5447): [art] status wire: invalid_key status: null i/glsuser ( 5447): gls error: invalid_key dino******@******.com oauth2:https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/drive.appdata w/glsactivity( 5447): [art] status wire: unknown status: unknown e/unity-googledriveplugin(17269): checkauthorized: com.google.android.gms.auth.googleauthexception: unknown i/unity   (17269): googledrive+exception: authorization failed. 

my manifest:

<?xml version="1.0" encoding="utf-8"?> <manifest      xmlns:android="http://schemas.android.com/apk/res/android"      android:installlocation="preferexternal"     package="com.studio272.unitydrivetest"      android:versionname="1.0"      android:versioncode="1">    <supports-screens      android:smallscreens="true"      android:normalscreens="true"      android:largescreens="true"      android:xlargescreens="true"      android:anydensity="true" />    <application      android:icon="@drawable/app_icon"      android:label="@string/app_name"      android:debuggable="false">      <activity          android:name="com.unity3d.player.unityplayerproxyactivity"          android:label="@string/app_name"          android:configchanges="fontscale|keyboard|keyboardhidden|locale|mnc|mcc|navigation|orientation|screenlayout|screensize|smallestscreensize|uimode|touchscreen"          android:screenorientation="portrait">        <intent-filter>         <action android:name="android.intent.action.main" />         <category android:name="android.intent.category.launcher" />       </intent-filter>     </activity>      <activity          android:name="com.unity3d.player.unityplayeractivity"          android:label="@string/app_name"          android:configchanges="fontscale|keyboard|keyboardhidden|locale|mnc|mcc|navigation|orientation|screenlayout|screensize|smallestscreensize|uimode|touchscreen"          android:screenorientation="portrait">     </activity>      <activity          android:name="com.unity3d.player.unityplayernativeactivity"          android:label="@string/app_name"          android:configchanges="fontscale|keyboard|keyboardhidden|locale|mnc|mcc|navigation|orientation|screenlayout|screensize|smallestscreensize|uimode|touchscreen"          android:screenorientation="portrait">       <meta-data android:name="android.app.lib_name" android:value="unity" />       <meta-data android:name="unityplayer.forwardnativeeventstodalvik" android:value="false" />     </activity>      <activity          android:name="com.unity3d.player.videoplayer"          android:label="@string/app_name"          android:screenorientation="behind"          android:configchanges="fontscale|keyboard|keyboardhidden|locale|mnc|mcc|navigation|orientation|screenlayout|screensize|smallestscreensize|uimode|touchscreen">     </activity>      <activity          android:name="com.studio272.googledriveplugin.googledrivepluginactivity"          android:theme="@android:style/theme.translucent.notitlebar">         <meta-data android:name="com.google.android.apps.drive.app_id" android:value="id=318737920467" />     </activity>   </application>    <uses-feature android:glesversion="0x00020000" />     <uses-permission android:name="android.permission.get_accounts" />     <uses-permission android:name="android.permission.use_credentials" />     <uses-permission android:name="android.permission.manage_accounts" />     <uses-permission android:name="android.permission.internet" />   <uses-sdk android:minsdkversion="8" android:targetsdkversion="17" /> </manifest> 

i found solution. in unity 3d have keystore , bundle unity should use sign apk file.

so under "edit -> project settings -> player" in section "android -> publishing settings" had brows keystore using , enter password keystore. pick "alias" , enter password again

furthermore in "android section -> other settings" had set "bundle identifier" package name google developer console.

now authentification oauth2 token works , can work google drive.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -