[英]Xamarin Android axml Designer, System.ArgumentNullException: Value cannot be null
Note: This occurs with the most recent version of Visual Studio Mac and the latest Xamarin tools installed. 注意:这是在安装了最新版本的Visual Studio Mac和最新的Xamarin工具时发生的。
I started to work on an older Xamarin Android project that I've been maintaining over the past few years. 我开始从事过去几年来一直在维护的旧Xamarin Android项目。 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.
自从我对应用程序进行了任何UI更改以来,已经很长时间了,为了向屏幕添加一些其他信息,我需要进行一些小的调整。 I opened up the axml layout of screen I needed to modify.
我打开了需要修改的屏幕的axml布局。 When doing so, the designer view displayed the following error:
这样做时,设计器视图显示以下错误:
System.ArgumentNullException: Value cannot be null.
System.ArgumentNullException:值不能为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
参数名称:/ Users / builder / data / lanes / 4992 / mono-mac-sdk / external中的System.IO.Path.Combine上的path1(System.String path1,System.String path2,System.String path3)[0x0002a] /bockbuild/builds/mono-x64/mcs/class/corlib/System.IO/Path.cs:849在Xamarin.AndroidDesigner.DesignerProject + <> c.b__118_0(System.String l)[0x00000]在/ Users / vsts / agent / 2.126.0 / work / 1 / s / Xamarin.Designer.Android / Xamarin.AndroidDesigner / Xamarin.AndroidDesigner / DesignerProject.cs:532,位于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]在/ Users / builder / data / lanes / 4992 / mono-mac-sdk / external / bockbuild / builds / mono-x64 / external / corefx / src / System.Linq / src / System / Linq / Where.cs:146,位于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
2[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.2[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
在/ Users / builder / data / lanes / 4992 / mono-mac-sdk中的2[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]源)中的2[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
[0x00015] /external/bockbuild/builds/mono-x64/external/corefx/src/System.Linq/src/System/Linq/ToCollection.cs:30在/ Users / vsts中的Xamarin.AndroidDesigner.DesignerProject.GetLibraryProjectThemes()[0x00037] /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在Xamarin.AndroidDesigner.DesignerSessionParams.GetData(Xamarin.AndroidDesigner.AndroidDesignerSession会话,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在/Users/vsts/agent/2.126.0/work/1/s/Xamarin.Designer.Android/Xamarin.AndroidDesigner/Xamarin.AndroidDesigner/DesignerSessionParams.cs:209上的[0x00154] /Users/vsts/agent/2.126.0/work/1/s/Xamarin.Designer.Android/Xamarin.AndroidDesigner/Xamarin.AndroidDesigner/AndroidRenderSession.cs:783中的d__115.MoveNext()[0x00224]
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. 最初,我认为较新的Xamarin工具必须存在某种语法问题,但是当我尝试创建全新的Android Layout时,设计师遇到了同样的错误。 The Xamarin Android new layout looks like this:
Xamarin Android的新布局如下所示:
<?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?
也许与在某处分配了错误的Designer工具路径有关? Has anyone come across this error or have some ideas on what to check?
是否有人遇到此错误或对要检查的内容有任何想法?
Edit: Additional Info Android SDK Location: 编辑:附加信息Android SDK位置:
/Users/mrnope/Library/Developer/Xamarin/android-sdk-macosx
/用户/ mrnope /库/开发人员/ Xamarin / android-sdk-macosx
Android NDK Location: Android NDK位置:
/Users/mrnope/Library/Developer/Xamarin/android-ndk/android-ndk-r14b
/用户/ mrnope /库/开发人员/ Xamarin / android-ndk / android-ndk-r14b
Java SDK (JDK) Location: Java SDK(JDK)位置:
/usr
/ usr
It's most likely that Visual Studio cannot find the proper Android SDK path and/or the Platform Tools. Visual Studio很可能找不到正确的Android SDK路径和/或平台工具。
Tools -> Option -> Android Settings
工具->选项-> Android设置
And insert the proper path there, then I would double-check that the Platform Tools are installed correctly and are on the same version of the SDK. 然后在其中插入正确的路径,然后我将再次检查平台工具是否已正确安装并且在相同版本的SDK上。
Tools -> Android -> Android SDK Manager
工具-> Android-> Android SDK Manager
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.