3

I have an application using Flutter desktop. It perfectly works when running flutter run -d linux or flutter build Linux. I can snap it setting up the source in the snapcraft.yaml to a GitHub repo, but as soon as I try to snap it from a local source it gives me the following error:

[ +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.

This is my snapcraft.yaml file:

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

and I have also run flutter create .. to try to recreate the Linux folder.

Do you have any suggestion in what can I do?

Fede Reyes
  • 31
  • 1

0 Answers0