You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mediation ad networks used, and their versions: None
[REQUIRED] Step 2: Describe the problem
Steps to reproduce:
Create an empty project, import GoogleMobileAds plugin and add the GoogleMobileAdsSettings to the Preloaded Assets list in the Project Settings.
When running the build on an Android or iOS device I get this error in the console:
A scripted object (probably GoogleMobileAds.Editor.GoogleMobileAdsSettings?) has a different serialization layout when loading. (Read 56 bytes but expected 100 bytes) Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?
The error is harmless and more of a nuisance, than an actual critical issue.
The problem is that the GoogleMobileAdsSettings class file is in an Editor folder (which gets stripped out at build time) and GoogleMobileAdsSettings scriptable object file is in a normal Resources folder (so this gets included in the build).
Proposed solutions
Move the GoogleMobileAdsSettings scriptable object file in the EditorDefaultResources folder. Problem with this is that there can only be one EditorDefaultResources folder per project and it needs to be at the root (it can't be inside GoogleMobileAds folder)
Move the GoogleMobileAdsSettings class file outside the Editor folder. It will require to create a new Assembly Definition file for it.
The text was updated successfully, but these errors were encountered:
@victor-kallai why are you adding the Editor file to the Preloaded Assets? This file is used during building to write configurations to the plist / android manifest and is not intended to be loaded at runtime.
Adding the Editor file to the Preloaded Assets is just a quick way to expose and test the error, without any additional steps.
In my original project I have a plugin (Reflex) which is calling the UnityEngine.Resources.LoadAll when the project is first loaded, using this annotation [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)].
The error in that case is this:
A scripted object (script unknown or not yet loaded) has a different serialization layout when loading. (Read 56 bytes but expected 164 bytes)
Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?
UnityEngine.Resources:LoadAll(String)
Reflex.Core.CreateProjectContainer:Create()
Reflex.Injectors.UnityInjector:BeforeAwakeOfFirstSceneOnly()
This is a bit more ambiguous, it's not clear which scripted object is to blame.
To test the same thing, you can add a script that calls Resources.Load(path); in a static method with [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)].
[REQUIRED] Step 1: Describe your environment
[REQUIRED] Step 2: Describe the problem
Steps to reproduce:
Create an empty project, import GoogleMobileAds plugin and add the GoogleMobileAdsSettings to the Preloaded Assets list in the Project Settings.
When running the build on an Android or iOS device I get this error in the console:
The error is harmless and more of a nuisance, than an actual critical issue.
The problem is that the GoogleMobileAdsSettings class file is in an Editor folder (which gets stripped out at build time) and GoogleMobileAdsSettings scriptable object file is in a normal Resources folder (so this gets included in the build).
Proposed solutions
Move the GoogleMobileAdsSettings scriptable object file in the EditorDefaultResources folder. Problem with this is that there can only be one EditorDefaultResources folder per project and it needs to be at the root (it can't be inside GoogleMobileAds folder)
Move the GoogleMobileAdsSettings class file outside the Editor folder. It will require to create a new Assembly Definition file for it.
The text was updated successfully, but these errors were encountered: