我有一个项目,我使用GitHub来保存每个新步骤。但是,几天之后,我刚买了一台Mac,之前我从Windows操作系统开始研究这个项目。
所以,我安装了Xamarin for Mac并克隆了我的git repo。但是.. Mac不想编译Android项目部分,我不明白为什么但它抛出Error MSB4018: The "CheckDuplicateJavaLibraries" task failed unexpectedly.
。我从我的Mac机器创建了一个新的Forms项目,它确实可以编译。所以,我就像“好吧,让我们从Windows创建一个新的解决方案(也许前一个已经过时了)”,但错误又回来了......
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(3,3): Error MSB4018: The "CheckDuplicateJavaLibraries" task failed unexpectedly.
System.IO.FileNotFoundException: Could not find file 'obj/Debug/__library_projects__/Xamarin.Android.Support.Animated.Vector.Drawable/library_project_imports/classes.jar'.
File name: 'obj/Debug/__library_projects__/Xamarin.Android.Support.Animated.Vector.Drawable/library_project_imports/classes.jar'
at System.IO.__Error.WinIOError (System.Int32 errorCode, System.String maybeFullPath) [0x00207] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/io/__error.cs:188
at System.IO.FileInfo.get_Length () [0x00038] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/io/fileinfo.cs:171
at (wrapper remoting-invoke-with-check) System.IO.FileInfo:get_Length ()
at Xamarin.Android.Tasks.MonoAndroidHelper+SizeAndContentFileComparer.GetHashCode (System.IO.FileInfo obj) [0x00001] in /Users/builder/data/lanes/4695/9dbc4c53/source/xamarin-android/src/Xamarin.Android.Build.Tasks/Utilities/MonoAndroidHelper.cs:101
at System.Linq.Set`1[TElement].InternalGetHashCode (TElement value) [0x00000] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/external/corefx/src/System.Linq/src/System/Linq/Set.cs:206
at System.Linq.Set`1[TElement].Add (TElement value) [0x00000] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/external/corefx/src/System.Linq/src/System/Linq/Set.cs:74
at System.Linq.Enumerable+DistinctIterator`1[TSource].MoveNext () [0x00083] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/external/corefx/src/System.Linq/src/System/Linq/Distinct.cs:72
at System.Linq.Enumerable+SelectEnumerableIterator`2[TSource,TResult].ToArray () [0x00030] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/external/corefx/src/System.Linq/src/System/Linq/Select.cs:155
at System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x00015] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/external/corefx/src/System.Linq/src/System/Linq/ToCollection.cs:19
at Xamarin.Android.Tasks.MonoAndroidHelper.DistinctFilesByContent (System.Collections.Generic.IEnumerable`1[T] filePaths) [0x00001] in /Users/builder/data/lanes/4695/9dbc4c53/source/xamarin-android/src/Xamarin.Android.Build.Tasks/Utilities/MonoAndroidHelper.cs:164
at Xamarin.Android.Tasks.CheckDuplicateJavaLibraries.Execute () [0x000fb] in /Users/builder/data/lanes/4695/9dbc4c53/source/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/CheckDuplicateJavaLibraries.cs:29
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00023] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/msbuild-15.0/src/Build/BackEnd/TaskExecutionHost/TaskExecutionHost.cs:632
at Microsoft.Build.BackEnd.TaskBuilder+<ExecuteInstantiatedTask>d__26.MoveNext () [0x00249] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/msbuild-15.0/src/Build/BackEnd/Components/RequestBuilder/TaskBuilder.cs:787 (MSB4018) (AppTESTwindows.Android)
似乎来自Windows的Xamarin Forms android项目无法在Mac上编译。但问题是,从Mac来看,你无法管理NuGet包,也没有创建UWP端......
然后我尝试了以下两个解决方案:
Windows到iOS - 从Windows创建并在Mac上编译的Xamarin Forms PCL项目
iOS到Windows - 从Mac创建并在Windows上编译的Xamarin Forms PCL项目
我不明白,因为我差不多花了一天时间在互联网上找不到任何东西......他们只是说在Mac上没有NuGet,所以没关系,为什么不呢,但这意味着我需要从Windows创建解决方案吗?但是,我无法管理共享部分(PCL)的NuGet包。
这也很奇怪,因为我无法相信我们无法在Mac和Windows上使用相同的解决方案,那么与git共享项目的团队成员如何呢?
如果你可以向我解释我不理解的内容,那么请回复..我需要经常在我家外工作,我需要管理我的nuget包......
提前感谢!