microsoft / AppCenter-SDK-Unity-Extension

Unity editor extension for the App Center SDK.
Other
71 stars 41 forks source link

Unity-Extension 1.1.2 "Remove SDK" not support appcenter-sdk-unity 2.1.0? #34

Closed SyaoranChang closed 5 years ago

SyaoranChang commented 5 years ago

Hi,

The versions: Unity 2018.2.21f1 AppCenter-SDK-Unity-Extension 1.1.2 appcenter-sdk-unity 2.1.0

Unity-Extension 1.1.2 "Remove SDK" not support appcenter-sdk-unity 2.1.0? When I try to remove Push SDK, show errors.

Removing log:

[App Center EdEx MSG426] Removing Push package... UnityEngine.Debug:Log(Object) AppCenterEditor.LocalLogger:LogWithTimeStamp(String) (at Assets/AppCenterEditorExtensions/Editor/Scripts/Utils/LocalLogger.cs:10) AppCenterEditor.AppCenterSDKPackage:RemovePackage(Boolean) (at Assets/AppCenterEditorExtensions/Editor/Scripts/Panels/SDKPackage/AppCenterSDKPackage.cs:52) AppCenterEditor.AppCenterSDKPackage:ShowPackageInstalledMenu() (at Assets/AppCenterEditorExtensions/Editor/Scripts/Panels/SDKPackage/AppCenterSDKPackage.cs:147) AppCenterEditor.AppCenterEditorSDKTools:DisplayPackagePanel(AppCenterSDKPackage) (at Assets/AppCenterEditorExtensions/Editor/Scripts/Panels/AppCenterEditorSDKTools.cs:95) AppCenterEditor.AppCenterEditor:OnGuiInternal() (at Assets/AppCenterEditorExtensions/Editor/AppCenterEditor.cs:146) AppCenterEditor.AppCenterEditor:HideRepaintErrors(Action) (at Assets/AppCenterEditorExtensions/Editor/AppCenterEditor.cs:117) AppCenterEditor.AppCenterEditor:OnGUI() (at Assets/AppCenterEditorExtensions/Editor/AppCenterEditor.cs:110) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Removing error log:

[App Center EdEx MSG491] App Center Editor Extensions: An unknown error occured and the Push SDK could not be removed. UnityEngine.Debug:LogError(Object) AppCenterEditor.LocalLogger:LogError(String) (at Assets/AppCenterEditorExtensions/Editor/Scripts/Utils/LocalLogger.cs:20) AppCenterEditor.AppCenterEditor:StateUpdateHandler(EdExStates, String, String) (at Assets/AppCenterEditorExtensions/Editor/AppCenterEditor.cs:275) AppCenterEditor.AppCenterEditor:RaiseStateUpdate(EdExStates, String, String) (at Assets/AppCenterEditorExtensions/Editor/AppCenterEditor.cs:219) AppCenterEditor.AppCenterSDKPackage:RemovePackage(Boolean) (at Assets/AppCenterEditorExtensions/Editor/Scripts/Panels/SDKPackage/AppCenterSDKPackage.cs:109) AppCenterEditor.AppCenterSDKPackage:ShowPackageInstalledMenu() (at Assets/AppCenterEditorExtensions/Editor/Scripts/Panels/SDKPackage/AppCenterSDKPackage.cs:147) AppCenterEditor.AppCenterEditorSDKTools:DisplayPackagePanel(AppCenterSDKPackage) (at Assets/AppCenterEditorExtensions/Editor/Scripts/Panels/AppCenterEditorSDKTools.cs:95) AppCenterEditor.AppCenterEditor:OnGuiInternal() (at Assets/AppCenterEditorExtensions/Editor/AppCenterEditor.cs:146) AppCenterEditor.AppCenterEditor:HideRepaintErrors(Action) (at Assets/AppCenterEditorExtensions/Editor/AppCenterEditor.cs:117) AppCenterEditor.AppCenterEditor:OnGUI() (at Assets/AppCenterEditorExtensions/Editor/AppCenterEditor.cs:110) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

annakocheshkova commented 5 years ago

Hi @SyaoranChang does this error occur repeatedly? What is your project structure?

SyaoranChang commented 5 years ago

Hi,

1.Remove SDK issue is test with Git Clone from https://github.com/microsoft/appcenter-sdk-unity.git 2.Another issue Installing Endless when use Unity 2018.4.3f1 (64-bit).

Situation 1: 1.Unity 2018.2.21f1 (64-bit) create new project. 2.Import Custom package AppCenterEditorExtensions-v1.1.2.unitypackage 3.Try Install SDK or Remove SDK no issue.

Situation 2: 1.Git Clone from https://github.com/microsoft/appcenter-sdk-unity.git 2.Open project use Unity 2018.2.21f1 (64-bit) 3.Import Custom package AppCenterEditorExtensions-v1.1.2.unitypackage 4.Try Push SDK click Remove SDK.

Removing log:

[App Center EdEx MSG12] Removing Push package... UnityEngine.Debug:Log(Object) AppCenterEditor.LocalLogger:LogWithTimeStamp(String) (at Assets/AppCenterEditorExtensions/Editor/Scripts/Utils/LocalLogger.cs:10) AppCenterEditor.AppCenterSDKPackage:RemovePackage(Boolean) (at Assets/AppCenterEditorExtensions/Editor/Scripts/Panels/SDKPackage/AppCenterSDKPackage.cs:52) AppCenterEditor.AppCenterSDKPackage:ShowPackageInstalledMenu() (at Assets/AppCenterEditorExtensions/Editor/Scripts/Panels/SDKPackage/AppCenterSDKPackage.cs:147) AppCenterEditor.AppCenterEditorSDKTools:DisplayPackagePanel(AppCenterSDKPackage) (at Assets/AppCenterEditorExtensions/Editor/Scripts/Panels/AppCenterEditorSDKTools.cs:95) AppCenterEditor.AppCenterEditor:OnGuiInternal() (at Assets/AppCenterEditorExtensions/Editor/AppCenterEditor.cs:146) AppCenterEditor.AppCenterEditor:HideRepaintErrors(Action) (at Assets/AppCenterEditorExtensions/Editor/AppCenterEditor.cs:117) AppCenterEditor.AppCenterEditor:OnGUI() (at Assets/AppCenterEditorExtensions/Editor/AppCenterEditor.cs:110) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Error log:

[App Center EdEx MSG63] App Center Editor Extensions: An unknown error occured and the Push SDK could not be removed. UnityEngine.Debug:LogError(Object) AppCenterEditor.LocalLogger:LogError(String) (at Assets/AppCenterEditorExtensions/Editor/Scripts/Utils/LocalLogger.cs:20) AppCenterEditor.AppCenterEditor:StateUpdateHandler(EdExStates, String, String) (at Assets/AppCenterEditorExtensions/Editor/AppCenterEditor.cs:275) AppCenterEditor.AppCenterEditor:RaiseStateUpdate(EdExStates, String, String) (at Assets/AppCenterEditorExtensions/Editor/AppCenterEditor.cs:219) AppCenterEditor.AppCenterSDKPackage:RemovePackage(Boolean) (at Assets/AppCenterEditorExtensions/Editor/Scripts/Panels/SDKPackage/AppCenterSDKPackage.cs:109) AppCenterEditor.AppCenterSDKPackage:ShowPackageInstalledMenu() (at Assets/AppCenterEditorExtensions/Editor/Scripts/Panels/SDKPackage/AppCenterSDKPackage.cs:147) AppCenterEditor.AppCenterEditorSDKTools:DisplayPackagePanel(AppCenterSDKPackage) (at Assets/AppCenterEditorExtensions/Editor/Scripts/Panels/AppCenterEditorSDKTools.cs:95) AppCenterEditor.AppCenterEditor:OnGuiInternal() (at Assets/AppCenterEditorExtensions/Editor/AppCenterEditor.cs:146) AppCenterEditor.AppCenterEditor:HideRepaintErrors(Action) (at Assets/AppCenterEditorExtensions/Editor/AppCenterEditor.cs:117) AppCenterEditor.AppCenterEditor:OnGUI() (at Assets/AppCenterEditorExtensions/Editor/AppCenterEditor.cs:110) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

5.Reopen unity and Push SDK seems removed?

Situation 3: 1.Unity 2018.4.3f1 (64-bit) create new project. 2.Import Custom package AppCenterEditorExtensions-v1.1.2.unitypackage 3.Try Analytic SDK click Install SDK, Installing Endless not finish.

Intalling log:

[App Center EdEx MSG804] Downloading files: https://mobilecentersdkdev.blob.core.windows.net/sdk/AppCenterAnalyticsLatest.unitypackage UnityEngine.Debug:Log(Object) AppCenterEditor.LocalLogger:LogWithTimeStamp(String) (at Assets/AppCenterEditorExtensions/Editor/Scripts/Utils/LocalLogger.cs:10) AppCenterEditor.AppCenterEditorHttp:MakeDownloadCall(IEnumerable1, Action1) (at Assets/AppCenterEditorExtensions/Editor/Scripts/AppCenterEditorSDK/AppCenterEditorHttp.cs:26) AppCenterEditor.PackagesInstaller:ImportLatestSDK(IEnumerable`1, String, String) (at Assets/AppCenterEditorExtensions/Editor/Scripts/AppCenterEditorSDK/PackagesInstaller.cs:17) AppCenterEditor.AppCenterSDKPackage:ImportLatestPackageSDK() (at Assets/AppCenterEditorExtensions/Editor/Scripts/Panels/SDKPackage/AppCenterSDKPackage.cs:220) AppCenterEditor.AppCenterSDKPackage:ShowPackageNotInstalledMenu() (at Assets/AppCenterEditorExtensions/Editor/Scripts/Panels/SDKPackage/AppCenterSDKPackage.cs:182) AppCenterEditor.AppCenterEditorSDKTools:DisplayPackagePanel(AppCenterSDKPackage) (at Assets/AppCenterEditorExtensions/Editor/Scripts/Panels/AppCenterEditorSDKTools.cs:99) AppCenterEditor.AppCenterEditor:OnGuiInternal() (at Assets/AppCenterEditorExtensions/Editor/AppCenterEditor.cs:146) AppCenterEditor.AppCenterEditor:HideRepaintErrors(Action) (at Assets/AppCenterEditorExtensions/Editor/AppCenterEditor.cs:117) AppCenterEditor.AppCenterEditor:OnGUI() (at Assets/AppCenterEditorExtensions/Editor/AppCenterEditor.cs:110) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

[App Center EdEx MSG842] Saving 15481407 bytes to: D:/Unity/Practice/AppCenter-SDK-Unity-2018.4.3/Assets/AppCenterEditorExtensions/Editor/Resources/MostRecentPackage.unitypackage UnityEngine.Debug:Log(Object) AppCenterEditor.LocalLogger:LogWithTimeStamp(String) (at Assets/AppCenterEditorExtensions/Editor/Scripts/Utils/LocalLogger.cs:10) AppCenterEditor.AppCenterEditorHttp:WriteResultFile(String, Byte[]) (at Assets/AppCenterEditorExtensions/Editor/Scripts/AppCenterEditorSDK/AppCenterEditorHttp.cs:143) AppCenterEditor.d__5:MoveNext() (at Assets/AppCenterEditorExtensions/Editor/Scripts/AppCenterEditorSDK/AppCenterEditorHttp.cs:79) AppCenterEditor.EditorCoroutine:Update() (at Assets/AppCenterEditorExtensions/Editor/Scripts/Utils/EditorCoroutine.cs:68) UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

[App Center EdEx MSG852] Importing package: D:/Unity/Practice/AppCenter-SDK-Unity-2018.4.3/Assets/AppCenterEditorExtensions/Editor/Resources/MostRecentPackage.unitypackage UnityEngine.Debug:Log(Object) AppCenterEditor.LocalLogger:LogWithTimeStamp(String) (at Assets/AppCenterEditorExtensions/Editor/Scripts/Utils/LocalLogger.cs:10) AppCenterEditor.<>c__DisplayClass0_0:b0(IEnumerable`1) (at Assets/AppCenterEditorExtensions/Editor/Scripts/AppCenterEditorSDK/PackagesInstaller.cs:23) AppCenterEditor.d5:MoveNext() (at Assets/AppCenterEditorExtensions/Editor/Scripts/AppCenterEditorSDK/AppCenterEditorHttp.cs:88) AppCenterEditor.EditorCoroutine:Update() (at Assets/AppCenterEditorExtensions/Editor/Scripts/Utils/EditorCoroutine.cs:68) UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

Reload Assembly called from managed code directly. This will cause a crash. You should never refresh assets in synchronous mode or enter playmode synchronously from script code. UnityEditor.AssetDatabase:ImportPackage(String, Boolean) AppCenterEditor.<>c__DisplayClass0_0:b0(IEnumerable`1) (at Assets/AppCenterEditorExtensions/Editor/Scripts/AppCenterEditorSDK/PackagesInstaller.cs:24) AppCenterEditor.d5:MoveNext() (at Assets/AppCenterEditorExtensions/Editor/Scripts/AppCenterEditorSDK/AppCenterEditorHttp.cs:88) AppCenterEditor.EditorCoroutine:Update() (at Assets/AppCenterEditorExtensions/Editor/Scripts/Utils/EditorCoroutine.cs:68) UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

[App Center EdEx MSG624] Deleting file: D:/Unity/Practice/AppCenter-SDK-Unity-2018.4.3/Assets/AppCenterEditorExtensions/Editor/Resources/MostRecentPackage.unitypackage UnityEngine.Debug:Log(Object) AppCenterEditor.LocalLogger:LogWithTimeStamp(String) (at Assets/AppCenterEditorExtensions/Editor/Scripts/Utils/LocalLogger.cs:10) AppCenterEditor.<>c__DisplayClass0_0:b0(IEnumerable`1) (at Assets/AppCenterEditorExtensions/Editor/Scripts/AppCenterEditorSDK/PackagesInstaller.cs:25) AppCenterEditor.d5:MoveNext() (at Assets/AppCenterEditorExtensions/Editor/Scripts/AppCenterEditorSDK/AppCenterEditorHttp.cs:88) AppCenterEditor.EditorCoroutine:Update() (at Assets/AppCenterEditorExtensions/Editor/Scripts/Utils/EditorCoroutine.cs:68) UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

[App Center EdEx MSG627] App Center SDK install complete UnityEngine.Debug:Log(Object) AppCenterEditor.LocalLogger:LogWithTimeStamp(String) (at Assets/AppCenterEditorExtensions/Editor/Scripts/Utils/LocalLogger.cs:10) AppCenterEditor.<>c__DisplayClass0_0:b0(IEnumerable`1) (at Assets/AppCenterEditorExtensions/Editor/Scripts/AppCenterEditorSDK/PackagesInstaller.cs:30) AppCenterEditor.d5:MoveNext() (at Assets/AppCenterEditorExtensions/Editor/Scripts/AppCenterEditorSDK/AppCenterEditorHttp.cs:88) AppCenterEditor.EditorCoroutine:Update() (at Assets/AppCenterEditorExtensions/Editor/Scripts/Utils/EditorCoroutine.cs:68) UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

5.Reopen unity and Analytic SDK seems Installed. 6.Try Analytic SDK click Remove SDK, and it remove success no issue.

P.S. Some times show App Center Editor Extensions: 403 Forbidden

Then see some errors: [App Center EdEx MSG818] App Center Editor Extensions: 403 Forbidden [App Center EdEx MSG832] App Center Editor Extensions: 403 Forbidden [App Center EdEx MSG87] App Center Editor Extensions: 403 Forbidden [App Center EdEx MSG89] App Center Editor Extensions: 403 Forbidden

UnityEngine.Debug:LogError(Object) AppCenterEditor.LocalLogger:LogError(String) (at Assets/AppCenterEditorExtensions/Editor/Scripts/Utils/LocalLogger.cs:20) AppCenterEditor.AppCenterEditor:StateUpdateHandler(EdExStates, String, String) (at Assets/AppCenterEditorExtensions/Editor/AppCenterEditor.cs:275) AppCenterEditor.AppCenterEditor:RaiseStateUpdate(EdExStates, String, String) (at Assets/AppCenterEditorExtensions/Editor/AppCenterEditor.cs:219) AppCenterEditor.AppCenterEditorHelper:SharedErrorCallback(String) (at Assets/AppCenterEditorExtensions/Editor/Scripts/Utils/AppCenterEditorHelper.cs:40) AppCenterEditor.d__3:MoveNext() (at Assets/AppCenterEditorExtensions/Editor/Scripts/AppCenterEditorSDK/AppCenterEditorHttp.cs:50) AppCenterEditor.EditorCoroutine:Update() (at Assets/AppCenterEditorExtensions/Editor/Scripts/Utils/EditorCoroutine.cs:68) UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

annakocheshkova commented 5 years ago

Hey @SyaoranChang I repeated your steps but seems to be working for me, what is the OS you are on - mac or windows? Do you have some unusual permissions set for the folders maybe?

SyaoranChang commented 5 years ago

Hi,

1.My OS is windows 10, version 1809 (OS Build 17763.557) 2. (1)I have not set any permissions for those folders. (2)Today I set my AntiVirus (NOD32) to ignore those folders, seems the errors about "App Center Editor Extensions: 403 Forbidden" is gone, but Remove SDK and Installing Endless issues still there.

annakocheshkova commented 5 years ago

@SyaoranChang

SyaoranChang commented 5 years ago

Hi,

About the 3rd issue, it occur also every time. 1.Try Analytic SDK click Install SDK, Installing Endless not finish. Reopen unity and Analytic SDK seems Installed.

2.Try Crashes SDK click Install SDK, Installing Endless not finish. Reopen unity and Crashes SDK seems Installed.

3.Try Distribute SDK click Install SDK, Installing Endless not finish. Reopen unity and Distribute SDK seems Installed.

4.Try Push SDK click Install SDK, Installing Endless not finish. Reopen unity and Push SDK seems Installed.

Thank you for your help.

annakocheshkova commented 5 years ago

@SyaoranChang go to Window > Package Manager > Package Manager UI. What is the version? Could you update it?

SyaoranChang commented 5 years ago

Package Manager UI Version is 2.0.7 It seems to be the latest version on Unity 2018.4.3f1 (64-bit).

annakocheshkova commented 5 years ago

@SyaoranChang as far as I can tell, this "Reload Assembly called from managed code directly" is a Unity Editor issue (has a bug opened), not an SDK issue, although I still can't reproduce it. Maybe it is reproduced only on some specific Unity Editor version I just can't spot. Could you try the same on a higher or lower version of Unity and tell me if it helps?

SyaoranChang commented 5 years ago

Hi,

I tried several versions unity with AppCenter-SDK-Unity-Extension 1.1.2.

Unity 2018.3.8f1 (64-bit) Package Manager UI Version is 2.0.3 => Try Install SDK or Remove SDK no issue. Unity 2018.3.14f1 (64-bit) Package Manager UI Version is 2.0.7 => Try Install SDK or Remove SDK no issue. Unity 2018.4.1f1 (64-bit) Package Manager UI Version is 2.0.7 => Try Install SDK or Remove SDK no issue. Unity 2018.4.2f1 (64-bit) Package Manager UI Version is 2.0.7 => Try Install SDK or Remove SDK no issue.

Unity 2018.4.3f1 (64-bit) Package Manager UI Version is 2.0.7 => Try Analytic SDK click Install SDK, Installing Endless not finish.

It seems that something is broken start at version Unity 2018.4.3, and not issue by Package Manager UI.

Unity 2018.4.4f1 (64-bit) Package Manager UI Version is 2.0.7 => Try Analytic SDK click Install SDK, Installing Endless not finish. Unity 2019.1.10f1 (64-bit) Package Manager UI Version is 2.0.7 => Try Analytic SDK click Install SDK, Installing Endless not finish.

It seems that new versions unity is still broken.

annakocheshkova commented 5 years ago

@SyaoranChang Thank you I think I finally manage to spot it. I will create a bug.

annakocheshkova commented 5 years ago

Hey @SyaoranChang so I investigated this error and here's what it is: Basically reload assembly is called by the Unity itself when it imports the new packages. And it's not working, which is a bug. Several other resources say you can safely ignore it since the packages are still imported, but because it doesn't reload the assembly from the code, our Extension still thinks that the package is not installed and you'll have to do the reload manually, e. g. right-click the imported package folder > Reimport. I guess we could put a workaround which makes our extension reset the stale installation and by default think that the package is installed but that's not a solution since the issue is in Unity code itself and since it's not very reliable in case of a real error. We could also make a use of Unity callbacks and import the packages interactively for the user, one by one, but that's not possible becasue of another Unity bug.

So until any of these bugs are fixed in Unity, the solution is to manually click Reimport.