Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VisionOS Build failed IL2CPP #730

Open
Jerem-35 opened this issue Nov 14, 2024 · 6 comments
Open

VisionOS Build failed IL2CPP #730

Jerem-35 opened this issue Nov 14, 2024 · 6 comments
Labels
bug Something isn't working
Milestone

Comments

@Jerem-35
Copy link

Jerem-35 commented Nov 14, 2024

Hello,

Having the gltfast package in a project seems to prevent building to visionOS.

For example using the visionOS template described in the documentation , add gltfast package (tested 6.9.0 and 6.7.0) and any building fails because of an IL2CPP error. I don't know about the official support of gltfast on visionOS but our project is supposed to be Multiplatform so we will use gltffast on iOS/Android.

Using Unity 2022.3.52, PolySpatial 1.3.9 and Vision OS SDK 2.1.

Here is the full (first) error :

/Applications/Unity/Hub/Editor/2022.3.52f1/Unity.app/Contents/il2cpp/build/deploy/il2cpp @Library/Bee/artifacts/rsp/5614713841999172683.rsp
Error: IL2CPP error (no further information about what managed code was being converted is available)
System.AggregateException: One or more errors occurred. (Unresolved method reference : System.Void Unity.Collections.NativeHashMapExtensions::Remove(Unity.Collections.NativeMultiHashMap2<!!0,!!1>,!!0,!!1)) ---> System.ArgumentException: Unresolved method reference : System.Void Unity.Collections.NativeHashMapExtensions::Remove(Unity.Collections.NativeMultiHashMap2<!!0,!!1>,!!0,!!1)
at Unity.IL2CPP.DataModel.TypeContext.GetDef(MethodReference reference) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.DataModel/TypeContext.cs:line 238
at Unity.IL2CPP.DataModel.BuildLogic.MethodReferenceResolver.ResolveMethodReference(TypeContext context, UnderConstructionMethodReferenceRepository repository, CecilSourcedAssemblyData assemblyData, MethodReference methodReference, Dictionary2 mapping) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.DataModel/BuildLogic/MethodReferenceResolver.cs:line 38 at Unity.IL2CPP.DataModel.BuildLogic.MethodReferenceResolver.ResolveAssemblyMethodReferences(TypeContext context, UnderConstructionMethodReferenceRepository repository, CecilSourcedAssemblyData assemblyDef, ReadOnlyHashSet1 methodReferences) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.DataModel/BuildLogic/MethodReferenceResolver.cs:line 30
at Unity.IL2CPP.DataModel.BuildLogic.DataModelBuilder.<>c__DisplayClass16_0.b__0(CecilSourcedAssemblyData data) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.DataModel/BuildLogic/DataModelBuilder.cs:line 195
at System.Threading.Tasks.Parallel.<>c__DisplayClass33_02.<ForEachWorker>b__0(Int32 i) at System.Threading.Tasks.Parallel.<>c__DisplayClass19_01.b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
at System.Threading.Tasks.Parallel.<>c__DisplayClass19_01.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) at System.Threading.Tasks.TaskReplicator.Replica.Execute() --- End of inner exception stack trace --- at System.Threading.Tasks.TaskReplicator.Run[TState](ReplicatableUserAction1 action, ParallelOptions options, Boolean stopOnFirstFailure)
at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Func4 bodyWithLocal, Func1 localInit, Action1 localFinally) --- End of stack trace from previous location --- at System.Threading.Tasks.Parallel.ThrowSingleCancellationExceptionOrOtherException(ICollection exceptions, CancellationToken cancelToken, Exception otherException) at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Func4 bodyWithLocal, Func1 localInit, Action1 localFinally)
at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IList1 list, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Action3 bodyWithStateAndIndex, Func4 bodyWithStateAndLocal, Func5 bodyWithEverything, Func1 localInit, Action1 localFinally)
at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable1 source, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Action3 bodyWithStateAndIndex, Func4 bodyWithStateAndLocal, Func5 bodyWithEverything, Func1 localInit, Action1 localFinally)
at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable1 source, Action1 body)
at Unity.IL2CPP.DataModel.BuildLogic.Utils.ParallelHelpers.ForEach[TSource](IEnumerable1 source, Action1 func, Boolean enableSerial) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.DataModel/BuildLogic.Utils/ParallelHelpers.cs:line 44
at Unity.IL2CPP.DataModel.BuildLogic.DataModelBuilder.Build() in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.DataModel/BuildLogic/DataModelBuilder.cs:line 70
at Unity.IL2CPP.AssemblyConversion.Phases.InitializePhase.Run(AssemblyConversionContext context) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP/AssemblyConversion/Phases/InitializePhase.cs:line 19
at Unity.IL2CPP.AssemblyConversion.Classic.ClassicConverter.Run(AssemblyConversionContext context) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP/AssemblyConversion.Classic/ClassicConverter.cs:line 11
at Unity.IL2CPP.AssemblyConversion.AssemblyConverter.ConvertAssemblies(AssemblyConversionContext context, ConversionMode conversionMode) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP/AssemblyConversion/AssemblyConverter.cs:line 38
at Unity.IL2CPP.AssemblyConversion.AssemblyConverter.ConvertAssemblies(TinyProfiler2 tinyProfiler, AssemblyConversionInputData data, AssemblyConversionParameters parameters, AssemblyConversionInputDataForTopLevelAccess dataForTopLevel) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP/AssemblyConversion/AssemblyConverter.cs:line 13

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:203)

@Jerem-35 Jerem-35 added the bug Something isn't working label Nov 14, 2024
@atteneder
Copy link
Owner

Hi,

Thanks for reporting. I've successfully built a PoC for AVP before. I'll try to reproduce it.

@Jerem-35
Copy link
Author

Thanks for your answer!
As other posts mention that gltfast can work with vision os I did try another version : with 6.4.0 I don't have any issue building the project.

@atteneder
Copy link
Owner

I could reproduce the issue and have a clue.

Polyspatial depends on Collections package 1.2.3.

glTFast 6.5.0 added a hard dependency on the Collections package 1.5.1.

Polyspatial seems to be using NativeMultiHashMap, which was renamed to something else in Collections 1.3.0.

I think correct solution would be to decrease the required Collections version in glTFast so that the right version gets installed. I assume that'll have no negative effects, but I have to test.

Feel free to jump ahead and try it out. Feedback is welcome!

@atteneder
Copy link
Owner

side-note: It's unfortunate that a minor version update breaks the API. That's not exactly semantic versioning.

@atteneder
Copy link
Owner

So, unfortunately glTFast does not compile using Collections 1.2.4 (or anything before 1.5).

The quick solution would be to migrate to Polyspatial 2.0. It depends on Collections 2.x and thus glTFast works well with it.

The other solution is to make glTFast backwards compatible with older Collections versions, which I'm not convinced is a good investment of resource.

@atteneder atteneder moved this from To do to Planned in glTFast development Dec 11, 2024
@atteneder atteneder added this to the 6.x milestone Dec 11, 2024
@atteneder
Copy link
Owner

Heads-up: A fix is coming early next year, likely in 6.10.1.

@atteneder atteneder moved this from Planned to In progress in glTFast development Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: In progress
Development

No branches or pull requests

2 participants