Skip to content

[Bug] Unity 2021.2 fails to compile #440

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

Closed
joaquingrech opened this issue Jun 15, 2021 · 9 comments
Closed

[Bug] Unity 2021.2 fails to compile #440

joaquingrech opened this issue Jun 15, 2021 · 9 comments

Comments

@joaquingrech
Copy link

Unity 2021.2 alpha 20 currently fails to compile anything with the resolver on it.

The error is this:

AmbiguousMatchException: Ambiguous match found.
System.RuntimeType.GetMethodImplCommon (System.String name, System.Int32 genericParameterCount, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConv, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) (at <84b303d55b854255908e55ea69da0924>:0)
System.RuntimeType.GetMethodImpl (System.String name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConv, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) (at <84b303d55b854255908e55ea69da0924>:0)
System.Type.GetMethod (System.String name, System.Reflection.BindingFlags bindingAttr) (at <84b303d55b854255908e55ea69da0924>:0)
System.Type.GetMethod (System.String name) (at <84b303d55b854255908e55ea69da0924>:0)
GooglePlayServices.UnityCompat.GetUnity56AndAboveApplicationIdentifier (UnityEditor.BuildTarget buildTarget) (at /Users/chkuang/Workspace/Git/unity-jar-resolver/source/AndroidResolver/src/UnityCompat.cs:446)
GooglePlayServices.UnityCompat.GetApplicationId (UnityEditor.BuildTarget buildTarget) (at /Users/chkuang/Workspace/Git/unity-jar-resolver/source/AndroidResolver/src/UnityCompat.cs:500)
GooglePlayServices.PlayServicesResolver.GetAndroidApplicationId () (at /Users/chkuang/Workspace/Git/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1043)
GooglePlayServices.PlayServicesResolver.m__36 () (at /Users/chkuang/Workspace/Git/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1431)
GooglePlayServices.PlayServicesResolver+PropertyPoller1[T].Poll (System.Func1[TResult] getCurrentValue, GooglePlayServices.PlayServicesResolver+PropertyPoller`1+Changed[T] changed) (at /Users/chkuang/Workspace/Git/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:343)
GooglePlayServices.PlayServicesResolver.PollBundleId () (at /Users/chkuang/Workspace/Git/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1431)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <034d8b3a8a0343ceb752ecf3815d6e99>:0)

@google-oss-bot
Copy link

This issue does not seem to follow the issue template. Make sure you provide all the required information.

@paulinon paulinon removed the new to be triaged label Jun 16, 2021
@paulinon
Copy link
Collaborator

Hi @joaquingrech,

It seems that your inquiry doesn't follow the template. It would be great if you can provide more information related to your issue such as the operating system used, SDK version used, and the steps you've taken before facing the issue. This way, we can identify the possible cause of this behavior.

Thanks!

@paulinon paulinon added the needs-info Need information for the developer label Jun 16, 2021
@joaquingrech
Copy link
Author

Ok, SDK version: latest as of today. 1.2.165
OS: Windows 10
Unity version: 2021.2.0a20

It´s been happening for months in all 2021.2.0.a branch. I´ve contacted Unity but they send the ball here.

You just need to import the package and you´ll begin to get errors inmediately.

@google-oss-bot google-oss-bot added needs-attention Need Googler's attention and removed needs-info Need information for the developer labels Jun 16, 2021
@paulinon
Copy link
Collaborator

Hi @joaquingrech,

It looks like this exception is raised in C#, possible due to the C# libraries being upgraded or different in the Unity version you're using.

Could you try using a stable version of Unity 2021 (such as Unity 2021.1.11) and see if the issue persists?

@paulinon paulinon added needs-info Need information for the developer and removed needs-attention Need Googler's attention labels Jun 17, 2021
@joaquingrech
Copy link
Author

The stable (older) version works. The issue is in the newer and upcoming version of Unity. Unity upgraded their libraries and compiler to a newer .Net. From now on, they will be using those libraries. What this means is that the resolver won't work in its current state.

That's exactly why I'm reporting this issue before Unity 2021.2 comes out of beta and hits the fan.

It's also a major problem because we can't test the next release of Unity. Many of the libraries and games that we use to test are using the Google Resolver. Not having it working, won't allow for many of the tests to make sure Unity 2021.2 is running properly before official release.

@google-oss-bot google-oss-bot added needs-attention Need Googler's attention and removed needs-info Need information for the developer labels Jun 18, 2021
@vimanyu
Copy link
Collaborator

vimanyu commented Jun 18, 2021

Thank you for clarifying and thank you for the heads up.
Just took a quick look at this Unity thread and looks like 2021.2 has a bunch of incoming changes. I will bring this up to the team and add this to our roadmap.

@DellaBitta
Copy link
Collaborator

More information is in the duplicate #447 as mentioned above.

@chkuang-g
Copy link
Collaborator

Hi folks,

Thanks to @patm1987's PR #449, the fix was merge into the repo.

I'll prepare another release of EDM4U soon.

If you need the patch right away, you can build EDM4U from source using the following commands:

# Build .unitypackage under 'build/' folder
./gradlew buildPlugin

# Build .tgz under 'build/' folder
./gradlew buildUpmPlugin

@chkuang-g chkuang-g added this to the 1.2.166 milestone Jun 29, 2021
@chkuang-g
Copy link
Collaborator

EDM4U 1.2.166 is available for both .unitypackage and .tgz format now.

@googlesamples googlesamples locked and limited conversation to collaborators Jul 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants