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

IL2CPP builds don't work? #38

Closed
meds opened this issue Nov 11, 2018 · 10 comments
Closed

IL2CPP builds don't work? #38

meds opened this issue Nov 11, 2018 · 10 comments

Comments

@meds
Copy link

meds commented Nov 11, 2018

Only happens with IL2CPP, Mono is fine.

My build settings:

image

I get the following error when building an apk:

stdout:
Fatal error in Unity CIL Linker
Mono.Linker.MarkException: Error processing method: 'RSG.IPromise1<Proyecto26.ResponseHelper> Proyecto26.RestClient::Post(Proyecto26.RequestHelper)' in assembly: 'Proyecto26.RestClient.dll' ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'RSG.Promise, Version=3.0.1.0, Culture=neutral, PublicKeyToken=null' at Unity.IL2CPP.Common.MissingMethodStubber.GetTypeModule(TypeReference type, IEnumerable1 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)
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
at Unity.Linker.Steps.UnityMarkStep.ProcessMethod(MethodDefinition method)
at Mono.Linker.Steps.MarkStep.ProcessQueue()
--- End of inner exception stack trace ---
at Mono.Linker.Steps.MarkStep.ProcessQueue()
at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
at Mono.Linker.Steps.MarkStep.Process()
at Unity.Linker.Steps.UnityMarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.Process(LinkContext context)
at Unity.Linker.UnityDriver.Run()
at Unity.Linker.UnityDriver.RunDriverWithoutErrorHandling()
at Unity.Linker.UnityDriver.RunDriver()
stderr:

and

Exception: C:\Program Files\Unity\Hub\Editor\2018.3.0b7\Editor\Data\il2cpp\build/UnityLinker.exe did not run properly!
UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:130)
UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action1[T] setupStartInfo) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:73) UnityEditorInternal.AssemblyStripper.RunAssemblyLinker (System.Collections.Generic.IEnumerable1[T] args, System.String& out, System.String& err, System.String linkerPath, System.String workingDirectory) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:174)
UnityEditorInternal.AssemblyStripper.StripAssembliesTo (System.String[] assemblies, System.String[] searchDirs, System.String outputFolder, System.String workingDirectory, System.String& output, System.String& error, System.String linkerPath, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Collections.Generic.IEnumerable1[T] additionalBlacklist, UnityEditor.BuildTargetGroup buildTargetGroup, UnityEditor.ManagedStrippingLevel managedStrippingLevel) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:121) UnityEditorInternal.AssemblyStripper.RunAssemblyStripper (System.Collections.IEnumerable assemblies, System.String managedAssemblyFolderPath, System.String[] assembliesToStrip, System.String[] searchDirs, System.String monoLinkerPath, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, UnityEditor.RuntimeClassRegistry rcr, UnityEditor.ManagedStrippingLevel managedStrippingLevel) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:305) UnityEditorInternal.AssemblyStripper.StripAssemblies (System.String managedAssemblyFolderPath, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, UnityEditor.RuntimeClassRegistry rcr, UnityEditor.ManagedStrippingLevel managedStrippingLevel) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:198) UnityEditorInternal.IL2CPPBuilder.Run () (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:176) UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:35)
UnityEditor.Android.PostProcessor.Tasks.RunIl2Cpp.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at :0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at :0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:286)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

@jdnichollsc
Copy link
Member

Hello!
Are you downloading the plugin from nuget? Otherwise, you have to remove the RSG.Promise dll for .NET 305 (legacy code) because you only need the .NET Standard version.

Please, let me know and thanks for use this plugin

@jdnichollsc
Copy link
Member

What do you think about this issue my friend? Real-Serious-Games/C-Sharp-Promise#84

@meds
Copy link
Author

meds commented Nov 11, 2018

As per your suggestion I deleted RSG.Promise_net35.dll, unfortunately that didn't seem to solve the issue or at least creates another issue which is very weird and might actually be a Unity bug. The error I think has to do with Proyecto26.RestClient targetting .net 3.5 while I'm building .net 4.0, however if I drop the version to 3.5 in the compiler (which is now deprecated) the RSG.Promise_netstandard.dll is no longer compatible as that targets 4.0.

But I would have thought that .net 4.0 would support a .net 3.5 assembly..

stdout:

Fatal error in Unity CIL Linker
Mono.Linker.MarkException: Error processing method: 'RSG.IPromise1<Proyecto26.ResponseHelper> Proyecto26.RestClient::Post(Proyecto26.RequestHelper)' in assembly: 'Proyecto26.RestClient.dll' ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'RSG.Promise, Version=3.0.1.0, Culture=neutral, PublicKeyToken=null' at Unity.IL2CPP.Common.MissingMethodStubber.GetTypeModule(TypeReference type, IEnumerable1 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)
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
at Unity.Linker.Steps.UnityMarkStep.ProcessMethod(MethodDefinition method)
at Mono.Linker.Steps.MarkStep.ProcessQueue()
--- End of inner exception stack trace ---
at Mono.Linker.Steps.MarkStep.ProcessQueue()
at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
at Mono.Linker.Steps.MarkStep.Process()
at Unity.Linker.Steps.UnityMarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.Process(LinkContext context)
at Unity.Linker.UnityDriver.Run()
at Unity.Linker.UnityDriver.RunDriverWithoutErrorHandling()
at Unity.Linker.UnityDriver.RunDriver()
stderr:

UnityEngine.Debug:LogError(Object)
UnityEditorInternal.Runner:RunProgram(Program, String, String, String, CompilerOutputParserBase) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:128)
UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase, Action1) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:73) UnityEditorInternal.AssemblyStripper:RunAssemblyLinker(IEnumerable1, String&, String&, String, String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:174)
UnityEditorInternal.AssemblyStripper:StripAssembliesTo(String[], String[], String, String, String&, String&, String, IIl2CppPlatformProvider, IEnumerable1, BuildTargetGroup, ManagedStrippingLevel) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:121) UnityEditorInternal.AssemblyStripper:RunAssemblyStripper(IEnumerable, String, String[], String[], String, IIl2CppPlatformProvider, RuntimeClassRegistry, ManagedStrippingLevel) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:305) UnityEditorInternal.AssemblyStripper:StripAssemblies(String, IIl2CppPlatformProvider, RuntimeClassRegistry, ManagedStrippingLevel) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:198) UnityEditorInternal.IL2CPPBuilder:Run() (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:176) UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action1, RuntimeClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:35)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

@jdnichollsc
Copy link
Member

What version of Unity are you using?

@jdnichollsc
Copy link
Member

Can you rename the dll of RSG.Promise to RSG.Promise.dll?

@jdnichollsc
Copy link
Member

jdnichollsc commented Nov 11, 2018

On the other hand, do you have a link.xml file?

Something like this:

<linker>
       <assembly fullname="Proyecto26.RestClient" preserve="all" />
       <assembly fullname="RSG.Promise" preserve="all" />
</linker>

or

<linker>
       <assembly fullname="Proyecto26.RestClient">
               <type fullname="RSG.Promise" preserve="all"/>
       </assembly>
</linker>

Let me know

@jdnichollsc
Copy link
Member

If you want I can generate other dll of Proyecto26.RestClient for .NET Standard.
I apologize for the inconveniences, I do not have much experience with Unity

@meds
Copy link
Author

meds commented Nov 16, 2018

I think it's fine the way it is, but perhaps the latest version of the plugin shouldn't have DLLs for the older versions of Unity, but that's just my opinion and isn't something that necessarily has to happen.

Thanks for your help!

@meds meds closed this as completed Nov 16, 2018
@jdnichollsc
Copy link
Member

all users don't have the last version of Unity :/

@jdnichollsc
Copy link
Member

@meds on the other hand, you can use RSG.Promise.dll (net 3.5 version) with .NET 4 except in UWP because .NET Standard is required to support that platform.

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

No branches or pull requests

2 participants