googlesamples / unity-jar-resolver

Unity plugin which resolves Android & iOS dependencies and performs version management
Other
1.21k stars 337 forks source link

[Bug] Services Resolver Exception on Unity 2021.3.6 #533

Closed dantasulisses closed 1 year ago

dantasulisses commented 1 year ago

[REQUIRED] Please fill in the following fields:

[REQUIRED] Please describe the issue here:

In the newer Unity version (2021.3.6) the resolver instantly fails when trying to Resolve the Android dependencies. The stack trace is below

Stopped polling job due to exception: System.NullReferenceException: Object reference not set to an instance of an object
  at Google.JarResolver.Dependency.IsGreater (System.String version1, System.String version2) [0x00027] in Z:\tmp\tmp.TUPuobw8Wf\third_party\unity\unity_jar_resolver\source\JarResolverLib\src\Google.JarResolver\Dependency.cs:196 
  at Google.JarResolver.Dependency+VersionComparer.Compare (System.String x, System.String y) [0x00000] in Z:\tmp\tmp.TUPuobw8Wf\third_party\unity\unity_jar_resolver\source\JarResolverLib\src\Google.JarResolver\Dependency.cs:238 
  at GooglePlayServices.PlayServicesResolver.CheckGradleVersionForJetifier (System.Boolean useJetifier, System.String titlePrefix, System.Action`1[T] complete) [0x0003b] in Z:\tmp\tmp.TUPuobw8Wf\third_party\unity\unity_jar_resolver\source\AndroidResolver\src\PlayServicesResolver.cs:2622 
  at GooglePlayServices.PlayServicesResolver.CanEnableJetifierOrPromptUser (System.String titlePrefix, System.Action`1[T] complete) [0x00046] in Z:\tmp\tmp.TUPuobw8Wf\third_party\unity\unity_jar_resolver\source\AndroidResolver\src\PlayServicesResolver.cs:2747 
  at GooglePlayServices.PlayServicesResolver.ResolveUnsafeAfterJetifierCheck (System.Action`1[T] resolutionComplete, System.Boolean forceResolution, System.Boolean isAutoResolveJob, System.Boolean closeWindowOnCompletion) [0x00027] in Z:\tmp\tmp.TUPuobw8Wf\third_party\unity\unity_jar_resolver\source\AndroidResolver\src\PlayServicesResolver.cs:1752 
  at GooglePlayServices.PlayServicesResolver+<ScheduleResolve>c__AnonStorey5.<>m__0 () [0x00000] in Z:\tmp\tmp.TUPuobw8Wf\third_party\unity\unity_jar_resolver\source\AndroidResolver\src\PlayServicesResolver.cs:1719 
  at GooglePlayServices.PlayServicesResolver.ExecuteNextResolveJob () [0x00069] in Z:\tmp\tmp.TUPuobw8Wf\third_party\unity\unity_jar_resolver\source\AndroidResolver\src\PlayServicesResolver.cs:1576 
  at GooglePlayServices.PlayServicesResolver.ScheduleResolve (System.Boolean forceResolution, System.Boolean closeWindowOnCompletion, System.Action`1[T] resolutionCompleteWithResult, System.Boolean isAutoResolveJob) [0x000a7] in Z:\tmp\tmp.TUPuobw8Wf\third_party\unity\unity_jar_resolver\source\AndroidResolver\src\PlayServicesResolver.cs:1732 
  at GooglePlayServices.PlayServicesResolver.AutoResolve (System.Action resolutionComplete) [0x00017] in Z:\tmp\tmp.TUPuobw8Wf\third_party\unity\unity_jar_resolver\source\AndroidResolver\src\PlayServicesResolver.cs:1236 
  at GooglePlayServices.PlayServicesResolver.<ScheduleAutoResolve>m__A () [0x00016] in Z:\tmp\tmp.TUPuobw8Wf\third_party\unity\unity_jar_resolver\source\AndroidResolver\src\PlayServicesResolver.cs:1215 
  at Google.RunOnMainThread.ExecutePollingJobs () [0x0004a] in Z:\tmp\tmp.MI6gIp8Q3C\third_party\unity\unity_jar_resolver\source\VersionHandlerImpl\src\RunOnMainThread.cs:409 
UnityEngine.Debug:LogError (object)
Google.RunOnMainThread:ExecutePollingJobs () (at Z:/tmp/tmp.MI6gIp8Q3C/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:412)
Google.RunOnMainThread:<ExecuteAllUnnested>m__1 () (at Z:/tmp/tmp.MI6gIp8Q3C/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:541)
Google.RunOnMainThread:RunAction (System.Action) (at Z:/tmp/tmp.MI6gIp8Q3C/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:343)
Google.RunOnMainThread:ExecuteAllUnnested (bool) (at Z:/tmp/tmp.MI6gIp8Q3C/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:530)
Google.RunOnMainThread:ExecuteAll () (at Z:/tmp/tmp.MI6gIp8Q3C/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:512)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions () (at /Users/bokken/buildslave/unity/build/Editor/Mono/EditorApplication.cs:356)

Please answer the following, if applicable:

100%

What happened? How can we make the problem occur? Just upgrade to the latest Unity 2021, install the dependency Manager through Package Manager .tgz file, and in Mac (i don't have Windows to test), while in Android Build Target, try to do any "Resolve".

Revan1993 commented 1 year ago

Have same issue but on Windows.

Upd. After disable Jetifire all work like a charm

paulinon commented 1 year ago

Hi @dantasulisses,

I'm unable to replicate this behavior using the steps you've listed so far, but I've observed that my Jetifier is disabled. Could you try disabling it and see if it resolves the issue?

dantasulisses commented 1 year ago

Hi @paulinon disabling Jetfier does fix the problem. But I think that Jetfier should be possible to be enabled without errors right?

paulinon commented 1 year ago

Hi @dantasulisses,

I've come across this thread saying that there's an issue when building for Android using Unity 2021.3.6f1, and the workaround is to copy the whole Tools folder from a previous Unity version. Could you try this workaround and see if you're encountering the same behavior while Jetifier is enabled?

google-oss-bot commented 1 year ago

Hey @dantasulisses. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

dantasulisses commented 1 year ago

For now I think the ball is in Unity's court, as they need to fix the changes in 2021.3.6 as explained in the forum post above.