question

contact-5 avatar image
contact-5 asked

GetCatalogItems on iOS Devices

Hi, I am trying to use GetCatalogItems API. On Unity Editor, GetCatalogItems seems to work properly, but on iOS devices I am getting messages below.

I am using

Playfab Unity SDK with releaseNotes/#170130 (which is available at https://github.com/PlayFab/UnitySDK/blob/master/Packages/UnitySDK.unitypackage), Unity 5.5.1p2, and mono2.x backend without stripping.

For other APIs like GetPhotonAuthenticationTokenRequest, LoginWithCustomIDRequest, LoginWithAndroidDeviceIDRequest, LoginWithIOSDeviceIDRequest, and ExecuteCloudScriptRequest work really well on both editor and iOS builds, so it is really confusing.

ExecutionEngineException: Attempting to JIT compile method 'System.Collections.Generic.Dictionary`2<string, uint>:.ctor ()' while running with --aot-only.

at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0

Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.

at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0

at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0

at System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) [0x00000] in <filename unknown>:0

at PlayFab.Json.ReflectionUtils+<GetConstructorByReflection>c__AnonStorey0.<>m__0 (System.Object[] args) [0x00000] in <filename unknown>:0

at PlayFab.Json.PocoJsonSerializerStrategy.DeserializeObject (System.Object value, System.Type type) [0x00000] in <filename unknown>:0

at PlayFab.Json.SimpleJsonInstance+PlayFabSimpleJsonCuztomization.DeserializeObject (System.Object value, System.Type type) [0x00000] in <filename unknown>:0

at PlayFab.Json.PocoJsonSerializerStrategy.DeserializeObject (System.Object value, System.Type type) [0x00000] in <filename unknown>:0

at PlayFab.Json.SimpleJsonInstance+PlayFabSimpleJsonCuztomization.DeserializeObject (System.Object value, System.Type type) [0x00000] in <filename unknown>:0

at PlayFab.Json.PocoJsonSerializerStrategy.DeserializeObject (System.Object value, System.Type type) [0x00000] in <filename unknown>:0

at PlayFab.Json.SimpleJsonInstance+PlayFabSimpleJsonCuztomization.DeserializeObject (System.Object value, System.Type type) [0x00000] in <filename unknown>:0

at PlayFab.Json.PocoJsonSerializerStrategy.DeserializeObject (System.Object value, System.Type type) [0x00000] in <filename unknown>:0

at PlayFab.Json.SimpleJsonInstance+PlayFabSimpleJsonCuztomization.DeserializeObject (System.Object value, System.Type type) [0x00000] in <filename unknown>:0

at PlayFab.Json.PlayFabSimpleJson.DeserializeObject (System.String json, System.Type type, IJsonSerializerStrategy jsonSerializerStrategy) [0x00000] in <filename unknown>:0

at PlayFab.Json.PlayFabSimpleJson.DeserializeObject[GetCatalogItemsResult] (System.String json, IJsonSerializerStrategy jsonSerializerStrategy) [0x00000] in <filename unknown>:0

at PlayFab.Json.SimpleJsonInstance.DeserializeObject[GetCatalogItemsResult] (System.String json) [0x00000] in <filename unknown>:0

at PlayFab.Json.JsonWrapper.DeserializeObject[GetCatalogItemsResult] (System.String json) [0x00000] in <filename unknown>:0

at PlayFab.Internal.PlayFabHttp+<MakeApiCall>c__AnonStorey0`1[PlayFab.ClientModels.GetCatalogItemsResult].<>m__0 () [0x00000] in <filename unknown>:0

at PlayFab.Internal.PlayFabWww+<MakeApiCall>c__AnonStorey1.<>m__0 (System.String response) [0x00000] in <filename unknown>:0

UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)

UnityEngine.DebugLogHandler:LogException(Exception, Object)

UnityEngine.Logger:LogException(Exception, Object)

UnityEngine.Debug:LogException(Exception)

PlayFab.Internal.<MakeApiCall>c__AnonStorey1:<>m__0(String)

PlayFab.Internal.<Post>c__Iterator0:MoveNext()

UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

10 |1200

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

1807605288 avatar image
1807605288 answered

You will probably only see this error if you are running in mono2x mode. We have put a lot of effort to make sure we're using iOS-safe reflection actions that work in mono2x, so that our developers can debug quickly and easily.

The immediate fix will probably require compiling with IL2CPP mode. We're aware that the compile times are much longer using IL2CPP, so we'll try to dig into this and figure it out so you can resume using mono2x.

Thanks for reporting the issue, we were unaware of any new/specific problems. Also, please confirm that IL2CPP resolves the issue.

2 comments
10 |1200

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

contact-5 avatar image contact-5 commented ·

I compiled the code with IL2CPP mode, and it works well.

I know and I understand you put a lot of efforts to make mono2.x work on iOS properly. For now, I will use IL2CPP mode, until there is a fix for this.

Hope to see the fix soon.

Thank you.

0 Likes 0 ·
1807605288 avatar image 1807605288 ♦ contact-5 commented ·

Can you please give me your titleId, so I can figure out what in your catalog is actually causing the problem?

0 Likes 0 ·
1807605288 avatar image
1807605288 answered

The first thing we see when looking into this is that you have non-english unicode characters in your catalog. We have not tested this, and it's entirely possible that one or all of our JSON serializers can't handle those characters.

I suggest: remove any non-english characters, and save your localized text in your client. Someday we would like to have full unicode testing/support on all of our SDKs, but that won't come for quite a while.

Please try to remove all those non-english characters from all places in your catalog, and test again.

1 comment
10 |1200

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

contact-5 avatar image contact-5 commented ·

Dear Paul,

I removed all the non-english characters in my catalog, and it works well on mono2.x backends.

Hope to see non-english unicode support soon.


Thank you.

0 Likes 0 ·

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.