title: Xamarin Forms - Solution errors between Windows & Mac
body: <p>I have a project and I use GitHub in order to save each new steps. However, since few days, I just got a Mac and I worked on this project from a Windows OS before.</p>
  
  <p>So, I installed Xamarin for Mac and cloned my git repo. But.. Mac doesn't want to compile the Android project part, I don't understand why but it throws <code>Error MSB4018: The "CheckDuplicateJavaLibraries" task failed unexpectedly.</code>. I created a new Forms Project from my Mac machine and, it does compile. So, I was like "Ok, let's create a new solution from windows (maybe the previous one is obsolete)", but the error come back...</p>
  
  <pre><code>/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+&lt;ExecuteInstantiatedTask&gt;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)
  </code></pre>
  
  <p>It seems like a Xamarin Forms android project from windows cannot be compiled on Mac. But the thing is, from Mac, you cannot manage the NuGet packages and it doesn't create the UWP side...</p>
  
  <p>I then tried to two following solutions:</p>
  
  <p><strong>Windows to iOS</strong> - Xamarin Forms PCL project created from Windows and compiled on Mac</p>
  
  <ul>
  <li>Cannot be compiled <em>(Error MSB4018)</em></li>
  <li>NuGet packages cannot be managed</li>
  </ul>
  
  <p><strong>iOS to Windows</strong> - Xamarin Forms PCL project created from Mac and compiled on Windows</p>
  
  <ul>
  <li>Can be compiled</li>
  <li>NuGet packages cannot be managed on the PCL part (only Android/iOS)</li>
  <li>The UWP side of the project doesn't exist</li>
  </ul>
  
  <p>I don't understand because I almost spent a day on it and I can't find anything on the internet... They just say that NuGet isn't available on Mac, so alright, why not, but it means that I need to create the solution from windows then? However, I can't manage the NuGet packages of the shared part (PCL).</p>
  
  <p>It's also weird because I can't believe that we can't work from Mac and Windows on the same solution, how does work teammates that share a project over git then?</p>
  
  <p>If you can explain to me what I didn't understand, then please reply.. I need to work often outside of my house and, I need to manage my nuget packages...</p>
  
  <p>Thank in advance !</p>