Note: This occurs with the most recent version of Visual Studio Mac and the latest Xamarin tools installed.
I started to work on an older Xamarin Android project that I've been maintaining over the past few years. It's been a long time since I've made any UI changes to the application and there was a minor adjustment I needed to make in order to add some additional information to the screen. I opened up the axml layout of screen I needed to modify. When doing so, the designer view displayed the following error:
System.ArgumentNullException: Value cannot be null. Parameter name: path1 at System.IO.Path.Combine (System.String path1, System.String path2, System.String path3) [0x0002a] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.IO/Path.cs:849 at Xamarin.AndroidDesigner.DesignerProject+<>c.b__118_0 (System.String l) [0x00000] in /Users/vsts/agent/2.126.0/work/1/s/Xamarin.Designer.Android/Xamarin.AndroidDesigner/Xamarin.AndroidDesigner/DesignerProject.cs:532 at System.Linq.Enumerable+SelectListIterator
2[TSource,TResult].MoveNext () [0x00036] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/external/corefx/src/System.Linq/src/System/Linq/Select.cs:365 at System.Linq.Enumerable+WhereEnumerableIterator
1[TSource].MoveNext () [0x0004e] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/external/corefx/src/System.Linq/src/System/Linq/Where.cs:146 at System.Linq.Enumerable+SelectManySingleSelectorIterator2[TSource,TResult].ToList () [0x0002d] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/external/corefx/src/System.Linq/src/System/Linq/SelectMany.cs:257 at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable
1[T] source) [0x00015] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/external/corefx/src/System.Linq/src/System/Linq/ToCollection.cs:30 at Xamarin.AndroidDesigner.DesignerProject.GetLibraryProjectThemes () [0x00037] in /Users/vsts/agent/2.126.0/work/1/s/Xamarin.Designer.Android/Xamarin.AndroidDesigner/Xamarin.AndroidDesigner/DesignerProject.cs:531 at Xamarin.AndroidDesigner.DesignerProject.GetIsProjectTheme (System.String themeName) [0x0000e] in /Users/vsts/agent/2.126.0/work/1/s/Xamarin.Designer.Android/Xamarin.AndroidDesigner/Xamarin.AndroidDesigner/DesignerProject.cs:544 at Xamarin.AndroidDesigner.DesignerSessionParams.GetData (Xamarin.AndroidDesigner.AndroidDesignerSession session, Xamarin.AndroidDesigner.AndroidRenderSession renderer) [0x00154] in /Users/vsts/agent/2.126.0/work/1/s/Xamarin.Designer.Android/Xamarin.AndroidDesigner/Xamarin.AndroidDesigner/DesignerSessionParams.cs:209 at Xamarin.AndroidDesigner.AndroidRenderSession+d__115.MoveNext () [0x00224] in /Users/vsts/agent/2.126.0/work/1/s/Xamarin.Designer.Android/Xamarin.AndroidDesigner/Xamarin.AndroidDesigner/AndroidRenderSession.cs:783
I initially thought there must be some kind of Syntax issue with the newer Xamarin tools but when I tried creating a brand new Android Layout, I received the same error for the designer. The Xamarin Android new layout looks like this:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" />
Because of this, I'm thinking that there has to be some kind of setup option that I'm missing due to this being an older project. Perhaps something to do with the incorrect designer tool path being assigned somewhere? Has anyone come across this error or have some ideas on what to check?
Edit: Additional Info Android SDK Location:
/Users/mrnope/Library/Developer/Xamarin/android-sdk-macosx
Android NDK Location:
/Users/mrnope/Library/Developer/Xamarin/android-ndk/android-ndk-r14b
Java SDK (JDK) Location:
/usr