我对 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/