Open lxwgogogo opened 1 month ago
Thank you for reporting this issue/advice.
We will get back to you as soon as possible.
Would you like to star our plugin to support us? :sparkles:
Let me answer to myself. After I copy the Assets/Huawei/Settings/Resources folder
to my Assets/Resources folder?
, now it works. Is this a required step after the upgrade to v2.3.8?
Hello, @lxwgogogo , We tried the game service and didn't faced any errors like the ones you're getting with the settings.
Actually setting's file path is right. It needs to be in Huawei > Settings > Resources
.
Maybe, this error is one shot. Can you tell us which Unity version you are using?
Just try this; Rollback last changes that about settings path and then make Assets > Import All in Unity. Open again and run your project.
I am using 2022.3.14f1
The Unity plugin has automatically created its own settings file in"Huawei > Settings > Resources."
Can you check again this folder ?
The plugin already won't use files that you copied in "Assets/Resources.". You can delete them.
I also encountered this issue once.
When I ran git clean -fdx
in my project and then reopened Unity 2022.3.39f1, the issue disappeared.
Still don't know why.
i have same error in android build Unity 2022.3.39f1
A scripted object (script unknown or not yet loaded) has a different serialization layout when loading. (Read 52 bytes but expected 60 bytes) Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts? UnityEngine.Resources:Load(String) HmsPlugin.ScriptableHelper:Load(String, String) HmsPlugin.HMSIAPKitSettings:.ctor() System.Activator:CreateInstance() HmsPlugin.HMSEditorSingleton`1:get_Instance() HmsPlugin.HMSIAPManager:InitControlOfIAP() HuaweiMobileServices.Utils.HMSDispatcher:InvokeAsync(Action) System.Lazy`1:CreateValue() Gameplay.Billing.Factories.Android.Huawei.ControllerFactory:Create(IAuthTokenSource, IGame, BillingEvents, CurrencyConverter) .....
@amatveev Can you try other Unity version ?
We tried 2022.3.18f1, and we didn't face any errors that you faced.
In the meantime, we will try the Unity version that you used. After that, let's we compare results together.
@amatveev Can you try other Unity version ?
We tried 2022.3.18f1, and we didn't face any errors that you faced.
In the meantime, we will try the Unity version that you used. After that, let's we compare results together.
We upgrade project from 2020.3.41f1 to 2022.3.39f1. After unity editor upgrade we are upgrade hms-unity-plugin 2.3.4 -> 2.3.8 and 2.3.8 + 2020.3.41f1 work fine
summary: 2.3.8 + 2020.3.41f1 - ok 2.3.8 + 2022.3.39f1 - error 2.3.8 + 2022.3.40f1 - error
A scripted object (script unknown or not yet loaded) has a different serialization layout when loading. (Read 52 bytes but expected 60 bytes) Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts? UnityEngine.Resources:Load(String) HmsPlugin.ScriptableHelper:Load(String, String) HmsPlugin.HMSIAPKitSettings:.ctor() System.Activator:CreateInstance() HmsPlugin.HMSEditorSingleton`1:get_Instance() HmsPlugin.HMSIAPManager:InitControlOfIAP() HuaweiMobileServices.Utils.HMSDispatcher:InvokeAsync(Action) System.Lazy`1:CreateValue() Gameplay.Billing.Factories.Android.Huawei.ControllerFactory:Create(IAuthTokenSource, IGame, BillingEvents, CurrencyConverter)
@Andronovo-bit @amatveev I encountered this issue again. Our project uses version 2022.3.39f1, and the issue disappears upon restarting Unity. It seems to be a bug in Unity that occurs when something is cached during multiple builds.
@amatveev @qinhanlei
We tested this scenario in Unity 2022.3.40f1, but we did not receive any errors similar to yours.
You should never modify the settings file manually. This file has a format.
If you have rarely encountered this error, you can;
If second solution don't solve your problem, you can;
As a final step, if your problem persists, could you replace the following code in the ScriptableHelper.cs file?
Could you send the HMSIAPKitSettings.asset file that causes an error in Settings/Resources? @amatveev
Describe the bug & problem The v2.3.7 works well on my phone. But after I upgrade to v2.3.8, it throws error:
I debugged and found the
ScriptableHelper.Load
hasvar asset = Resources.Load<T>(filename);
which the asset isnull
. I wonder if I should copy the Assets/Huawei/Settings/Resources folder to my Assets/Resources folder?