2

我有一个使用 Flutter 桌面的应用程序。它在运行 flutter run -d linux 或 flutter build Linux 时完美运行。我可以将 snapcraft.yaml 中的源代码设置为 GitHub 存储库,但是一旦我尝试从本地源中获取它,它就会给我以下错误:

[ +543 ms] CMake Error: The current CMakeCache.txt directory /root/parts/lizard/build/build/linux/release/CMakeCache.txt is different than the
directory /home/username/development/flutter_dev/lizard/build/linux/release where CMakeCache.txt was created. This may result in binaries being
created in the wrong place. If you are not sure, reedit the CMakeCache.txt
[   +2 ms] CMake Error: The source "/root/parts/lizard/build/linux/CMakeLists.txt" does not match the source
"/home/username/development/flutter_dev/lizard/linux/CMakeLists.txt" used to generate cache.  Re-run cmake with a different source directory.

这是我的 snapcraft.yaml 文件:

name: lizard-game
title: Lizard
base: core18 
version: '0.7'
summary: summary
description: description

grade: stable
confinement: strict

parts:
  lizard:
    plugin: flutter
    source: .
    source-type: local
    flutter-target: lib/main.dart
apps:
  lizard:
    command: lizard
    extensions: [flutter-dev]
icon: ./assets/icon/icon.png

我也跑去flutter create ..尝试重新创建 Linux 文件夹。

你对我能做什么有什么建议吗?

4

0 回答 0