Open guneyozsan opened 3 years ago
Pushed an update right now. Could you give it a try again? Also, sometimes you have to click away from Unity and re-focus on the app to trigger the Package read process. I can't find any command to trigger it reliably as of now.
Hello,
I just tried it. I can say it works but it needs some intervention for my config.
In my setup, Preferences/Auto Refresh
is disabled.
After clicking "update", if I do Ctrl+r
(refresh) it refreshes the assets and recompiles the scripts, and the plugin I wanted to update is correctly updated.
If I don't do Ctrl+r
(refresh) it eventually crashes. For example:
NullReferenceException
.Maybe a force refresh option at the end of the operation could prevent this issue. One of the methods mentioned here can be used for forcing a refresh: http://answers.unity.com/answers/1210416/view.html
NullReferenceException: Object reference not set to an instance of an object
GitPackageUpdater.GitPackageUpdaterEditorWindow.ReinstallPackage (System.String package) (at Library/PackageCache/com.quantumcalzone.unitygitpackageupdater@b35a8ae38c/Editor/EditorWindows/GitPackageUpdaterEditorWindow.cs:149)
GitPackageUpdater.GitPackageUpdaterEditorWindow.OnGUI () (at Library/PackageCache/com.quantumcalzone.unitygitpackageupdater@b35a8ae38c/Editor/EditorWindows/GitPackageUpdaterEditorWindow.cs:94)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at <3d6d6a4a6d7c4ec2aa654b7d8f54a096>:0)
UnityEditor.HostView.Invoke (System.String methodName) (at <3d6d6a4a6d7c4ec2aa654b7d8f54a096>:0)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <3d6d6a4a6d7c4ec2aa654b7d8f54a096>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <3d6d6a4a6d7c4ec2aa654b7d8f54a096>:0)
UnityEditor.DockArea.OldOnGUI () (at <3d6d6a4a6d7c4ec2aa654b7d8f54a096>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <cb39c3d61d484a1d9d85158bfe5b2e83>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <cb39c3d61d484a1d9d85158bfe5b2e83>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <cb39c3d61d484a1d9d85158bfe5b2e83>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <cb39c3d61d484a1d9d85158bfe5b2e83>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus) (at <cb39c3d61d484a1d9d85158bfe5b2e83>:0)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <cb39c3d61d484a1d9d85158bfe5b2e83>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <cb39c3d61d484a1d9d85158bfe5b2e83>:0)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <cb39c3d61d484a1d9d85158bfe5b2e83>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <cb39c3d61d484a1d9d85158bfe5b2e83>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <cb39c3d61d484a1d9d85158bfe5b2e83>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <cb39c3d61d484a1d9d85158bfe5b2e83>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <cb39c3d61d484a1d9d85158bfe5b2e83>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <cb39c3d61d484a1d9d85158bfe5b2e83>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <cb39c3d61d484a1d9d85158bfe5b2e83>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <cb39c3d61d484a1d9d85158bfe5b2e83>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <cb39c3d61d484a1d9d85158bfe5b2e83>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <cb39c3d61d484a1d9d85158bfe5b2e83>:0)
UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <cb39c3d61d484a1d9d85158bfe5b2e83>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <c6fb44a03db64bd4a43ea88cab15457f>:0)
More information:
Preferences/Auto Refresh
enabled/disabled has no effect.Player Settings/Scripting define symbols
with a dummy define. However, it only refreshes and recompiles scripts, but does not have Package Manager resolve dependencies (Implementation: https://github.com/QuantumCalzone/UnityGitPackageUpdater/pull/5).UnityEditor.PackageManager.Client.Resolve()
that makes Package Manager resolve. However, I didn't test it in Unity 2020 yet (Implementation: https://github.com/QuantumCalzone/UnityGitPackageUpdater/pull/6).UnityEditor.PackageManager.Client
has Add()
and Remove()
methods for adding/removing dependencies. It may be better to use these methods instead of modifying the hash. However, if there are multiple dependencies to add/remove, these methods should be run sequentially after each one finishes. There is a working implementation that removes multiple dependencies along with suggestions from Unity staff: https://forum.unity.com/threads/solved-removing-packages-in-an-editor-script.697061/#post-4669562
I tried to update the Git package for Google Cardboard SDK from v1.4.1 to the latest v1.6.0. It does nothing when I first click the package name. Sequential attempts give
ArgumentException: oldValue is the empty string
.