question

hapygames avatar image
hapygames asked

Help! I get an error when opening the login window on my Android phone.

This is the error I get and it´s caused by a PlayFabScript:

AndroidPlayer(samsung_SM-G960F@xxx.xxx.xxx.xxx) NullReferenceException: Object reference not set to an instance of an object at PlayFab.Json.PocoJsonSerializerStrategy.DeserializeObject (System.Object value, System.Type type) [0x004be] in E:\Razvan\Unity\Rise Of The Animals - Online\Assets\PlayFabSDK\Shared\Internal\SimpleJson.cs:1468 at PlayFab.Json.SimpleJsonInstance+PlayFabSimpleJsonCuztomization.DeserializeObject (System.Object value, System.Type type) [0x00010] in E:\Razvan\Unity\Rise Of The Animals - Online\Assets\PlayFabSDK\Shared\Internal\ISerializer.cs:24 at PlayFab.Json.PlayFabSimpleJson.DeserializeObject (System.String json, System.Type type, PlayFab.Json.IJsonSerializerStrategy jsonSerializerStrategy) [0x0002e] in E:\Razvan\Unity\Rise Of The Animals - Online\Assets\PlayFabSDK\Shared\Internal\SimpleJson.cs:605 at PlayFab.Json.PlayFabSimpleJson.DeserializeObject[T] (System.String json, PlayFab.Json.IJsonSerializerStrategy jsonSerializerStrategy) [0x00001] in E:\Razvan\Unity\Rise Of The Animals - Online\Assets\PlayFabSDK\Shared\Internal\SimpleJson.cs:610 at PlayFab.Json.SimpleJsonInstance.DeserializeObject[T] (System.String json) [0x00001] in E:\Razvan\Unity\Rise Of The Animals - Online\Assets\PlayFabSDK\Shared\Internal\ISerializer.cs:85 at PlayFab.Internal.PlayFabUnityHttp.OnResponse (System.String response, PlayFab.Internal.CallRequestContainer reqContainer) [0x0000e] in E:\Razvan\Unity\Rise Of The Animals - Online\Assets\PlayFabSDK\Shared\Internal\PlayFabHttp\PlayFabUnityHttp.cs:222 UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object) UnityEngine.DebugLogHandler:LogException(Exception, Object) UnityEngine.Logger:LogException(Exception, Object) UnityEngine.Debug:LogException(Exception) PlayFab.Internal.PlayFabUnityHttp:OnResponse(String, CallRequestContainer) (at E:\Razvan\Unity\Rise Of The Animals - Online\Assets\PlayFabSDK\Shared\Internal\PlayFabHttp\PlayFabUnityHttp.cs:266) PlayFab.Internal.<Post>d__12:MoveNext() (at E:\Razvan\Unity\Rise Of The Animals - Online\Assets\PlayFabSDK\Shared\Internal\PlayFabHttp\PlayFabUnityHttp.cs:198) UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) (at /Users/bokken/buildslave/unity/build/Runtime/Export/Scripting/Coroutines.cs:17) (Filename: E Line: 0)

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.

hapygames avatar image hapygames commented ·

Could someone from PlayFab please edit the Question and delete the IP Adress out of it?

I don´t know how to do it myself.

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang hapygames commented ·

We have edited the question.

0 Likes 0 ·
hapygames avatar image
hapygames answered

I have very good news! I was able to fix the issue by..

- creating a completely new Unity 3D Project

- copying all Assets from the old Project BESIDES the PlayFab Assets.

I redownloaded the PlayFabSDK and PlayFabExtension from the Website again and then imported them in the new Project.

I had to set up some things back on my own again (The OnClick() events, references, etc) but for that no error appeared anymore when building to my Android phone.

Thanks to the whole PlayFab Team for helping!

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.

Sarah Zhang avatar image Sarah Zhang commented ·

Glad to know you have solved the issue. :)

0 Likes 0 ·
Sarah Zhang avatar image
Sarah Zhang answered

Which code snippets caused this error? Could you please provide the main code snippets about this error?

7 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.

hapygames avatar image hapygames commented ·

Sadly I don´t exactly know, but I can send you a Google Drive link which has my project and you guys can take a better look into it by opening it in Unity and Building and Running it in a phone.

Just let me know if that helps and I will do it :)

0 Likes 0 ·
hapygames avatar image hapygames hapygames commented ·

(I used a Samsung Galaxy S9)

Steps to reproduce the Issue:

1. Make sure to have an Android phone plugged in

2. Click "Build and Run", so the project will be sent to the Android phone and automatically opened.

(after the project is opened, you can make a circle form on the screen of the phone and the Console will be opened on the phone because I also installed the plugin for it, from the Assets Store).

The errors should appear right at the very beginning, once you enter the "#MainEnterinScene"

The exact problem happens, ...

- When pressing the "Guest" Button to login without actually creating an Account

- When trying to normally Register or Login (This can be found in the Login-Type "Custom", which can be reached when pressing the button with the name "Custom" in the "#MainEnteringScene".

- Or when trying to create a "Recovery Account" in the "CustomCreateRecoveryAccountScene".

(This Scene can be reached by first entering the "CustomLoginScene" and then by pressing the "CreateRecoveryAccount" button at the bottom.

These issues don´t appear in the Game-View in Unity. Everything works fine there, but when trying it on the phone, it doesn´t work.

I guess it also has issues on IOS. I didn´t try

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang commented ·

Thanks for the sharing, we hided your reply and we will test the project you shared. Besides, could you please provide the specific reproduces steps, which one scene and which one script cause the error?

0 Likes 0 ·
hapygames avatar image hapygames commented ·

The "CustomAccountManagement" Script should provide the errors.

It can be found under "Scripts" ==> "PlayFab".

Thank you very much for taking your time to take a look on the errors :)

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang hapygames commented ·

We can't reproduce this issue in Unity 2019.4.17(LTS) with default setting. Could you please provide your Unity version, and Build Settings?

0 Likes 0 ·
hapygames avatar image hapygames Sarah Zhang commented ·

My Unity version is "2019.4.23f1 (LTS)"

My Build Settings (view picture) or text below:

- Texture Compression = Don´t Override

- ETC2 fallback = 32-Bit

- Export Project = no

- Symlink Sources = no

- Build App Bundle (Google Play) = no

- Create symbols.zip = no

- Run Device = Samsung S9

- Development Build = no

- Autoconnect Profiler = no

- Deep Profiling = no

- Script Debugging = no

- Scripts Only Build = no

- Compression Method = Default

Here is a video link with the Player Settings:

https://drive.google.com/file/d/1uYIMaytJQyLRk8wX2Rcw_iZ61kPqTnVi/view?usp=sharing

If anything else is needed, let me know :)

0 Likes 0 ·
screenshot-2.png (250.2 KiB)
Show more comments
hapygames avatar image
hapygames answered

I tried to download the Project on a Samsung S20 because I thought that it might be only my phone, but the same problem appears there.

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.

Sarah Zhang avatar image Sarah Zhang commented ·

Thanks for the information. In fact, we have no any Samsung testing phone. We tested the project in the RedmiK30 Pro, and it worked fine.

Besides, we seem to can't find the Player Settings in your video. Could you please provide the screen shot again?

As the answer of this thread -- Unity - Getting NullReferenceException in SimpleJson.cs 1467 ONLY in Windows (build and run) - Playfab Community said, the similar issues seem to can be fixed by changing the Player Settings. You can try the method provided by the original poster of the above thread.

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.