-
Type: Bug
-
Resolution: Incomplete
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
What happened?
Build Task WriteFileList failed with exception: No properties in AssetPackageRealmObject, has linker stripped it? See https://docs.mongodb.com/realm/sdk/dotnet/troubleshooting/#resolve-a--no-properties-in-class--exception at Realms.Schema.ObjectSchema+Builder..ctor (System.Type type) [0x00140] in <868b6b354c524faeb87463960e954113>:0 at Realms.Schema.ObjectSchema+<>c.<FromType>b__24_0 (System.Type t) [0x00000] in <868b6b354c524faeb87463960e954113>:0 at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue].GetOrAdd (TKey key, System.Func`2[T,TResult] valueFactory) [0x00034] in <80e08c2cc04049bf931fc9038d04f397>:0 at Realms.Schema.ObjectSchema.FromType (System.Type type) [0x0000b] in <868b6b354c524faeb87463960e954113>:0 at Realms.Schema.RealmSchema+Builder.Add (System.Type type) [0x0000b] in <868b6b354c524faeb87463960e954113>:0 at Realms.Schema.RealmSchema+Builder..ctor (System.Collections.Generic.IEnumerable`1[T] types) [0x00021] in <868b6b354c524faeb87463960e954113>:0 at Realms.Schema.RealmSchema.op_Implicit (System.Type[] objects) [0x00003] in <868b6b354c524faeb87463960e954113>:0 at Orcas.Asset.AssetManager.GetFileListFormFilePath (System.String filePath, System.Boolean isReadOnly) [0x00019] in E:\Projects\Merge2\Packages\orcas.asset.manager@0.0.10\Runtime\Core\AssetManager.cs:210 at Orcas.Asset.WriteFileList.Run () [0x00267] in E:\Projects\Merge2\Packages\orcas.asset.manager@0.0.10\Editor\BuildTask\WriteFileList.cs:96 at UnityEditor.Build.Pipeline.BuildTasksRunner.Run (System.Collections.Generic.IList`1[T] pipeline, UnityEditor.Build.Pipeline.Interfaces.IBuildContext context) [0x000cd] in E:\Projects\Merge2\Library\PackageCache\com.unity.scriptablebuildpipeline@1.20.2\Editor\Shared\BuildTasksRunner.cs:56
I get the exception while my project building in the batch mode.
The WriteFileList is a build task in my SBP like this:
internal class WriteFileList : IBuildTask { public int Version { get; } #pragma warning disable 649 [InjectContext(ContextUsage.In)] IBundleBuildParameters m_Parameters; [InjectContext] IBuildInfoContext m_BuildInfoContext; [InjectContext] IDependencyData m_DependencyData; [InjectContext] IBundleBuildResults m_Results; #pragma warning restore 649 public ReturnCode Run() { if (m_BuildInfoContext.Variant != null) return ReturnCode.Success; var realmFilePath = m_Parameters.GetOutputFilePathForIdentifier("FileList.realm"); if (File.Exists(realmFilePath)) { File.Delete(realmFilePath); } var realm = AssetManager.GetFileListFormFilePath(realmFilePath); ... }
And the GetFileListFormFilePath in AssetManager.cs is:
public static Realm GetFileListFormFilePath(string filePath, bool isReadOnly = false) { if (isReadOnly && File.Exists(filePath) == false) { return null; } var configuration = new RealmConfiguration(filePath) { Schema = new[] { typeof(AssetPackageRealmObject), typeof(AssetBundleRealmObject), typeof(AssetRealmObject), typeof(DownLoadedABRealmObject), typeof(BuildConfigRealmObject) }, IsReadOnly = isReadOnly }; return Realm.GetInstance(configuration); }
This exception only occurs in the batch mode!
I firstly guess these realm object classes may not woven correctly. But in the build log I find them look like correct.
The part of Build Log:
[Orcas.Asset.Manager] Weaving completed in 68 ms. 5 classes were woven: <b>AssetBundleRealmObject</b> <i>Name</i>: String [PrimaryKey] <i>FileName</i>: String <i>Hash</i>: String <i>CRC</i>: String <i>Size</i>: Int64 <i>Dependencies</i>: IList`1<Orcas.Asset.AssetBundleRealmObject> <b>AssetPackageRealmObject</b> <i>Name</i>: String [PrimaryKey] <i>Internal</i>: Boolean <i>IsDependence</i>: Boolean <i>Version</i>: Int64 <i>ApplyVariantExt</i>: String <i>VariantsExt</i>: IList`1<System.String> <i>AssetBundles</i>: IList`1<Orcas.Asset.AssetBundleRealmObject> <b>AssetRealmObject</b> <i>Path</i>: String [PrimaryKey] <i>AssetBundle</i>: AssetBundleRealmObject <b>BuildConfigRealmObject</b> <i>Id</i>: Int32 [PrimaryKey] <i>BigQueryVersion</i>: String <i>Environment</i>: Int32 <b>DownLoadedABRealmObject</b> <i>FileName</i>: String [PrimaryKey] UnityEngine.StackTraceUtility:ExtractStackTrace () UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[]) UnityEngine.Logger:Log (UnityEngine.LogType,object) UnityEngine.Debug:Log (object) RealmWeaver.UnityWeaver/UnityLogger:Info (string) RealmWeaver.UnityWeaver:WeaveAssemblyCore (string,System.Collections.Generic.IEnumerable`1<string>,RealmWeaver.Analytics/Config) RealmWeaver.UnityWeaver/<>c:<Initialize>b__18_1 (string,UnityEditor.Compilation.CompilerMessage[]) UnityEditor.Compilation.CompilationPipeline/<>c:<SubscribeToEvents>b__23_2 (UnityEditor.Scripting.ScriptCompilation.ScriptAssembly,UnityEditor.Compilation.CompilerMessage[]) UnityEditor.Scripting.ScriptCompilation.EditorCompilation:InvokeAssemblyCompilationFinished (UnityEditor.Scripting.ScriptCompilation.ScriptAssembly[],Bee.BeeDriver.BeeDriverResult,UnityEditor.Scripting.Compilers.CompilerMessage[][]) UnityEditor.Scripting.ScriptCompilation.EditorCompilation:ProcessCompilationResult (UnityEditor.Scripting.ScriptCompilation.ScriptAssembly[],Bee.BeeDriver.BeeDriverResult,object) UnityEditor.Scripting.ScriptCompilation.EditorCompilation:TickCompilationPipeline (UnityEditor.Scripting.ScriptCompilation.EditorScriptCompilationOptions,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,int,string[]) UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface:TickCompilationPipeline (UnityEditor.Scripting.ScriptCompilation.EditorScriptCompilationOptions,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,int,string[]) UnityEditor.Build.Player.PlayerBuildInterface:CompilePlayerScriptsNative (UnityEditor.Build.Player.ScriptCompilationSettings,string,bool) UnityEditor.Build.Player.PlayerBuildInterface:CompilePlayerScriptsInternal (UnityEditor.Build.Player.ScriptCompilationSettings,string,bool) UnityEditor.Build.Player.PlayerBuildInterface:CompilePlayerScripts (UnityEditor.Build.Player.ScriptCompilationSettings,string) UnityEditor.Build.Pipeline.Tasks.BuildPlayerScripts:Run () (at Library/PackageCache/com.unity.scriptablebuildpipeline@1.20.2/Editor/Tasks/BuildPlayerScripts.cs:41) UnityEditor.Build.Pipeline.BuildTasksRunner:Run (System.Collections.Generic.IList`1<UnityEditor.Build.Pipeline.Interfaces.IBuildTask>,UnityEditor.Build.Pipeline.Interfaces.IBuildContext) (at Library/PackageCache/com.unity.scriptablebuildpipeline@1.20.2/Editor/Shared/BuildTasksRunner.cs:56) UnityEditor.Build.Pipeline.ContentPipeline:BuildAssetBundles (UnityEditor.Build.Pipeline.Interfaces.IBundleBuildParameters,UnityEditor.Build.Pipeline.Interfaces.IBundleBuildContent,UnityEditor.Build.Pipeline.Interfaces.IBundleBuildResults&,System.Collections.Generic.IList`1<UnityEditor.Build.Pipeline.Interfaces.IBuildTask>,UnityEditor.Build.Pipeline.Interfaces.IContextObject[]) (at Library/PackageCache/com.unity.scriptablebuildpipeline@1.20.2/Editor/ContentPipeline.cs:145) Orcas.Asset.BuildPackageHelper:BuildAssetBundles_Internal ...
The full build log file:
buildtest.log
Repro steps
1.Build Project.
2.Got the exception of "no properties in...".
Version
Unity .Net Framework
What Atlas Services are you using?
Local Database only
What type of application is this?
Unity
Client OS and version
Unity2021.3.38f1 & Realm-dotnet 12.0.0
Code snippets
No response
Stacktrace of the exception/crash you're getting
Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
Relevant log output
No response