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

Error: IL2CPP error (no further information about what managed code was being converted is available) #1312

Open
HassannKhan opened this issue Jan 18, 2025 · 18 comments
Labels
type:bug Something isn't working

Comments

@HassannKhan
Copy link

Plugin Version or Commit ID

v0.15.0

Unity Version

2022.3.20f1

Your Host OS

Windows 10

Target Platform

Android

Target Device

No response

[Windows Only] Visual Studio C++ and Windows SDK Version

No response

[Linux Only] GCC/G++ and GLIBC Version

No response

[Android Only] Android Build Tools and NDK Version

No response

[iOS Only] XCode Version

No response

Build Command

unity build

Bug Description

While using niantic lightship map in unity, i imported media pipe and getting this error while building the apk

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 Google.Protobuf.Collections.RepeatedField1<Niantic.Lightship.Maps.Core.Proto.MapArea>::Add(Google.Protobuf.Collections.RepeatedField1<!0>))
---> System.ArgumentException: Unresolved method reference : System.Void Google.Protobuf.Collections.RepeatedField1<Niantic.Lightship.Maps.Core.Proto.MapArea>::Add(Google.Protobuf.Collections.RepeatedField1<!0>)
at Unity.IL2CPP.DataModel.TypeContext.GetDef(MethodReference reference)
at Unity.IL2CPP.DataModel.BuildLogic.MethodReferenceResolver.ResolveMethodReference(TypeContext context, UnderConstructionMethodReferenceRepository repository, CecilSourcedAssemblyData assemblyData, MethodReference methodReference, Dictionary2 mapping) at Unity.IL2CPP.DataModel.BuildLogic.MethodReferenceResolver.ResolveAssemblyMethodReferences(TypeContext context, UnderConstructionMethodReferenceRepository repository, CecilSourcedAssemblyData assemblyDef, ReadOnlyHashSet1 methodReferences)
at Unity.IL2CPP.DataModel.BuildLogic.DataModelBuilder.<>c__DisplayClass16_0.b__0(CecilSourcedAssemblyData data)
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)
at Unity.IL2CPP.DataModel.BuildLogic.DataModelBuilder.Build()
at Unity.IL2CPP.AssemblyConversion.Phases.InitializePhase.Run(AssemblyConversionContext context)
at Unity.IL2CPP.AssemblyConversion.Classic.ClassicConverter.Run(AssemblyConversionContext context)
at Unity.IL2CPP.AssemblyConversion.AssemblyConverter.ConvertAssemblies(AssemblyConversionContext context, ConversionMode conversionMode)
at Unity.IL2CPP.AssemblyConversion.AssemblyConverter.ConvertAssemblies(TinyProfiler2 tinyProfiler, AssemblyConversionInputData data, AssemblyConversionParameters parameters, AssemblyConversionInputDataForTopLevelAccess dataForTopLevel)

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

Steps to Reproduce the Bug

do what i said above

Log

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 Google.Protobuf.Collections.RepeatedField1<Niantic.Lightship.Maps.Core.Proto.MapArea>::Add(Google.Protobuf.Collections.RepeatedField1<!0>))
---> System.ArgumentException: Unresolved method reference : System.Void Google.Protobuf.Collections.RepeatedField1<Niantic.Lightship.Maps.Core.Proto.MapArea>::Add(Google.Protobuf.Collections.RepeatedField1<!0>)
at Unity.IL2CPP.DataModel.TypeContext.GetDef(MethodReference reference)
at Unity.IL2CPP.DataModel.BuildLogic.MethodReferenceResolver.ResolveMethodReference(TypeContext context, UnderConstructionMethodReferenceRepository repository, CecilSourcedAssemblyData assemblyData, MethodReference methodReference, Dictionary2 mapping) at Unity.IL2CPP.DataModel.BuildLogic.MethodReferenceResolver.ResolveAssemblyMethodReferences(TypeContext context, UnderConstructionMethodReferenceRepository repository, CecilSourcedAssemblyData assemblyDef, ReadOnlyHashSet1 methodReferences)
at Unity.IL2CPP.DataModel.BuildLogic.DataModelBuilder.<>c__DisplayClass16_0.b__0(CecilSourcedAssemblyData data)
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)
at Unity.IL2CPP.DataModel.BuildLogic.DataModelBuilder.Build()
at Unity.IL2CPP.AssemblyConversion.Phases.InitializePhase.Run(AssemblyConversionContext context)
at Unity.IL2CPP.AssemblyConversion.Classic.ClassicConverter.Run(AssemblyConversionContext context)
at Unity.IL2CPP.AssemblyConversion.AssemblyConverter.ConvertAssemblies(AssemblyConversionContext context, ConversionMode conversionMode)
at Unity.IL2CPP.AssemblyConversion.AssemblyConverter.ConvertAssemblies(TinyProfiler2 tinyProfiler, AssemblyConversionInputData data, AssemblyConversionParameters parameters, AssemblyConversionInputDataForTopLevelAccess dataForTopLevel)

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

Screenshot/Video

No response

Additional Context

No response

@HassannKhan HassannKhan added the type:bug Something isn't working label Jan 18, 2025
@homuler
Copy link
Owner

homuler commented Jan 19, 2025

i imported media pipe and getting this error while building the apk

Will you describe how you imported this plugin? (e.g. how did you download it?)
At the very least, the error message seems to suggest that the issue lies with Niantic Lightship Maps rather than MediaPipe. Would removing this plugin allow the build to succeed?

@HassannKhan
Copy link
Author

HassannKhan commented Jan 19, 2025 via email

@homuler
Copy link
Owner

homuler commented Jan 19, 2025

I'm asking whether removing this MediaPipe plugin, not Niantic, would allow the build to succeed.
But after all, if removing Niantic allows the build to succeed, wouldn't that mean the issue isn't with this plugin?

@HassannKhan
Copy link
Author

HassannKhan commented Jan 19, 2025 via email

@HassannKhan
Copy link
Author

HassannKhan commented Jan 19, 2025 via email

@homuler
Copy link
Owner

homuler commented Jan 19, 2025

Why would I need to remove any one of them?

I am asking questions because it is necessary to identify the cause in order to solve the problem.
If the issue lies with Niantic, I wouldn’t be able to provide an answer even if you ask me.

If it’s possible to build when only one plugin is imported, I suspect that there might be a conflict between libraries.
Judging from the error message, does Niantic’s plugin also include Google.Protobuf.dll?

@HassannKhan
Copy link
Author

does Niantic’s plugin also include Google.Protobuf.dll?

Yes, and a version number 3.0.0

@homuler
Copy link
Owner

homuler commented Jan 19, 2025

If you delete it, can you build your app?

@HassannKhan
Copy link
Author

If I delete Media Pipe, I can build the app.

@homuler
Copy link
Owner

homuler commented Jan 19, 2025

I mean Google.Protobuf.dll (v3.0.0) in Niantic's plugin.

@HassannKhan
Copy link
Author

HassannKhan commented Jan 19, 2025 via email

@homuler
Copy link
Owner

homuler commented Jan 19, 2025

It is likely that the issue is caused by a conflict between two plugins, but it seems to be a problem specific to your project, so it's difficult for me to investigate the cause on my end.

Anyways, if I tell you what's actually causing the issue. Would you be kind enough to make the changes for me? Or atleast tell me how it can be done?

If the cause is identified and any modifications are necessary for this project, I believe it would be possible to address them, so please let me know.

@HassannKhan
Copy link
Author

@homuler QUICK QUESTION

Will it work if Graphic API of unity is OpenGL ES 3.0 instead of Vulkan ?

@HassannKhan
Copy link
Author

@homuler and don't worry about the conflict of protobuf files, I took care of that issue.

@homuler
Copy link
Owner

homuler commented Jan 23, 2025

Will it work if Graphic API of unity is OpenGL ES 3.0 instead of Vulkan ?

Yes. Actually, the sample app (Android) uses OpenGL ES.
Image

Rather, to avoid copying the input image to the CPU, it is necessary to use OpenGL ES.
Note that some features may not work in version 3.0.

@homuler
Copy link
Owner

homuler commented Jan 23, 2025

@HassannKhan By the way, has the original issue been resolved?

@HassannKhan
Copy link
Author

yeah, I made changes into one file while making sure it doesn't break the functionality.

@homuler If my aim is to achieve background removal. Can this be done using the segmentation masking this provides?

I wrote a shader, but it works only when graphic API Vulkan is selected.

@homuler
Copy link
Owner

homuler commented Jan 25, 2025

If the issue has been resolved, please write down the cause and the solution if possible and close the issue.
For questions unrelated to the original issue, please create a separate issue to ask them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants