
In Addressable-Sample project,I create a new C# script like this and click “Build Player Content”.
Why does this happen?
Hey @Jiahaokun , is your SearchSchemaTest script inside an Editor folder? Otherwise what’s happening is that you’re trying to compile runtime scripts that have a reference to the UnityEditor assembly which cannot be done. (AddressableAssetSettingsDefaultObject is an editor type).
Check out Unity - Manual: Special folder names for more information on special folder names.
No, using a custom ResourceLocator or async operation inherently is fine. The issue is that you’re trying to use an Editor type in your script. If you’re trying to use an Editor type in a runtime script, you won’t be able to compile your build (ie your SBP errors).
If you have .asmdef files, make sure to only mark the Editor field for Editor Scripts which is generally in Editor Folder.
I have this issue then I edit .asmdef files accordingly Editor sides. It worked. You should not have any Editor Scripts on Runtime.
I had these errors!
If you have DOTween package in your project. You can check the “Create ASMDEF…” to create .asmdef files properly for DOTween.