Xamarin Android Java绑定:缺少类(XMLReader)
在Xamarin.Android项目中,使用Java绑定库时,我几乎总是会遇到一些警告。我收到以下警告:Xamarin Android Java绑定:缺少类(XMLReader),xamarin,xamarin.android,xamarin-binding,java-binding,Xamarin,Xamarin.android,Xamarin Binding,Java Binding,在Xamarin.Android项目中,使用Java绑定库时,我几乎总是会遇到一些警告。我收到以下警告: 7>BINDINGSGENERATOR : warning BG8800: Unknown parameter type System.Xml.XmlReader in method CreateFromXml in managed type Android.Content.Res.ColorStateList. 7>BINDINGSGENERATOR : warning BG
7>BINDINGSGENERATOR : warning BG8800: Unknown parameter type
System.Xml.XmlReader in method CreateFromXml in managed type Android.Content.Res.ColorStateList.
7>BINDINGSGENERATOR : warning BG8800: Unknown parameter type
System.Xml.XmlReader in method CreateFromXml in managed type Android.Content.Res.ColorStateList.
7>BINDINGSGENERATOR : warning BG8800: Unknown parameter type
System.Xml.XmlReader in method ParseBundleExtras in managed type Android.Content.Res.Resources.
7>BINDINGSGENERATOR : warning BG8800: Unknown parameter type
System.Xml.XmlReader in method CreateFromXml in managed type Android.Graphics.Drawables.Drawable.
7>BINDINGSGENERATOR : warning BG8800: Unknown parameter type
System.Xml.XmlReader in method CreateFromXml in managed type Android.Graphics.Drawables.Drawable.
7>BINDINGSGENERATOR : warning BG8800: Unknown parameter type
System.Xml.XmlReader in method CreateFromXmlInner in managed type Android.Graphics.Drawables.Drawable.
7>BINDINGSGENERATOR : warning BG8800: Unknown parameter type
System.Xml.XmlReader in method CreateFromXmlInner in managed type Android.Graphics.Drawables.Drawable.
7>BINDINGSGENERATOR : warning BG8800: Unknown parameter type
System.Xml.XmlReader in method Inflate in managed type Android.Graphics.Drawables.Drawable.
7>BINDINGSGENERATOR : warning BG8800: Unknown parameter type
System.Xml.XmlReader in method Inflate in managed type Android.Graphics.Drawables.Drawable.
7>BINDINGSGENERATOR : warning BG8800: Unknown parameter type
System.Xml.XmlReader in method ParseIntent in managed type Android.Content.Intent.
7>BINDINGSGENERATOR : warning BG8800: Unknown parameter type System.Xml.XmlReader in method ReadFromXml in managed type Android.Content.IntentFilter.
我的第一个想法是它缺少System.XML.XMLReader NuGet依赖项,但它没有意义。我添加了依赖项,但不起作用
后来,在查看代码(例如)时,我意识到在解析所需类时,它不知何故出错了。它不是System.XML.netframework类,而是来自Android框架的XMLReader类
有没有想过将绑定过程指向正确的方向,明确地告诉我们选择哪个类?一些metadata.xml规则?谢谢
编辑:我正在尝试:
<attr path="/api/package[@name='android.content.res']/class[@name='Resources']/method[@name='parseBundleExtras']/parameter[0]"
name="type">android.content.res.XmlResourceParser</attr>
,但解析器找不到任何东西,即使使用的查询粒度较小:
Metadata.xml(15, 4) warning BG8A04: <attr path="/api/package[@name='android.content.res']/class[@name='Resources']"/> matched no nodes. Seems that I can't make that metadata changes in Android framework directly?
Metadata.xml(15,4)警告BG8A04:没有匹配的节点。似乎我不能直接在Android框架中更改元数据?
以获取正确的组件
在解决方案资源管理器中,右键单击引用
选择添加引用…
选择装配选项卡
您只需要System.Xml
向下滚动并在“部件”选项卡中找到System.Xml
选择它
按确定按钮
从Visual Studio文件夹到程序集的最常见路径:
...\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Xml.dll
如果它显示具有相同名称的多个程序集,不用担心,您可以选择其中任何一个。不要使用GAC或nuget软件包。始终查找与项目类型相对应的程序集,该项目类型始终位于首选项管理器的“程序集”选项卡中
在修复后尝试构建之前,清理项目或执行清理构建您可以尝试添加@Billy对不起,但我不明白您想要实现的具体目标。也许改变道路?