canonical / flutter-snap

GNU General Public License v3.0
18 stars 8 forks source link

Running snapcraft error #29

Closed kherldhussein closed 3 years ago

kherldhussein commented 3 years ago

'/root/parts/{app_name}/build/build/linux/release/bundle' is not a directory

`Launching a VM. The flutter plugin is currently in beta, its API may break. Use at your own risk. snapd is not logged in, snap install commands will use sudo snap "core18" has no updates available Skipping pull flutter-extension (already ran) Skipping pull gnome-3-28-extension (already ran) Skipping pull quran-hadith (already ran) Skipping build flutter-extension (already ran) Skipping build gnome-3-28-extension (already ran) Building quran-hadith

Run into this error the many times I've been runnung command ~:snapcraft on my project directory

kherldhussein commented 3 years ago

Running on Ubuntu 20.04 LTS

ferraridamiano commented 3 years ago

I have the same issue (ubuntu 20.04 LTS), flutter run -d linux works perfectly, but snapcraft fails with the following log:

snapcraft --use-lxd ``` Launching a container. Waiting for container to be ready Waiting for network to be ready... The flutter plugin is currently in beta, its API may break. Use at your own risk. snapd is not logged in, snap install commands will use sudo snap "core18" has no updates available Skipping pull bug (already ran) Skipping pull flutter-extension (already ran) Skipping pull gnome-3-28-extension (already ran) Building bug + snapcraftctl build flutter pub get Woah! You appear to be trying to run flutter as root. We strongly recommend running the flutter tool without superuser privileges. / πŸ“Ž Running "flutter pub get" in build... 1,382ms flutter build linux --release -v -t lib/main.dart Woah! You appear to be trying to run flutter as root. We strongly recommend running the flutter tool without superuser privileges. / πŸ“Ž [ +129 ms] executing: uname -m [ +67 ms] Exit code 0 from: uname -m [ ] x86_64 [ +30 ms] executing: [/root/snap/flutter/common/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H [ +16 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H [ ] 1c179c401f5756b06d1065f611d04c8f88db4fa3 [ +1 ms] executing: [/root/snap/flutter/common/flutter/] git tag --points-at 1c179c401f5756b06d1065f611d04c8f88db4fa3 [ +27 ms] Exit code 0 from: git tag --points-at 1c179c401f5756b06d1065f611d04c8f88db4fa3 [ +3 ms] executing: [/root/snap/flutter/common/flutter/] git describe --match *.*.* --long --tags 1c179c401f5756b06d1065f611d04c8f88db4fa3 [ +53 ms] Exit code 0 from: git describe --match *.*.* --long --tags 1c179c401f5756b06d1065f611d04c8f88db4fa3 [ +1 ms] 1.27.0-4.0.pre-139-g1c179c401f [ +80 ms] executing: [/root/snap/flutter/common/flutter/] git rev-parse --abbrev-ref --symbolic @{u} [ +15 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u} [ ] origin/master [ ] executing: [/root/snap/flutter/common/flutter/] git ls-remote --get-url origin [ +12 ms] Exit code 0 from: git ls-remote --get-url origin [ ] https://github.com/flutter/flutter.git [ +79 ms] Unable to locate an Android SDK. [ +9 ms] executing: [/root/snap/flutter/common/flutter/] git rev-parse --abbrev-ref HEAD [ +13 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD [ ] master [ +118 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update. [ +6 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update. [ +120 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update. [ ] Artifact Instance of 'GradleWrapper' is not required, skipping update. [ ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update. [ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update. [ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update. [ ] Artifact Instance of 'FlutterSdk' is not required, skipping update. [ ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update. [ +6 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update. [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update. [ ] Artifact Instance of 'PubDependencies' is not required, skipping update. [ +116 ms] Skipping pub get: version match. [ +276 ms] Generating /root/parts/bug/build/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegist rant.java [ +135 ms] Building without sound null safety [ ] For more information see https://dart.dev/null-safety/unsound-null-safety [ +18 ms] Building Linux application... [ +21 ms] executing: [build/linux/x64/release/] cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DFLUTTER_TARGET_PLATFORM=linux-x64 /root/parts/bug/build/linux [+5938 ms] -- The CXX compiler identification is Clang 6.0.0 [ +38 ms] -- Check for working CXX compiler: /snap/flutter/current/usr/bin/clang++ [ +345 ms] -- Check for working CXX compiler: /snap/flutter/current/usr/bin/clang++ -- works [ +6 ms] -- Detecting CXX compiler ABI info [ +266 ms] -- Detecting CXX compiler ABI info - done [ +11 ms] -- Detecting CXX compile features [+1108 ms] -- Detecting CXX compile features - done [ +96 ms] -- Found PkgConfig: /snap/flutter/current/usr/bin/pkg-config (found version "0.29.1") [ +1 ms] -- Checking for module 'gtk+-3.0' [ +126 ms] -- Found gtk+-3.0, version 3.22.30 [ +302 ms] -- Checking for module 'glib-2.0' [ +85 ms] -- Found glib-2.0, version 2.56.4 [ +233 ms] -- Checking for module 'gio-2.0' [ +79 ms] -- Found gio-2.0, version 2.56.4 [ +224 ms] -- Checking for module 'blkid' [ +82 ms] -- Found blkid, version 2.31.1 [ +231 ms] -- Checking for module 'liblzma' [ +81 ms] -- Found liblzma, version 5.2.2 [ +250 ms] -- Configuring done [ +115 ms] -- Generating done [ +3 ms] -- Build files have been written to: /root/parts/bug/build/build/linux/x64/release [ +132 ms] executing: ninja -C build/linux/x64/release install [ +25 ms] ninja: Entering directory `build/linux/x64/release' [+46167 ms] [1/6] Generating /root/parts/bug/build/linux/flutter/ephemeral/libflutter_linux_gtk.so, /root/parts/bug/build/linux/flutter/ephemeral/flutter_linux/fl_basic_message_channel.h, /root/parts/bug/build/linux/flutter/ephemeral/flutter_linux/fl_binary_codec.h, /root/parts/bug/build/linux/flutter/ephemeral/flutter_linux/fl_binary_messenger.h, /root/parts/bug/build/linux/flutter/ephemeral/flutter_linux/fl_dart_project.h, /root/parts/bug/build/linux/flutter/ephemeral/flutter_linux/fl_engine.h, /root/parts/bug/build/linux/flutter/ephemeral/flutter_linux/fl_json_message_codec.h, /root/parts/bug/build/linux/flutter/ephemeral/flutter_linux/fl_json_method_codec.h, /root/parts/bug/build/linux/flutter/ephemeral/flutter_linux/fl_message_codec.h, /root/parts/bug/build/linux/flutter/ephemeral/flutter_linux/fl_method_call.h, /root/parts/bug/build/linux/flutter/ephemeral/flutter_linux/fl_method_channel.h, /root/parts/bug/build/linux/flutter/ephemeral/flutter_linux/fl_method_codec.h, /root/parts/bug/build/linux/flutter/ephemeral/flutter_linux/fl_method_response.h, /root/parts/bug/build/linux/flutter/ephemeral/flutter_linux/fl_plugin_registrar.h, /root/parts/bug/build/linux/flutter/ephemeral/flutter_linux/fl_plugin_registry.h, /root/parts/bug/build/linux/flutter/ephemeral/flutter_linux/fl_standard_message_codec.h, /root/parts/bug/build/linux/flutter/ephemeral/flutter_linux/fl_standard_method_codec.h, /root/parts/bug/build/linux/flutter/ephemeral/flutter_linux/fl_string_codec.h, /root/parts/bug/build/linux/flutter/ephemeral/flutter_linux/fl_value.h, /root/parts/bug/build/linux/flutter/ephemeral/flutter_linux/fl_view.h, /root/parts/bug/build/linux/flutter/ephemeral/flutter_linux/flutter_linux.h, _phony_ [ +5 ms] Woah! You appear to be trying to run flutter as root. [ ] We strongly recommend running the flutter tool without superuser privileges. [ ] / [ +9 ms] πŸ“Ž [ +3 ms] [ +135 ms] executing: uname -m [ ] [ +66 ms] Exit code 0 from: uname -m [ ] [ ] x86_64 [ ] [ +26 ms] executing: [/root/snap/flutter/common/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H [ ] [ +14 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H [ +23 ms] [ ] 1c179c401f5756b06d1065f611d04c8f88db4fa3 [ ] [ +1 ms] executing: [/root/snap/flutter/common/flutter/] git tag --points-at 1c179c401f5756b06d1065f611d04c8f88db4fa3 [ ] [ +27 ms] Exit code 0 from: git tag --points-at 1c179c401f5756b06d1065f611d04c8f88db4fa3 [ ] [ +5 ms] executing: [/root/snap/flutter/common/flutter/] git describe --match *.*.* --long --tags 1c179c401f5756b06d1065f611d04c8f88db4fa3 [ ] [ +53 ms] Exit code 0 from: git describe --match *.*.* --long --tags 1c179c401f5756b06d1065f611d04c8f88db4fa3 [ ] [ ] 1.27.0-4.0.pre-139-g1c179c401f [ ] [ +109 ms] Unable to locate an Android SDK. [ ] [ +12 ms] executing: [/root/snap/flutter/common/flutter/] git rev-parse --abbrev-ref HEAD [ ] [ +12 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD [ ] [ ] master [ ] [ +86 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update. [ ] [ +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update. [ ] [ +83 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update. [ +1 ms] [ ] Artifact Instance of 'GradleWrapper' is not required, skipping update. [ ] [ ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update. [ ] [ ] Artifact Instance of 'FlutterSdk' is not required, skipping update. [ ] [ ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update. [ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'PubDependencies' is not required, skipping update. [ ] [ +166 ms] Initializing file store [ ] [ +45 ms] Skipping target: gen_localizations [ ] [ +14 ms] unpack_linux: Starting due to {} [ ] [ +349 ms] kernel_snapshot: Starting due to {} [ ] [ +6 ms] unpack_linux: Complete [ +2 ms] [+1538 ms] /root/snap/flutter/common/flutter/bin/cache/dart-sdk/bin/dart --disable-dart-dev /root/snap/flutter/common/flutter/bin/cache/artifacts/engine/linux-x64/frontend_server.d art.snapshot --sdk-root /root/snap/flutter/common/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk_ product/ --target=flutter --no-print-incremental-dependencies -Ddart.vm.profile=false -Ddart.vm.product=true --aot --tfa --packages /root/parts/bug/build/.dart_tool/package_config.json --output-dill /root/parts/bug/build/.dart_tool/flutter_build/67b48d61594c30ffc2868bb6c0889870/app.dill --depfile /root/parts/bug/build/.dart_tool/flutter_build/67b48d61594c30ffc2868bb6c0889870/kernel_s napshot.d package:bug/main.dart [ +2 ms] [+30037 ms] kernel_snapshot: Complete [ ] [ +600 ms] aot_elf_release: Starting due to {InvalidatedReason.inputChanged} [ ] [ +14 ms] executing: /root/snap/flutter/common/flutter/bin/cache/artifacts/engine/linux-x64-release/gen_snaps hot --deterministic --snapshot_kind=app-aot-elf --elf=/root/parts/bug/build/.dart_tool/flutter_build/67b48d61594c30ffc2868bb6c0889870/ap p.so --strip /root/parts/bug/build/.dart_tool/flutter_build/67b48d61594c30ffc2868bb6c0889870/app.dill [ ] [+10802 ms] aot_elf_release: Complete [ ] [ +47 ms] linux_aot_bundle: Starting due to {InvalidatedReason.inputChanged} [ ] [ +18 ms] linux_aot_bundle: Complete [ ] [ +45 ms] release_bundle_linux-x64_assets: Starting due to {} [ ] [ +264 ms] release_bundle_linux-x64_assets: Complete [ ] [ +60 ms] Persisting file store [ ] [ +14 ms] Done persisting file store [ ] [ +9 ms] build succeeded. [ ] [ +18 ms] "flutter assemble" took 44,160ms. [ ] [ +190 ms] ensureAnalyticsSent: 183ms [ ] [ +3 ms] Running shutdown hooks [ +1 ms] [ ] Shutdown hooks complete [ ] [ +1 ms] exiting with code 0 [+2893 ms] [2/6] Building CXX object CMakeFiles/bug.dir/flutter/generated_plugin_registrant.cc.o [ +62 ms] [3/6] Building CXX object CMakeFiles/bug.dir/main.cc.o [ +219 ms] [4/6] Building CXX object CMakeFiles/bug.dir/my_application.cc.o [ +623 ms] [5/6] Linking CXX executable intermediates_do_not_run/bug [ ] [5/6] Install the project... [ +41 ms] -- Install configuration: "Release" [ ] -- Installing: /root/parts/bug/build/build/linux/x64/release/bundle/bug [ +1 ms] -- Set runtime path of "/root/parts/bug/build/build/linux/x64/release/bundle/bug" to "$ORIGIN/lib" [ ] -- Installing: /root/parts/bug/build/build/linux/x64/release/bundle/data/icudtl.dat [ +7 ms] -- Installing: /root/parts/bug/build/build/linux/x64/release/bundle/lib/libflutter_linux_gtk.so [ +323 ms] -- Installing: /root/parts/bug/build/build/linux/x64/release/bundle/data/flutter_assets [ ] -- Installing: /root/parts/bug/build/build/linux/x64/release/bundle/data/flutter_assets/packages [ ] -- Installing: /root/parts/bug/build/build/linux/x64/release/bundle/data/flutter_assets/packages/cupert ino_icons [ ] -- Installing: /root/parts/bug/build/build/linux/x64/release/bundle/data/flutter_assets/packages/cupert ino_icons/assets [ ] -- Installing: /root/parts/bug/build/build/linux/x64/release/bundle/data/flutter_assets/packages/cupert ino_icons/assets/CupertinoIcons.ttf [ +2 ms] -- Installing: /root/parts/bug/build/build/linux/x64/release/bundle/data/flutter_assets/fonts [ ] -- Installing: /root/parts/bug/build/build/linux/x64/release/bundle/data/flutter_assets/fonts/MaterialI cons-Regular.otf [ +6 ms] -- Installing: /root/parts/bug/build/build/linux/x64/release/bundle/data/flutter_assets/NOTICES [ +5 ms] -- Installing: /root/parts/bug/build/build/linux/x64/release/bundle/data/flutter_assets/FontManifest.js on [ ] -- Installing: /root/parts/bug/build/build/linux/x64/release/bundle/data/flutter_assets/version.json [ ] -- Installing: /root/parts/bug/build/build/linux/x64/release/bundle/data/flutter_assets/AssetManifest.j son [ ] -- Installing: /root/parts/bug/build/build/linux/x64/release/bundle/lib/libapp.so [ +50 ms] Building Linux application... (completed in 60.3s) [ +2 ms] "flutter linux" took 61,043ms. [ +198 ms] ensureAnalyticsSent: 190ms [ +4 ms] Running shutdown hooks [ ] Shutdown hooks complete [ +1 ms] exiting with code 0 '/root/parts/bug/build/build/linux/release/bundle' is not a directory ```

If I run the same command with debug option, I can see that the only subfolder of root/parts/bug/build/build/linux is x64, and then inside we have /release/bundle

flutter doctor -v ``` [βœ“] Flutter (Channel master, 1.27.0-5.0.pre.139, on Linux, locale it_IT.UTF-8) β€’ Flutter version 1.27.0-5.0.pre.139 at /home/damiano/snap/flutter/common/flutter β€’ Framework revision 1c179c401f (2 ore fa), 2021-02-25 01:21:03 +0800 β€’ Engine revision da68c7ffa3 β€’ Dart version 2.13.0 (build 2.13.0-68.0.dev) [βœ“] Linux toolchain - develop for Linux desktop β€’ clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final) β€’ cmake version 3.10.2 β€’ ninja version 1.8.2 β€’ pkg-config version 0.29.1 [βœ“] Connected device (2 available) β€’ Linux (desktop) β€’ linux β€’ linux-x64 β€’ Linux β€’ Chrome (web) β€’ chrome β€’ web-javascript β€’ Google Chrome 88.0.4324.182 ```
snap/snapcraft.yaml ```yaml name: bug version: 2.5.0 summary: summary description: description confinement: strict base: core18 grade: stable slots: dbus-bug: interface: dbus bus: session name: com.example.bug apps: bug: command: bug extensions: [flutter-master] plugs: - network slots: - dbus-bug parts: bug: source: . plugin: flutter flutter-target: lib/main.dart ```
uname -a ``` 5.4.0-66-generic #74-Ubuntu SMP Wed Jan 27 22:54:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux ```
MarcusTomlinson commented 3 years ago

Hi, so sorry for the late reply here!

This has since been fixed in the snapcraft flutter extension but is not yet in stable. In order to get this working today you'll need to use the version of snapcraft from candidate:

snap refresh snapcraft --candidate