simeonradivoev / UniGit

An open source GIT Unity3D editor plugin.
GNU General Public License v3.0
144 stars 16 forks source link

unity 2017 Mac errors asset store version 1.2.4 #17

Open larssteenhoff opened 6 years ago

larssteenhoff commented 6 years ago

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: An exception was thrown by the type initializer for LibGit2Sharp.Core.NativeMethods ---> System.DllNotFoundException: git2-785d8c4 at (wrapper managed-to-native) LibGit2Sharp.Core.NativeMethods:git_libgit2_init () at LibGit2Sharp.Core.NativeMethods+LibraryLifetimeObject..ctor () [0x00000] in <filename unknown>:0 at LibGit2Sharp.Core.NativeMethods..cctor () [0x00000] in <filename unknown>:0 --- End of inner exception stack trace --- at LibGit2Sharp.Core.Handles.SafeHandleBase..ctor () [0x00000] in <filename unknown>:0 at LibGit2Sharp.Core.Handles.NullRepositorySafeHandle..ctor () [0x00000] in <filename unknown>:0 at LibGit2Sharp.Core.Proxy.git_repository_open_ext (System.String path, RepositoryOpenFlags flags, System.String ceilingDirs) [0x00000] in <filename unknown>:0 at LibGit2Sharp.Repository.IsValid (System.String path) [0x00000] in <filename unknown>:0 at UniGit.GitManager.get_IsValidRepo () [0x00000] in <filename unknown>:0 at UniGit.GitManager.Initialize () [0x00000] in <filename unknown>:0 at UniGit.GitManager..ctor (System.String repoPath, UniGit.GitCallbacks callbacks, UniGit.GitSettingsJson settings, IGitPrefs prefs, UniGit.Utils.GitAsyncManager asyncManager) [0x00000] in <filename unknown>:0 at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (object,object[],System.Exception&) at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00119] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:513 --- End of inner exception stack trace --- at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0012c] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:519 at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:528 at System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) [0x0000e] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/ConstructorInfo.cs:77 at UniGit.Utils.InjectionHelper.CreateInstance (System.Type type) [0x00000] in <filename unknown>:0 at UniGit.Utils.InjectionHelper+Resolve.GetInstance () [0x00000] in <filename unknown>:0 at UniGit.Utils.InjectionHelper.GetInstance[GitManager] () [0x00000] in <filename unknown>:0 at UniGit.UniGitLoader..cctor () [0x00000] in <filename unknown>:0 UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes()

DllNotFoundException: git2-785d8c4 LibGit2Sharp.Core.NativeMethods+LibraryLifetimeObject..ctor () LibGit2Sharp.Core.NativeMethods..cctor () Rethrow as TypeInitializationException: An exception was thrown by the type initializer for LibGit2Sharp.Core.NativeMethods LibGit2Sharp.Core.Handles.SafeHandleBase..ctor () LibGit2Sharp.Core.Handles.NullRepositorySafeHandle..ctor () LibGit2Sharp.Core.Proxy.git_repository_open_ext (System.String path, RepositoryOpenFlags flags, System.String ceilingDirs) LibGit2Sharp.Repository.IsValid (System.String path) UniGit.GitManager.get_IsValidRepo () UniGit.GitManager.Initialize () UniGit.GitManager..ctor (System.String repoPath, UniGit.GitCallbacks callbacks, UniGit.GitSettingsJson settings, IGitPrefs prefs, UniGit.Utils.GitAsyncManager asyncManager) System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:513) Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:519) System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:528) System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/ConstructorInfo.cs:77) UniGit.Utils.InjectionHelper.CreateInstance (System.Type type) UniGit.Utils.InjectionHelper+Resolve.GetInstance () UniGit.Utils.InjectionHelper.GetInstance[GitManager] () UniGit.UniGitLoader..cctor () Rethrow as TypeInitializationException: An exception was thrown by the type initializer for UniGit.UniGitLoader System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (RuntimeTypeHandle type) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs:101) UnityEditor.EditorAssemblies.ProcessEditorInitializeOnLoad (System.Type type) (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorAssemblies.cs:136)

simeonradivoev commented 6 years ago

Unfortunately I don't have a Mac to test it out, but you can try and put these files into "Assets/Plugins/LibGit2Sharp/Editor/NativeBinaries/osx" and tell me if it works. If it doesn't I can't do much.

osx.zip

The problem is that I haven't added a Mac library for gitlib2. Maybe I should add a note :X

larssteenhoff commented 6 years ago

Now its looking for a specific version.

The version you included in the zip is libgit2-15e1193 and its looking for version libgit2-785d8c4

System.TypeInitializationException: An exception was thrown by the type initializer for LibGit2Sharp.Core.NativeMethods ---> System.DllNotFoundException: git2-785d8c4 at (wrapper managed-to-native) LibGit2Sharp.Core.NativeMethods:git_libgit2_init () at LibGit2Sharp.Core.NativeMethods+LibraryLifetimeObject..ctor () [0x00000] in :0 at LibGit2Sharp.Core.NativeMethods..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at LibGit2Sharp.Core.Handles.SafeHandleBase..ctor () [0x00000] in :0 at LibGit2Sharp.Core.Handles.NullRepositorySafeHandle..ctor () [0x00000] in :0 at LibGit2Sharp.Core.Proxy.git_repository_open_ext (System.String path, RepositoryOpenFlags flags, System.String ceilingDirs) [0x00000] in :0 at LibGit2Sharp.Repository.IsValid (System.String path) [0x00000] in :0 at UniGit.UniGitLoader..cctor () [0x002e6] in /Users/thunderbook/Desktop/UniGit-master 2/Assets/Plugins/UniGit/Editor/UniGitLoader.cs:68 UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes()

simeonradivoev commented 6 years ago

Crap. The Git2SharpLibrary I had modified to work with unity got lost, so I guess I will need to re-do it and replace all the DLLs

simeonradivoev commented 6 years ago

This may be a long shot, but can you rename it to libgit2-785d8c4. I tried that with the windows dlls and it works.

larssteenhoff commented 6 years ago

I tried renaming and I still get the error

DllNotFoundException: git2-785d8c4 LibGit2Sharp.Core.NativeMethods+LibraryLifetimeObject..ctor () LibGit2Sharp.Core.NativeMethods..cctor () Rethrow as TypeInitializationException: An exception was thrown by the type initializer for LibGit2Sharp.Core.NativeMethods LibGit2Sharp.Core.Handles.SafeHandleBase..ctor () LibGit2Sharp.Core.Handles.NullRepositorySafeHandle..ctor () LibGit2Sharp.Core.Proxy.git_repository_open_ext (System.String path, RepositoryOpenFlags flags, System.String ceilingDirs) LibGit2Sharp.Repository.IsValid (System.String path) UniGit.UniGitLoader..cctor () (at Assets/Plugins/UniGit/Editor/UniGitLoader.cs:68) Rethrow as TypeInitializationException: An exception was thrown by the type initializer for UniGit.UniGitLoader System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (RuntimeTypeHandle type) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs:101) UnityEditor.EditorAssemblies.ProcessEditorInitializeOnLoad (System.Type type) (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorAssemblies.cs:136)

larssteenhoff commented 6 years ago

Crap. The Git2SharpLibrary I had modified to work with unity got lost, so I guess I will need to re-do it and replace all the DLLs

Are you planning to redo it? Really love to have Mac supported.

simeonradivoev commented 6 years ago

Is the libgit2.bundle loaded ? I think that should be the mac version. It's really hard to test it without a Mac. But I will probably just switch to the new 4.6+ C# version and update the git2 library and the libgit2sharp to their latest version.

larssteenhoff commented 6 years ago

The libgit2.bundle seems to be loaded.
The error I get are those:

NullReferenceException: Object reference not set to an instance of an object UniGit.GitUnityMenu.InitilizeValidate () (at D:/My Documents/My Pictures/My Art/Games/UniGit/Assets/Plugins/UniGit/Editor/GitUnityMenu.cs:70)

and this one

NullReferenceException: Object reference not set to an instance of an object UniGit.Utils.GitAboutWindow.OnGUI () (at D:/My Documents/My Pictures/My Art/Games/UniGit/Assets/Plugins/UniGit/Editor/Utils/GitAboutWindow.cs:66) System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222) Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232) System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115) UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:295) UnityEditor.HostView.Invoke (System.String methodName) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:288) UnityEditor.HostView.OldOnGUI () (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:107) UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt) (at /Users/builduser/buildslave/unity/build/Runtime/UIElements/Managed/IMGUIContainer.cs:182) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

And one guide for osx on windows, just in case you want to try out osx without a Mac. :) https://youtu.be/oU0S9XFpBE8

simeonradivoev commented 6 years ago

Try and restart the editor see if you get the same error.

larssteenhoff commented 6 years ago

ok I just did, results:

first no errors, but when I go to the menu I get this one

NullReferenceException: Object reference not set to an instance of an object UniGit.GitUnityMenu.InitilizeValidate () (at D:/My Documents/My Pictures/My Art/Games/UniGit/Assets/Plugins/UniGit/Editor/GitUnityMenu.cs:70)

And initialise is greyed out.

screen shot 2018-05-21 at 22 32 31

simeonradivoev commented 6 years ago

and that's with the newest version available from the asset store ?

larssteenhoff commented 6 years ago

Yes Latest from the asset store: Unigit Asset v1.4.2 Unity 2017.4.3f1 OSX 10.13.4

simeonradivoev commented 6 years ago

The only reason the initialize button should be grayed out is if there is an existing git repository in that directory. Including parent or root directories. Can you use any of the windows for diffs and commit history ?

larssteenhoff commented 6 years ago

To test I just created a clean project with only the git asset on my desktop now and the same error.

I do have some git project else where on my computer but not on the desktop so it should not interfere.

simeonradivoev commented 6 years ago

Yea it shouldn't. Then the problem must be with the GitLib2Sharp. As the initialize button literally just checks a parameter provided by GitLib2Sharp. You should try and initialize a git repository from outside the editor with and external tool. Then open the editor and that project and see if UniGit works and you can see diffs and commits. Just make sure the git repository root folder is the project root folder not the assets folder.

simeonradivoev commented 6 years ago

Oh and the provided mac image by the tutorial and others I tried are not valid archives I can't extract the rar file 😶

larssteenhoff commented 6 years ago

maybe this one? for osx install

https://techsviewer.com/install-macos-high-sierra-virtualbox-windows/comment-page-31/#comments

I made a repository inside the unity test project from source tree.

Still this one error:

NullReferenceException: Object reference not set to an instance of an object UniGit.GitUnityMenu.InitilizeValidate () (at D:/My Documents/My Pictures/My Art/Games/UniGit/Assets/Plugins/UniGit/Editor/GitUnityMenu.cs:70)

And also grayed out

larssteenhoff commented 4 years ago

Will you look at Mac support again?