当我尝试上传我的 apk 时,VS2017 显示此错误:
This API has been deprecated and is no longer available
知道是什么原因以及如何解决此错误吗?
Xamarin 4.12.3
我正在尝试使用 GoogleFonts 来测试我的用户界面,但我收到了这个奇怪的错误error: google_fonts was unable to load font。
任何单个字体都会发生这种情况。
这是我的设置 VsCode Flutter 1.12.13+hf9 Windows 10
pubspec.yaml
dependencies:
flutter:
sdk: flutter
google_fonts: ^0.4.0
Run Code Online (Sandbox Code Playgroud)
Code
import 'package:google_fonts/google_fonts.dart';
Text('data2', style: GoogleFonts.mcLaren())
Run Code Online (Sandbox Code Playgroud)
Error
I/flutter (5069):错误:google_fonts 无法加载字体 McLaren-Regular,因为发生以下异常 I/flutter (5069):异常:无法加载带有 url 的字体:https : //fonts.gstatic.com/s /a/ca48a5e17b0201057453d49c4271d139e5824b553505ad1c6fbbd7cbbbf4d1dc.ttf
[?] Flutter (Channel stable, v1.12.13+hotfix.9, on Microsoft Windows, locale pt-BR)
[?] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[!] Android Studio (not installed)
[?] VS Code, 64-bit edition (version 1.44.0)
[?] Connected …Run Code Online (Sandbox Code Playgroud) 我正在尝试HelloWorld使用简单的注射和棱镜进行简单的尝试。
git 源代码
当应用程序启动时,出现此错误
无法分配给属性“Prism.Windows.Mvvm.ViewModelLocator.AutoWireViewModel”。[线路:8 位置:5]”
抛出异常:Prism.Windows.dll 中的“System.MissingMethodException”抛出异常:HelloWorldPrism.exe 中的“Windows.UI.Xaml.Markup.XamlParseException”WinRT 信息:无法分配给属性“Prism.Windows.Mvvm.ViewModelLocator.AutoWireViewModel” '。[行:8 位置:5] HelloWorldPrism.exe 中发生“Windows.UI.Xaml.Markup.XamlParseException”类型的异常,但未在用户代码中处理 WinRT 信息:无法分配给属性“Prism.Windows.Mvvm”。 ViewModelLocator.AutoWireViewModel'。[行:8 位置:5] 附加信息:无法找到与此错误代码关联的文本。无法分配给属性“Prism.Windows.Mvvm.ViewModelLocator.AutoWireViewModel”。[线路:8 位置:5]
e.StackTrace " 在 Windows.UI.Xaml.Application.LoadComponent(Object 组件、Uri resourceLocator、ComponentResourceLocation componentResourceLocation)\r\n 在 HelloWorldPrism.Views.MainView.InitializeComponent()\r\n 在 HelloWorldPrism.Views.MainView.. ctor()”字符串
<Page
x:Class="HelloWorldPrism.Views.MainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mvvm="using:Prism.Windows.Mvvm"
mvvm:ViewModelLocator.AutoWireViewModel="True"
mc:Ignorable="d"
>
Run Code Online (Sandbox Code Playgroud)
public MainViewModel(INavigationService navigationService)
{
_navigationService = navigationService;
}
Run Code Online (Sandbox Code Playgroud)
如果我添加一个无参数构造函数,它就可以正常工作。
public MainViewModel()
{
}
Run Code Online (Sandbox Code Playgroud)
应用程序.cs
protected override Task OnLaunchApplicationAsync(LaunchActivatedEventArgs args)
{
Window.Current.Activate();
return Task.FromResult(true);
}
protected override void CreateAndConfigureContainer()
{
Logger.Log("Creating and Configuring Container", Category.Debug, Priority.Low);
Container …Run Code Online (Sandbox Code Playgroud)