[Archlinux] 编译失败
Closed this issue · 1 comments
dongfengweixiao commented
尝试编译 biyi,但是编译失败。
最开始尝试编译 release 版本,但是 release 页下载的源码包中仅包含 3 个 markdown 文件。
尝试从 main 分支的最新提交编译,但是编译过程存在错误。
makepkg 如下:
pkgname=biyi-git
pkgver=r116.152bc7b
pkgrel=1
epoch=1
pkgdesc="A convenient translation and dictionary app written in Flutter."
arch=('x86_64')
url="https://github.com/biyidev/biyi"
license=('AGPL-3.0')
depends=('gtk3' 'libappindicator-gtk3' 'libkeybinder3')
makedepends=('flutter')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=('git+https://github.com/biyidev/biyi.git'
'git+https://github.com/biyidev/uni_translate.git'
'git+https://github.com/biyidev/uni_ocr.git')
sha256sums=('SKIP'
'SKIP'
'SKIP')
pkgver() {
cd "$srcdir/biyi"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
build() {
cd "$srcdir/biyi"
flutter channel stable
flutter upgrade
flutter config --enable-linux-desktop
flutter build linux
}
package() {
}
编译日志如下:
Launching lib/main.dart on Linux in debug mode...
ERROR: lib/pages/desktop_popup/desktop_popup.dart:173:40: Error: 'screenRetriever' is imported from both 'package:biyi/utilities/utilities.dart' and 'package:screen_retriever/src/screen_retriever.dart'.
ERROR: Display primaryDisplay = await screenRetriever.getPrimaryDisplay();
ERROR: ^^^^^^^^^^^^^^^
ERROR: lib/pages/desktop_popup/desktop_popup.dart:264:29: Error: A value of type 'Rect?' can't be assigned to a variable of type 'Rect' because 'Rect?' is nullable and 'Rect' isn't.
ERROR: - 'Rect' is from 'dart:ui'.
ERROR: Rect trayIconBounds = await trayManager.getBounds();
ERROR: ^
ERROR: lib/widgets/record_shortcut_dialog/record_shortcut_dialog.dart:19:27: Error: The value 'null' can't be assigned to the parameter type 'KeyCode' because 'KeyCode' is not nullable.
ERROR: - 'KeyCode' is from 'package:hotkey_manager/src/enums/key_code.dart' ('../../../../.pub-cache/hosted/mirrors.tuna.tsinghua.edu.cn%2547dart-pub%2547/hotkey_manager-0.1.7/lib/src/enums/key_code.dart').
ERROR: HotKey _hotKey = HotKey(null);
ERROR: ^
ERROR: lib/widgets/record_shortcut_dialog/record_shortcut_dialog.dart:61:31: Error: The getter 'isSetted' isn't defined for the class 'HotKey'.
ERROR: - 'HotKey' is from 'package:hotkey_manager/src/hotkey.dart' ('../../../../.pub-cache/hosted/mirrors.tuna.tsinghua.edu.cn%2547dart-pub%2547/hotkey_manager-0.1.7/lib/src/hotkey.dart').
ERROR: Try correcting the name to the name of an existing getter, or defining a getter or field named 'isSetted'.
ERROR: onPressed: !_hotKey.isSetted
ERROR: ^^^^^^^^
ERROR: Target kernel_snapshot failed: Exception
Building Linux application...
Exception: Build process failed
lijy91 commented
请使用最新代码重新编译