【问题标题】:Xamarin Forms Android NoSupportedException while UWP worksXamarin 在 UWP 工作时形成 Android NoSupportedException
【发布时间】:2017-08-28 18:03:45
【问题描述】:

我最近将我的解决方案更新为 Xamarin.Forms (2.3.4.267) 的最新 nuget 包。现在我在 Android Emulator (X86) 中运行程序时收到异常

Unhandled Exception:

System.PlatformNotSupportedException: Operation is not supported on this platform.

有了这段代码:

public virtual void AddRange(IEnumerable<T> collection)
{
    if (collection == null) throw new ArgumentNullException(nameof(collection));

    foreach (var i in collection) Items.Add(i);
    OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
}

尤其是一行

foreach (var i in collection) Items.Add(i);

这是一个测试问题的github链接 https://github.com/hugoterelle/posexclusive-droid-notsupported

【问题讨论】:

  • 我无法重现您的问题,能否请您发布更完整的代码来重现此问题?
  • @YorkShen-MSFT 抱歉耽搁了,我需要时间来清理解决方案以提供 github 存储库。您可以在编辑后的问题中找到它。

标签: c# android xamarin xamarin.forms


【解决方案1】:

这与我在使用 Xamarin Android 时遇到的 an issue 非常相似。此问题已在 release 15.3.2 of Xamarin 上修复。

尝试更新您的 Xamarin 版本并重试

【讨论】:

  • 我没有忘记,但你必须等待大约 20 小时才能获得赏金 :)
  • 天啊,这么多规则:)!
猜你喜欢
  • 2020-07-13
  • 2018-06-27
  • 2019-03-29
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-01-19
  • 2020-11-14
  • 2017-01-04
相关资源
最近更新 更多