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

Stopped polling job due to exception: System.MissingMethodException: UnityEditor.VersionControl.Task #262

Closed
Bibzball opened this issue Jul 25, 2019 · 14 comments

Comments

@Bibzball
Copy link

commented Jul 25, 2019

I updated Play Services Resolver to v1.2.123 and am getting this error on every auto-resolve.
Using Unity 2019.1.11f1

Stopped polling job due to exception: System.MissingMethodException: UnityEditor.VersionControl.Task UnityEditor.VersionControl.Provider.Checkout(string,UnityEditor.VersionControl.CheckoutMode) at Google.ProjectSettings.Set[T] (System.String name, T value) [0x00024] in /Users/smiles/dev/src/unity-jar-resolver/source/VersionHandlerImpl/src/ProjectSettings.cs:119 at Google.ProjectSettings+<SetBool>c__AnonStorey2.<>m__5 () [0x00000] in /Users/smiles/dev/src/unity-jar-resolver/source/VersionHandlerImpl/src/ProjectSettings.cs:154 at Google.ProjectSettings.SavePreferences (Google.ProjectSettings+SettingsSave saveLevel, System.Action saveToProject, System.Action saveToEditor) [0x00035] in /Users/smiles/dev/src/unity-jar-resolver/source/VersionHandlerImpl/src/ProjectSettings.cs:135 at Google.ProjectSettings.SetBool (System.String name, System.Boolean value) [0x00014] in /Users/smiles/dev/src/unity-jar-resolver/source/VersionHandlerImpl/src/ProjectSettings.cs:153 at GooglePlayServices.SettingsDialog.set_UseJetifier (System.Boolean value) [0x00000] in /Users/smiles/dev/src/unity-jar-resolver/source/PlayServicesResolver/src/SettingsDialog.cs:225 at GooglePlayServices.PlayServicesResolver.CanEnableJetifierOrPromptUser (System.String titlePrefix) [0x00179] in /Users/smiles/dev/src/unity-jar-resolver/source/PlayServicesResolver/src/PlayServicesResolver.cs:2270 at GooglePlayServices.PlayServicesResolver.ResolveUnsafe (System.Action1[T] resolutionComplete, System.Boolean forceResolution, System.Boolean isAutoResolveJob, System.Boolean closeWindowOnCompletion) [0x00012] in /Users/smiles/dev/src/unity-jar-resolver/source/PlayServicesResolver/src/PlayServicesResolver.cs:1610
at GooglePlayServices.PlayServicesResolver+c__AnonStorey1E.<>m__40 () [0x00000] in /Users/smiles/dev/src/unity-jar-resolver/source/PlayServicesResolver/src/PlayServicesResolver.cs:1579
at GooglePlayServices.PlayServicesResolver.ExecuteNextResolveJob () [0x00069] in /Users/smiles/dev/src/unity-jar-resolver/source/PlayServicesResolver/src/PlayServicesResolver.cs:1438
at GooglePlayServices.PlayServicesResolver.ScheduleResolve (System.Boolean forceResolution, System.Boolean closeWindowOnCompletion, System.Action1[T] resolutionCompleteWithResult, System.Boolean isAutoResolveJob) [0x000a7] in /Users/smiles/dev/src/unity-jar-resolver/source/PlayServicesResolver/src/PlayServicesResolver.cs:1592 at GooglePlayServices.PlayServicesResolver.AutoResolve (System.Action resolutionComplete) [0x00017] in /Users/smiles/dev/src/unity-jar-resolver/source/PlayServicesResolver/src/PlayServicesResolver.cs:1113 at GooglePlayServices.PlayServicesResolver.<ScheduleAutoResolve>m__48 () [0x00016] in /Users/smiles/dev/src/unity-jar-resolver/source/PlayServicesResolver/src/PlayServicesResolver.cs:1092 at Google.RunOnMainThread.ExecutePollingJobs () [0x0004a] in /Users/smiles/dev/src/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:300 UnityEngine.Debug:LogError(Object) Google.RunOnMainThread:ExecutePollingJobs() (at /Users/smiles/dev/src/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:303) Google.RunOnMainThread:<ExecuteAll>m__17() (at /Users/smiles/dev/src/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:414) Google.RunOnMainThread:RunAction(Action) (at /Users/smiles/dev/src/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:234) Google.RunOnMainThread:ExecuteAll() (at /Users/smiles/dev/src/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:406) UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

@stewartmiles

This comment has been minimized.

Copy link
Contributor

commented Jul 25, 2019

Thanks for the report, looks like a regression due to #256 and Unity - likely - have changed this API. @JimmyDeemo FYI

@stewartmiles stewartmiles added the bug label Jul 25, 2019

@JimmyDeemo

This comment has been minimized.

Copy link
Contributor

commented Jul 25, 2019

Roger that. I’ll try in Unity 2019 and see if I can come up with a fix.

@JimmyDeemo

This comment has been minimized.

Copy link
Contributor

commented Jul 26, 2019

@Bibzball Please can you tell me what .NET version your project is using?

@Bibzball

This comment has been minimized.

Copy link
Author

commented Jul 26, 2019

@JimmyDeemo It's setup as ".NET 4.x Equivalent"

@supersolid-Justy

This comment has been minimized.

Copy link

commented Jul 26, 2019

I see references of the 3.5 framework in the resolver which is deprecated in Unity 2019.1, so maybe theres something in this direction?

@JimmyDeemo

This comment has been minimized.

Copy link
Contributor

commented Jul 26, 2019

Please can you tell me how would I make sure that compilation is using the higher runtime, given this plugin is compiled to a .dll? How can I support Unity 2017/2018 that have both runtimes as well as 2019 that only has the higher one?

@Bibzball

This comment has been minimized.

Copy link
Author

commented Jul 26, 2019

@JimmyDeemo Not sure if I'm understanding your issue correctly, but maybe I can help? I'm also developing Unity plugins currently.
Since I can't use #if UNITY_XXXX_OR_NEWER when it's compiled to a .dll, I created a UnityVersionAtLeast(string version) helper that parse Application.unityVersion (which returns "201X.Y.ZZf1") to compare unity versions and allow you to call UnityVersionAtLeast("2019.1.1") to call different methods depending on Unity Version.

Sorry if I'm accidentally completely off-topic!

@stewartmiles

This comment has been minimized.

Copy link
Contributor

commented Jul 26, 2019

Folks, the resolver needs to be compiled against .NET 3.x since it works all the way back to Unity 4.7 (yes some folks still ship profitable games with Unity 4.x).

I think for the moment I'm going to bandaid this by wrapping the logic in try / catch just so the regression is fixed.

At runtime we already have code that will get the Unity version

public static float VersionMajorMinor {
however doing things conditional based upon this is so crazy brittle. It's better to just try to access a method / property / field using reflection, catch the exception and fallback for different versions as Unity tend to backport fixes which breaks simply version checking.

@stewartmiles

This comment has been minimized.

Copy link
Contributor

commented Jul 26, 2019

Oh I see @JimmyDeemo has a patch in #263, well lets give that a whirl.

@JimmyDeemo

This comment has been minimized.

Copy link
Contributor

commented Jul 26, 2019

Very sorry @stewartmiles but that patch doesn’t actually address the Unity version issue. I haven’t had chance to get a project setup that uses Perforce and Unity 2019.

Tbh I’m still a little hazy on why the call is a problem; the API hasn’t changed.

@stewartmiles

This comment has been minimized.

Copy link
Contributor

commented Jul 26, 2019

I took a look at the old and new API signatures and they have changed

public static Task Checkout(string asset, CheckoutMode mode)

changed to..

public static Task Checkout(string asset, CheckoutMode mode, ChangeSet changeset = null)

The problem is that the compiler bakes out the additional arguments required for methods in the calling module, so calling Checkout(asset, mode) and compiling the DLL with Unity 2019's DLL will result in Checkout(asset, mode, changeset) in the IL.

See https://haacked.com/archive/2010/08/10/versioning-issues-with-optional-arguments.aspx/

I'll use reflection to workaround this.

@stewartmiles

This comment has been minimized.

Copy link
Contributor

commented Jul 26, 2019

@aras-p

This comment has been minimized.

Copy link

commented Jul 31, 2019

Yeah turns out we accidentally broke this API when used from precompiled assemblies in 2019.x. Sorry about that, fixing it now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.