Open larssteenhoff opened 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.
The problem is that I haven't added a Mac library for gitlib2. Maybe I should add a note :X
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
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
This may be a long shot, but can you rename it to libgit2-785d8c4. I tried that with the windows dlls and it works.
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)
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.
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.
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
Try and restart the editor see if you get the same error.
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.
and that's with the newest version available from the asset store ?
Yes Latest from the asset store: Unigit Asset v1.4.2 Unity 2017.4.3f1 OSX 10.13.4
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 ?
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.
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.
Oh and the provided mac image by the tutorial and others I tried are not valid archives I can't extract the rar file 😶
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
Will you look at Mac support again?
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)