question

brendan avatar image
brendan asked

Trouble setting up Playfab...

Plasmalasgun
started a topic on Wed, 08 July 2015 at 8:53 PM

After downloading the latest PlayFabClientSDK.unitypackage

Importing the package yields:

"Assets/PlayFabSDK/Newtonsoft.Json/Linq/JPropertyDescriptor.cs(153,32): error CS0115: `Newtonsoft.Json.Linq.JPropertyDescriptor.NameHashCode' is marked as an override but no suitable property found to override"

if I were to comment this function ... several similar other errors pop up, i was wondering if any of you can tell me of the missing dependency or miscvonfiguration that might cause this...

I am programming on a windoes 7 environment and do not have either ios or android sdks (are these NECESSARY for the software to run in debug ?) Thanks!

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

17 Comments
zacb said on Thu, 09 July 2015 at 9:08 AM

Hey Plasmagun,

I am not able to reproduce this error message. You do not need any JDK / ADK packages to use PlayFab.

Can you provide some more information around your Unity Project?

What version of Unity are you using?
Are you trying to import this into a blank / new project or is this a project with existing assets?
If this is not a blank project, do you have any other packages that also use newtonsoft Json?

We have a customized build of newtonsoft that will conflict with other installations in a project. Experiment with deleting any other conflicting newtonsoft folders and dlls.

Let us know if you need additional help.

-Zac


sballew said on Fri, 10 July 2015 at 4:04 PM

I have this same issue. It only happens when building for Web Player. Things seem fine on Windows Standalone.

Looking at the Object Browser, the System.ComponentModel doesn't have the NameHashCode. Depending on the platform, the System.dll is different.

Standalone:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v3.5\Profile\Unity Subset v3.5\System.dll

Web:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Unity Web v3.5\System.dll

sballew said on Fri, 10 July 2015 at 7:25 PM

Oh, and some answers to the questions you posed, zacb:

1) I am on Unity 5.1.1

2) I reproduced the issue using just a blank project, importing the Playfab SDK, and switching it to Web Player.


zacb said on Mon, 13 July 2015 at 2:23 PM

Plasmagun, Sballew,

Thanks for the follow up and details. I will give this a look and report back what I find. Should have an update for you by the EoW.

-Zac


Josh.ethan.sagar said on Fri, 17 July 2015 at 10:26 AM

Looking for an answer to this as well. Cheers.


sballew said on Mon, 20 July 2015 at 10:17 AM

Is there anything more we can do to help with this issue?


zacb said on Fri, 24 July 2015 at 12:08 PM

Apologies for the delay. I have an update. We are having some issues with our serialization on some platforms. Until we get a permanent fix in our SDK, I can suggest the following work-around:

  • Remove the PlayFabSDK/Newtonsoft.Json folder

  • Replace the serialization library with an alternate Newtonsoft library

Alternative Libraries:

Hopefully these 2 alternates get you unblocked. We should have this resolved soon. I will post back here when our SDK has been updated.

-Zac


frggreg said on Fri, 31 July 2015 at 3:14 PM

Note that the DLL requires .NET 2.0 instead of .NET 2.0 Subset in the player settings. I think that's one thing the asset store version attempted to fix.

http://answers.unity3d.com/questions/732267/jsonnet-could-not-load-type-from-assembly.html

The plugin seems to have trouble with the ItemConverterType parameter of JsonPropertyAttribute:

PlayFabSDK/Public/PlayFabAdminModels.cs(77,18): error CS0117: Newtonsoft.Json.JsonPropertyAttribute' does not contain a definition forItemConverterType'


zacb said on Mon, 03 August 2015 at 2:21 PM

Yeah, that dll was just a stop-gap until we are done with fixing the underlying serialization issue.

We should have this resolved sometime this week or early into next week. Apologies for the inconvenience.

-Zac


zacb said on Thu, 13 August 2015 at 9:30 AM

@All,

Finally! You should have no issues with the latest SDK. Check it out here, and then let us know if your issue is resolved or are still finding errors..

-zac


lango said on Mon, 24 August 2015 at 8:01 PM

I'm receiving a different error related to serialization, but I wonder if it's also related.

This happens whenever I call PlayFabClientAPI.LoginWithPlayFab or PlayFabClientAPI.LoginWithEmailAddress.

Error 0: System.FormatException: Invalid format string
  at System.DateTime.ParseExact (System.String s, System.String[] formats, IFormatProvider provider, DateTimeStyles style) [0x0005c] in /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/DateTime.cs:1892 
  at System.DateTime.ParseExact (System.String s, System.String format, IFormatProvider provider, DateTimeStyles style) [0x0001c] in /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/DateTime.cs:1870 
  at PlayFab.Json.Converters.IsoDateTimeConverter.ReadJson (PlayFab.Json.JsonReader reader, System.Type objectType, System.Object existingValue, PlayFab.Json.JsonSerializer serializer) [0x0010e] in /Users/Laird/Code/LANGO/UNITY/Assets/PlayFabSDK/Internal/json/Converters/IsoDateTimeConverter.cs:126 
  at PlayFab.Json.Serialization.JsonSerializerInternalReader.CreateValueProperty (PlayFab.Json.JsonReader reader, PlayFab.Json.Serialization.JsonProperty property, System.Object target, Boolean gottenCurrentValue, System.Object currentValue) [0x0005b] in /Users/Laird/Code/LANGO/UNITY/Assets/PlayFabSDK/Internal/json/Serialization/JsonSerializerInternalReader.cs:197 
  at PlayFab.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue (PlayFab.Json.Serialization.JsonProperty property, PlayFab.Json.JsonReader reader, System.Object target) [0x00162] in /Users/Laird/Code/LANGO/UNITY/Assets/PlayFabSDK/Internal/json/Serialization/JsonSerializerInternalReader.cs:564 
  at PlayFab.Json.Serialization.JsonSerializerInternalReader.PopulateObject (System.Object newObject, PlayFab.Json.JsonReader reader, PlayFab.Json.Serialization.JsonObjectContract contract, System.String id) [0x00148] in /Users/Laird/Code/LANGO/UNITY/Assets/PlayFabSDK/Internal/json/Serialization/JsonSerializerInternalReader.cs:1196 
UnityEngine.Debug:Log(Object)
Manager.PlayFabManager:OnError(PlayFabError) (at Assets/Scripts/Manager/PlayFabManager.cs:221)
PlayFab.<GetUserCombinedInfo>c__AnonStorey8D:<>m__CD(String, String) (at Assets/PlayFabSDK/Public/PlayFabClientAPI.cs:645)
PlayFab.Internal.<MakeRequestViaUnity>c__Iterator5:MoveNext() (at Assets/PlayFabSDK/Internal/PlayFabHTTP.cs:242) 

I have updated to the latest SDK commit 0.2.150824


zacb said on Tue, 25 August 2015 at 9:47 AM

Hey Iango,

I just downloaded our latest SDK from the gitHub and successfully logged in with both Id & email. Can you provide some more details about your environment?

  • What version of Unity are you using?

  • What built target do you have selected?

  • Is this issue happening in the editor, device, built stand-alone, or all?

  • Did you install our SDK via a UnityAsset package or from the gitHub?

  • And any other details that would help me reproduce this issue.

Thanks,
Zac


zacb said on Tue, 25 August 2015 at 10:00 AM

Also I see PlayFabManager.cs in the stack trace. Are you using / reusing any portion of the DemoScene?

-z


lango said on Tue, 25 August 2015 at 5:38 PM

  • What version of Unity are you using? 5.1.2f1 personal

  • What built target do you have selected? iOS

  • Is this issue happening in the editor, device, built stand-alone, or all? editor (haven't tried others)

  • Did you install our SDK via a UnityAsset package or from the gitHub? gitHub sync, then imported package inside (did not copy folders)

  • And any other details that would help me reproduce this issue.

I have customised PlayFabManager.cs and added it to a new manager prefab. I don't think that is the issue, because I'm reusing the onError method.

public void OnError (PlayFabError error)
        {
            this.callStatus = string.Format ("Error {0}: {1}", error.HttpCode, error.ErrorMessage);
            Debug.Log (callStatus);
        }

The strange thing is that the player logs in successfully to PlayFab, then the error is thrown immediately after.

The error was happening with id 43AF8D16C5823FD3

I do not receive the error when logging in with id 6AEEE073D18A3144

So it may have something to do with the timestamp of the first user.


lango said on Tue, 25 August 2015 at 9:53 PM

I built the game for iOS and ran it inside Xcode.

This time I received the same error for user id 6AEEE073D18A3144

If you look at the stack trace, the strange part is where the error is happening.

  1. Login to Facebook

  2. Login to PlayFab with Facebook access token

  3. Get CloudScript URL

  4. Json Parse error

It still seems to have something to do with a bad timestamp.

In my Unity project I have

using Facebook.MiniJSON;
using PlayFab.Json.Linq;



FBResult
UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:Log(Object)
Manager.SocialManager:OnLoginWithFacebookComplete(FBResult)
Facebook.FacebookDelegate:Invoke(FBResult)
Facebook.AbstractFacebook:OnAuthResponse(FBResult)
Facebook.IOSFacebook:OnAccessTokenRefresh(String)

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

CAAFYAw2PT3wBAE0mxKk2NLEMgkPZCcRPhOE6ceQeUKMXJKp1TRxuuFLwJ4HGoaDmPh9QBcpY0vv4lTzpWf3r8Dt7YtX1TG58rSALWWQypy0iXEAqZBBeKjVqPqo1YHqZBaUA5c7rmJLS7AcwchBaupUHcCCM9UokEMyi7clXePvKgMLwWXJys4CfIcxxVVR2ZABOVM58tSsnjwsCbMhDJRXMFDZBtrR02YZCzcb6A6Hf3vvRTeoM9j
UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:Log(Object)
Manager.SocialManager:LoginToPlayFabWithFacebook()
Manager.SocialManager:OnLoginWithFacebookComplete(FBResult)
Facebook.FacebookDelegate:Invoke(FBResult)
Facebook.AbstractFacebook:OnAuthResponse(FBResult)
Facebook.IOSFacebook:OnAccessTokenRefresh(String)

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

PlayFab Authentication Successful! -- Player ID:6AEEE073D18A3144 new:False
UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:Log(Object)
Manager.PlayFabManager:OnLoginSuccess(LoginResult)
PlayFab.LoginWithFacebookCallback:Invoke(LoginResult)
PlayFab.<LoginWithFacebook>c__AnonStorey80:<>m__C0(String, String)
System.Action`2:Invoke(String, String)
PlayFab.Internal.PlayFabPluginEventHandler:OnHttpResponse(String)

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

iPhone Unity internal profiler stats:
cpu-player>    min:  1.1   max: 128.3   avg:  8.3
cpu-ogles-drv> min:  0.0   max:  0.0   avg:  0.0
cpu-present>   min:  0.0   max:  0.1   avg:  0.0
frametime>     min:  2.7   max: 2163.3   avg: 106.8
batches>       min:   7    max:   7    avg:   7
draw calls>    min:   7    max:   7    avg:   7
tris>          min:  2799  max:  2799  avg:  2799
verts>         min:  3415  max:  3415  avg:  3415
dynamic batching> batched draw calls:   3 batches:   2 tris:  2774 verts:  3378
static batching>  batched draw calls:   3 batches:   2 tris:  2774 verts:  3378
player-detail> physx:  0.3 animation:  0.0 culling  0.0 skinning:  0.0 batching:  0.3 render:  1.6 fixed-update-count: 0 .. 7
scripting-scripts>  update:  5.1   fixedUpdate:  0.0 coroutines:  0.0 
scripting-memory>   used heap: 0 allocated heap: 0  max number of collections: 0 collection total duration:  0.0
----------------------------------------
Cloud Script url : https://1155.playfablogic.com/1/prod
UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:Log(Object)
Manager.PlayFabManager:OnGetCloudScriptUrlSuccess(GetCloudScriptUrlResult)
PlayFab.GetCloudScriptUrlCallback:Invoke(GetCloudScriptUrlResult)
PlayFab.<GetCloudScriptUrl>c__AnonStoreyD0:<>m__110(String, String)
System.Action`2:Invoke(String, String)
PlayFab.Internal.PlayFabPluginEventHandler:OnHttpResponse(String)

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

Error 0: System.FormatException: Invalid format string
  at System.ArgumentNullException..ctor () [0x00000] in <filename unknown>:0 
  at System.DateTime.ParseExact (System.String s, System.String[] formats, IFormatProvider provider, DateTimeStyles style) [0x00000] in <filename unknown>:0 
  at System.DateTime.ParseExact (System.String s, System.String format, IFormatProvider provider, DateTimeStyles style) [0x00000] in <filename unknown>:0 
  at PlayFab.Json.Converters.IsoDateTimeConverter.ReadJson (PlayFab.Json.JsonReader reader, System.Type objectType, System.Object existingValue, PlayFab.Json.JsonSerializer serializer) [0x00000] in <filename unknown>:0 
  at PlayFab.Json.Serialization.JsonSerializerInternalReader.CreateValueProperty (PlayFab.Json.JsonReader reader, PlayFab.Json.Serialization.JsonProperty property, System.Object target, Boolean gottenCurrentValue, System.Object currentValue) [0x00000] in <filename unknown>:0 
  at PlayFab.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue (PlayFab.Json.Serialization.JsonProperty property, PlayFab.Json.JsonReader reader, System.Object target) [0x00000] in <filename unknown>:0 
  at PlayFab.Json.Serialization.JsonSerializerInternalReader.PopulateObject (System.Object newObject, PlayFab.Json.JsonReader reader, PlayFab.Json.Serialization.JsonObjectContract contract, System.String id) [0x00000] in <filename unknown>:0 
  at PlayFab.Json.Serialization.JsonSerializerInternalReader.CreateAndPopulateObject (PlayFab.Json.JsonReader reader, PlayFab.Json.Serialization.JsonObjectContract contract, System.String id) [0x00000] in <filename unknown>:0 
  at PlayFab.Json.Serialization.JsonSerializerInternalReader.CreateObject (PlayFab.Json.JsonReader reader, System.Type objectType, PlayFab.Json.Serialization.JsonContract contract, PlayFab.Json.Serialization.JsonProperty member, System.Object existingValue) [0x00000] in <filename unknown>:0 
  at PlayFab.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal (PlayFab.Json.JsonReader reader, System.Type objectType, PlayFab.Json.Serialization.JsonContract contract, PlayFab.Json.Serialization.JsonProperty member, System.Object existingValue) [0x00000] in <filename unknown>:0 
  at PlayFab.Json.Serialization.JsonSerializerInternalReader.CreateValueNonProperty (PlayFab.Json.JsonReader reader, System.Type objectType, PlayFab.Json.Serialization.JsonContract contract) [0x00000] in <filename unknown>:0 
  at PlayFab.Json.Serialization.JsonSerializerInternalReader.PopulateDictionary (IWrappedDictionary dictionary, PlayFab.Json.JsonReader reader, PlayFab.Json.Serialization.JsonDictionaryContract contract, System.String id) [0x00000] in <filename unknown>:0 
  at PlayFab.Json.Serialization.JsonSerializerInternalReader.CreateAndPopulateDictionary (PlayFab.Json.JsonReader reader, PlayFab.Json.Serialization.JsonDictionaryContract contract, System.String id) [0x00000] in <filename unknown>:0 
  at PlayFab.Json.Serialization.JsonSerializerInternalReader.CreateObject (PlayFab.Json.JsonReader reader, System.Type objectType, PlayFab.Json.Serialization.JsonContract contract, PlayFab.Json.Serialization.JsonProperty member, System.Object existingValue) [0x00000] in <filename unknown>:0 
  at PlayFab.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal (PlayFab.Json.JsonReader reader, System.Type objectType, PlayFab.Json.Serialization.JsonContract contract, PlayFab.Json.Serialization.JsonProperty member, System.Object existingValue) [0x00000] in <filename unknown>:0 
  at PlayFab.Json.Serialization.JsonSerializerInternalReader.CreateValueProperty (PlayFab.Json.JsonReader reader, PlayFab.Json.Serialization.JsonProperty property, System.Object target, Boolean gottenCurrentValue, System.Object currentValue) [0x00000] in <filename unknown>:0 
  at PlayFab.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue (PlayFab.Json.Serialization.JsonProperty property, PlayFab.Json.JsonReader reader, System.Object target) [0x00000] in <filename unknown>:0 
  at PlayFab.Json.Serialization.JsonSerializerInternalReader.PopulateObject (System.Object newObject, PlayFab.Json.JsonReader reader, PlayFab.Json.Serialization.JsonObjectContract contract, System.String id) [0x00000] in <filename unknown>:0 
  at PlayFab.Json.Serialization.JsonSerializerInternalReader.CreateAndPopulateObject (PlayFab.Json.JsonReader reader, PlayFab.Json.Serialization.JsonObjectContract contract, System.String id) [0x00000] in <filename unknown>:0 
  at PlayFab.Json.Serialization.JsonSerializerInternalReader.CreateObject (PlayFab.Json.JsonReader reader, System.Type objectType, PlayFab.Json.Serialization.JsonContract contract, PlayFab.Json.Serialization.JsonProperty member, System.Object existingValue) [0x00000] in <filename unknown>:0 
  at PlayFab.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal (PlayFab.Json.JsonReader reader, System.Type objectType, PlayFab.Json.Serialization.JsonContract contract, PlayFab.Json.Serialization.JsonProperty member, System.Object existingValue) [0x00000] in <filename unknown>:0 
  at PlayFab.Json.Serialization.JsonSerializerInternalReader.CreateValueProperty (PlayFab.Json.JsonReader reader, PlayFab.Json.Serialization.JsonProperty property, System.Object target, Boolean gottenCurrentValue, System.Object currentValue) [0x00000] in <filename unknown>:0 
  at PlayFab.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue (PlayFab.Json.Serialization.JsonProperty property, PlayFab.Json.JsonReader reader, System.Object target) [0x00000] in <filename unknown>:0 
  at PlayFab.Json.Serialization.JsonSerializerInternalReader.PopulateObject (System.Object newObject, PlayFab.Json.JsonReader reader, PlayFab.Json.Serialization.JsonObjectContract contract, System.String id) [0x00000] in <filename unknown>:0 
  at PlayFab.Json.Serialization.JsonSerializerInternalReader.Populate (PlayFab.Json.JsonReader reader, System.Object target) [0x00000] in <filename unknown>:0 
  at PlayFab.Json.JsonSerializer.PopulateInternal (PlayFab.Json.JsonReader reader, System.Object target) [0x00000] in <filename unknown>:0 
  at PlayFab.Json.JsonSerializer.Populate (PlayFab.Json.JsonReader reader, System.Object target) [0x00000] in <filename unknown>:0 
  at PlayFab.Json.JsonConvert.PopulateObject (System.String value, System.Object target, PlayFab.Json.JsonSerializerSettings settings) [0x00000] in <filename unknown>:0 
  at PlayFab.Internal.ResultContainer`1[PlayFab.ClientModels.GetUserCombinedInfoResult].HandleResults (System.String responseStr, System.String errorStr, PlayFab.ClientModels.GetUserCombinedInfoResult& result, PlayFab.PlayFabError& error) [0x00000] in <filename unknown>:0 
  at PlayFab.PlayFabClientAPI+<GetUserCombinedInfo>c__AnonStorey8D.<>m__CD (System.String responseStr, System.String errorStr) [0x00000] in <filename unknown>:0 
  at System.Action`2[System.String,System.String].Invoke (System.String arg1, System.String arg2) [0x00000] in <filename unknown>:0 
  at PlayFab.Internal.PlayFabPluginEventHandler.OnHttpResponse (System.String response) [0x00000] in <filename unknown>:0 
UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:Log(Object)
Manager.PlayFabManager:OnError(PlayFabError)
PlayFab.ErrorCallback:Invoke(PlayFabError)
PlayFab.<GetUserCombinedInfo>c__AnonStorey8D:<>m__CD(String, String)
System.Action`2:Invoke(String, String)
PlayFab.Internal.PlayFabPluginEventHandler:OnHttpResponse(String)

lango said on Tue, 25 August 2015 at 11:51 PM

OK, so with further testing, it seems the problem is not with the player logging in or getting the cloudscript. The error comes when calling GetUserCombinedInfo.

Is there any timestamp data in there that could be corrupted?

void GetUserCombinedInfo ()
        {
            PlayFabClientAPI.GetUserCombinedInfo (
                new GetUserCombinedInfoRequest {
                },
                OnGetUserCombinedInfoSuccess,
                OnError);
        }

If this problem isn't easy to solve, I will open a new thread.


Brendan Vanous said on Wed, 26 August 2015 at 6:35 PM

Hi again,

The issue isn't corruption of the timestamp - it's that the IsoDateConverter had an issue with unexpected date formats. We've checked in a fix for this, which will be in the next SDK update on Monday.

Brendan

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.