Avalonia UI是一个.Net Core跨平台UI框架,支持多种操作系统:Windows、Linux、MacOS等。

一、跑个Hello World
1、安装Avalonia扩展
VS安装此扩展

https://marketplace.visualstudio.com/items?itemName=AvaloniaTeam.AvaloniaforVisualStudio

安装完后打开VS,创建一个Avalonia项目

QQ截图20201203222458.png

创建完项目后生成一下即可在VS中实时预览

QQ截图20201203222732.png

二、跑在Linux上试试

既然Avalonia支持跨平台,那在Windows上运行没问题后,把文件打包一下,发到Linux上试试能不能跑起来,我这里用得统信UOS

右击项目选择发布,设置一下发布文件

QQ截图20201203223550.png

将发布文件复制到UOS中,双击HelloAvalonia文件添加权限即可直接打开,也可以终端中输入命令./HelloAvalonia打开
(UOS需要打开开发者权限)

QQ截图20201203224101.png

1、修改 $HOME/.zshrc文件

vim $HOME/.zshrc

2、添加以下内容

# Flutter路径
export PATH="$PATH:[Flutter路径]/flutter/bin"
# 国内镜像
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
# 代理
export HTTP_PROXY=http://127.0.0.1:1080
export HTTPS_PROXY=http://127.0.0.1:1080

3、刷新

source $HOME/.zshrc

4、检查Flutter信息

flutter doctor

今天重装完Android Studio,启动模拟器时出现了以下问题

Emulator: dsound: Could not initialize DirectSoundCapture 15:37 Emulator: dsound: Reason: No sound driver is available for use, or the given GUID is not a valid DirectSound device ID 15:37 Emulator: dsound: Attempt to initialize voice without DirectSoundCapture object 15:37 Emulator: dsound: Attempt to initialize voice without DirectSoundCapture object 15:37 Emulator: audio: Failed to create voice goldfish_audio_in‘ 15:37 Emulator: D:\buildSoft\android-studio\sdk\emulator\qemu\windows-x86_64\qemu-system-i386.exe: warning: opening audio input failed 15:37 Emulator: dsound: Attempt to initialize voice without DirectSoundCapture object 15:37 Emulator: dsound: Attempt to initialize voice without DirectSoundCapture object 15:37 Emulator: audio: Failed to create voice adc’

找了好久终于找到了解决方法:

https://jingyan.baidu.com/article/a65957f434890a24e67f9bfc.html

1、打开系统声音设置,打开声音控制面板

QQ截图20190322172307-768x435.png

2、将录制里的立体声混音打开

QQ图片20190322172353-238x300.png

3、重启模拟器,OK