c# - 尝试打开 Webview 时崩溃 - Xamarin.Forms.Platform.Android.WebViewRender+WebClient

标签 c# android mono xamarin.forms

我对 Xamarin.Forms 有疑问

我试图在 NavigationModal 中打开网页,但它崩溃并显示此错误消息:

Could not load signature of Xamarin.Forms.Platform.Android.WebViewRender+WebClient:OnReceivedError due to: Could not resolve type with token 0100016d (from typeref, class/assembly Android.Webkit.WebResourceError, Mono.Android, Version=0.0.0.0, Culture=neutral, PublickKeyToken=84e04ffcfb79065 type:Android.Webkit.WebResourceError member:

我的代码是:

await Navigation.PushModalAsync(new ContactPage()
        {
            Content = new WebView()
            {
                Source = "http://google.com"
            }
        });
  • 使用 PCL
  • 目标 Android 版本:Android 6.0(API 级别 23)
  • 最低 Android 版本:Android 4.4(API 级别 19)
  • Xamarin.Forms v2.3.5.239-pre(和其他版本发生同样的问题)

  • 我正在使用搭载 Android 6.0 的三星 Galaxy S7 edge 进行测试

我不知道为什么会这样,因为它以前有效。

最佳答案

几个小时后,我发现目标版本指向 5.0 版。这在 Android Project > Options > Application > Compile using... 我设置为“Use latest platform (7.1)”

关于c# - 尝试打开 Webview 时崩溃 - Xamarin.Forms.Platform.Android.WebViewRender+WebClient,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44347911/

相关文章:

c# - 从 Controller 实例化 IRepository 类的正确方法是什么?

安卓3D动画

android - 如何登录 Fabrics 发送长消息

android - 尝试在空对象引用上调用虚拟方法 'void android.widget.ListView.setAdapter(android.widget.ListAdapter)'

c# - Cookie 过期未按预期工作

c# - Designview 中的 IsolatedStorage 异常

c# - 我怎样才能找出是什么在制造垃圾?

.net - 我可以使用 Moonlight 创建一个独立的(不在浏览器中运行,完全信任)应用程序吗?

c# - 为什么 MS access odbc 在 C# 中返回数字而不返回字符串?

c# - 应用程序设置界面