Resources.Load stops working after I2 Localization

More
5 years 9 months ago #3102 by Oakshiro
I've found a VERY strange bug that is driving me crazy.

I must say in advance that the version I am using is v2.8.6 f2 and that this bug ONLY HAPPENS ON ANDROID BUILDS.


On my first scene, I have a debug.Log trace to show the detected language:

Debug.Log(I2.Loc.LocalizationManager.CurrentLanguage);


After that, I can see this trace in the logcat:

06-11 16:44:34.152 9310 9337 E Unity : NullReferenceException
06-11 16:44:34.152 9310 9337 E Unity : at UnityEngine.Object.get_name () [0x00000] in <filename unknown>:0
06-11 16:44:34.152 9310 9337 E Unity : at I2.Loc.LanguageSource.GetSourcePlayerPrefName () [0x00000] in <filename unknown>:0
06-11 16:44:34.152 9310 9337 E Unity : at I2.Loc.LanguageSource.Import_Google (Boolean ForceUpdate, Boolean justCheck) [0x00000] in <filename unknown>:0
06-11 16:44:34.152 9310 9337 E Unity : at I2.Loc.LocalizationManager+<Delayed_Import_Google>c__Iterator0.MoveNext () [0x00000] in <filename unknown>:0
06-11 16:44:34.152 9310 9337 E Unity : at UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) [0x00000] in <filename unknown>:0


And strangely enough, whenever I try to instantiate a new Resource using de Resources.Load function (the Loading spinner between scenes), I get this error:

06-11 17:18:12.583 12196 12224 E Unity : ArgumentException: The Object you want to instantiate is null.
06-11 17:18:12.583 12196 12224 E Unity : at UnityEngine.Object.CheckNullArgument (System.Object arg, System.String message) [0x00000] in <filename unknown>:0
06-11 17:18:12.583 12196 12224 E Unity : at UnityEngine.Object.Instantiate (UnityEngine.Object original) [0x00000] in <filename unknown>:0
06-11 17:18:12.583 12196 12224 E Unity : at Utils.LoadScene (System.String sceneName, Boolean removeLoadingScreenWhenLoaded) [0x00000] in <filename unknown>:0
06-11 17:18:12.583 12196 12224 E Unity : at LoginScreenController.<DoLogin>m__0 () [0x00000] in <filename unknown>:0
06-11 17:18:12.583 12196 12224 E Unity : at INLIFEAccessor.InitGame (Boolean success, .Game g, System.String error) [0x00000] in <filename unknown>:0
06-11 17:18:12.583 12196 12224 E Unity : at LoadEnvelope`1[Game].ParseResult (System.String text, System.String error) [0x00000] in <filename unknown>:0
06-11 17:18:12.583 12196 12224 E Unity : at StatusManagerServer+<DownloadUrl>c__Iterator0.MoveNext () [0x00000] in <filename unknown>:0
06-11 17:18:12.583 12196 12224 E Unity : at UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) [0x00000] in <filename unknown>:0

What is REALLY strange is that, if I remove the first Debug.Log it DOES work, although the "LanguageSource.Import_Google" exception keeps on happening.


Now, I can confirm that (double checked):

1.- The assets are in the Resources folder and their names are correct
2.- It ALWAYS fails if I let the debug.Log there, and ALWAYS works if i remove it
3.- I moved the prefab from the Resources Folder to a 3rdParty/I2/Resources folder, but that should not interfere at all
4.- I already clicked on VERIFY and reselected the spreadsheet in the I2 prefab

Any clue?

Thanks!

Please Log in or Create an account to join the conversation.

More
5 years 9 months ago - 5 years 9 months ago #3103 by Frank
That is strange.
Are you using just the i2Languages.prefab or do you have any LanguageSource instantiated in your scenes?
If you disable Google Live Synchronization (set Google Update Frequency to "NEVER") does this error goes away?

Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out
Last edit: 5 years 9 months ago by Frank.

Please Log in or Create an account to join the conversation.

More
5 years 9 months ago #3106 by Oakshiro
Ok, I tried setting the Google Live Synchronization to NEVER. And the error related to the google docs fetching is gone.
But it still fails with the "The object you are trying to instantiate is null" whenever I let the debug.log in the splash screen.

I also tried downgrading I2 to v2.8.1 , but the same happens.

It is very strange. Could it be related in any way with the new privacy policy updates from the google side?
Just in case, I double checked the script at google drive and everything is ok...

any ideas?

Please Log in or Create an account to join the conversation.

More
5 years 9 months ago #3107 by Oakshiro
I was thinking... would it make sense that it could be because of some permissions needed in the manifest? I have a custom manifest.xml.
Which permissions should be granted in order for I2 Localization to work?

Please Log in or Create an account to join the conversation.

More
5 years 9 months ago #3108 by Oakshiro
Ok. I think I found the root of the problem.
Whenever the user enters the Login Scene, I was detecting and destroying all "DontdestroyOnLoad" objects, in order to reset the game when the user did logoff from the options menu, but I think this could be breaking something in the I2 Localization Instance.

Now it seems to be instantiating everything ok, but I still have a problem. Maybe not related to this same bug, but just in case:

The normal flow goes from Splash to Login. As i said, I already got rid of the "destroy all static objects" method, but the labels are not getting localized at all.

In the Splash scene, I must reset the language, to allow the users to switch from one language to another in their tablets and smartphones, but when I change it I end up with the Localization to stop working.

I simply do this on the Start method ...

I2.Loc.LocalizationManager.CurrentLanguage = Application.systemLanguage.ToString();

Please Log in or Create an account to join the conversation.

More
5 years 9 months ago #3109 by Oakshiro
Does this Error makes any sense?
Error Access to the path "/storage/emulated/0/tracesPending.csv" is denied.

Please Log in or Create an account to join the conversation.

Time to create page: 0.322 seconds
Template by JoomlaShine