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

"Bee" Library build fail Windows.Foundation Android #11778

Closed
SashelI opened this issue Sep 4, 2023 · 5 comments
Closed

"Bee" Library build fail Windows.Foundation Android #11778

SashelI opened this issue Sep 4, 2023 · 5 comments
Labels

Comments

@SashelI
Copy link

SashelI commented Sep 4, 2023

Describe the bug

Hi,

I recently tried to switch a MRTK 2.8 HoloLens project to Android for a MagicLeap build, meaning switching build config from UWP to Android.

Thing is, whenever I try to build, I get this error :

Building Library\Bee\artifacts\Android\ManagedStripped failed with output:
C:\Program Files\Unity\Hub\Editor\2022.3.7f1\Editor\Data\il2cpp\build\deploy\UnityLinker.exe @Library\Bee\artifacts\rsp\3806026182830091584.rsp
Fatal error in Unity CIL Linker
Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Windows.Foundation.UniversalApiContract, Version=8.0.0.0, Culture=neutral, PublicKeyToken=null'
   at Unity.IL2CPP.Common.MissingMethodStubber.GetTypeModule(TypeReference type, IEnumerable`1 assemblies)
   at Unity.Linker.Steps.AddUnresolvedStubsStep.MarkAssemblyOfType(UnityLinkContext context, TypeReference type)
   at Unity.Linker.Steps.Marking.UnresolvedStubMarking.HandleUnresolvedType(TypeReference reference)
   at Unity.Linker.Steps.UnityMarkStep.HandleUnresolvedType(TypeReference reference)
   at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference, DependencyInfo reason, IMemberDefinition sourceLocationMember)
   at Mono.Linker.Steps.MarkStep.MarkField(FieldDefinition field, DependencyInfo& reason)
   at Mono.Linker.Steps.MarkStep.MarkFields(TypeDefinition type, Boolean includeStatic, DependencyInfo& reason, Boolean markBackingFieldsOnlyIfPropertyMarked)
   at Mono.Linker.Steps.MarkStep.ApplyPreserveInfo(TypeDefinition type)
   at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference, DependencyInfo reason, IMemberDefinition sourceLocationMember)
   at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference, DependencyInfo reason, IMemberDefinition sourceLocationMember)
   at Mono.Linker.Steps.MarkStep.MarkField(FieldDefinition field, DependencyInfo& reason)
   at Mono.Linker.Steps.MarkStep.MarkEntireTypeInternal(TypeDefinition type, Boolean includeBaseTypes, DependencyInfo& reason, IMemberDefinition sourceLocationMember, HashSet`1 typesAlreadyVisited)
   at Mono.Linker.Steps.MarkStep.MarkEntireTypeInternal(TypeDefinition type, Boolean includeBaseTypes, DependencyInfo& reason, IMemberDefinition sourceLocationMember, HashSet`1 typesAlreadyVisited)
   at Mono.Linker.Steps.MarkStep.MarkEntireAssembly(AssemblyDefinition assembly)
   at Mono.Linker.Steps.MarkStep.InitializeAssembly(AssemblyDefinition assembly)
   at Unity.Linker.Steps.UnityMarkStep.InitializeAssembly(AssemblyDefinition assembly)
   at Mono.Linker.Steps.MarkStep.Initialize()
   at Unity.Linker.Steps.UnityMarkStep.Process(LinkContext context)
   at Unity.Linker.UnityPipeline.ProcessStep(LinkContext context, IStep step)
   at Mono.Linker.Pipeline.Process(LinkContext context)
   at Unity.Linker.UnityDriver.UnityRun(UnityLinkContext context, UnityPipeline p, LinkRequest linkerOptions, TinyProfiler2 tinyProfiler, ILogger customLogger)
   at Unity.Linker.UnityDriver.RunDriverWithoutErrorHandling(TinyProfiler2 tinyProfiler, ILogger customLogger)
   at Unity.Linker.UnityDriver.RunDriverWithoutErrorHandling()
   at Unity.Linker.UnityDriver.RunDriver()

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

I know this means someting somewhere is referencing a WinRT or WinMD namespace, but everything in my code that does is conditionned by "#if WINDOWS_UWP ; #if ENABLE_WINMD_SUPPORT ; #if !UNITY_EDITOR && UNITY_WSA_10_0 ; #if NETFX_CORE ; #if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN ; #if (UNITY_WSA && !UNITY_EDITOR)..."

I tried to check into the .rsp file to see if Windows.Foundation is referenced but it isn't, and the only topic I can find on internet that is close is talking about the Burst package that fixed it above v1.7.x -> I have Burst (used by gltFast), but the 1.8.3 version that does not have the issue any more....

Anyone came across this problem before ?

Thanks

Screenshots

Capture d’écran 2023-09-04 123221

Capture d’écran 2023-09-04 123237

Capture d’écran 2023-09-04 123307

Your setup (please complete the following information)

  • Unity Version 2022.3.7f1
  • MRTK Version 2.8

Target platform (please complete the following information)

  • MagicLeap 2
@SashelI SashelI added the Bug label Sep 4, 2023
@AMollis
Copy link
Member

AMollis commented Sep 19, 2023

@SashelI we recommend you move to MRTK3. Magic Leap is supporting MRTK3, and can assist with issues related to that platform.

@AMollis AMollis closed this as not planned Won't fix, can't repro, duplicate, stale Sep 19, 2023
@SashelI
Copy link
Author

SashelI commented Oct 2, 2023

@SashelI we recommend you move to MRTK3. Magic Leap is supporting MRTK3, and can assist with issues related to that platform.

Hi,

We currently can't afford to move to MRTK 3 as it is a full product and not a new project

@theomahaproject
Copy link

Hey @SashelI! Did you find an answer to this?

@SashelI
Copy link
Author

SashelI commented Dec 23, 2023

Hey @SashelI! Did you find an answer to this?

Hey, this was a while ago, but I think this was one of these :

  • I had the dlls of "Windows.ApiContract" inside the project, but not installed with Nuget package manager

  • Or, the dll was referenced in a "link" file but actually never used so I could remove it safely

Sorry I can't remember the exact solution, but after creating a new project from scratch and fighting with dll problems I managed to solve this.

@theomahaproject
Copy link

theomahaproject commented Jan 5, 2024

Hey for anyone else struggling with this I also seemed to fix it by deleting the Library folder and restarting Unity :)

I've had to do it a few times since then but it always seems to work. I've been having battles with low ram usage while building in Unity despite having 32gb of ram. Closing Chrome, Steam, etc. while building has fixed this for me and resulted in less of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants