realm / realm-dotnet

Realm is a mobile database: a replacement for SQLite & ORMs
https://realm.io
Apache License 2.0
1.25k stars 165 forks source link

[Unity] RealmWeaver PostBuild step doesn't work in Unity 2022 #3306

Closed ab-rdarts closed 1 year ago

ab-rdarts commented 1 year ago

What happened?

Unity 2022 changes BuildReport API and RealmWeaver post build step doesn't work

NotSupportedException: Specified method is not supported.
UnityEditor.Build.Reporting.BuildReport.get_files () (at /Users/bokken/build/output/unity/unity/Modules/BuildReportingEditor/Managed/BuildReport.bindings.cs:19)
RealmWeaver.UnityWeaver.OnPostBuildPlayerScriptDLLs (UnityEditor.Build.Reporting.BuildReport report) (at <212ba010e8bf41de90c7c40b47f43467>:0)
UnityEditor.Build.BuildPipelineInterfaces.OnPostBuildPlayerScriptDLLs (UnityEditor.Build.Reporting.BuildReport report) (at /Users/bokken/build/output/unity/unity/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:603)
UnityEditor.BuildPipeline:BuildPlayer(BuildPlayerOptions)
BuildScript:BuildProjectForIOS(IamCoreConfig) (at Assets/Components/Build/BuildScripts/Editor/BuildScript.cs:197)
BuildScript:BuildIOS(IamCoreConfig) (at Assets/Components/Build/BuildScripts/Editor/BuildScript.cs:106)
BuildScript:BuildIOSDevelopment() (at Assets/Components/Build/BuildScripts/Editor/BuildScript.cs:80)

Repro steps

Add realm to any unity 2022 and compile for example iOS

Version

netstandard 2.1

What Atlas Services are you using?

Local Database only

What type of application is this?

Unity

Client OS and version

OSX 13.3.1

Code snippets

No response

Stacktrace of the exception/crash you're getting

No response

Relevant log output

No response

nirinchev commented 1 year ago

Hey, thanks for the report - I was able to reproduce it and have a workaround which should go into the next release.

nirinchev commented 1 year ago

Can you try if this version of the SDK fixes the issue for you? I'm fairly confident it should work, but I've only been able to test it on Windows due to some issues with the Unity Hub on my Macbook.

ab-rdarts commented 1 year ago

@nirinchev it seems to work at least on my macbook, thanx