There are some issues I have to mention:
This is my application source code
- As you can see,
flutter-master
has been specified but by running snapcraft
, the stable version downloaded:
[ +7 ms] "build linux" is not currently supported.
[ +3 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:14:3)
#1 BuildLinuxCommand.runCommand (package:flutter_tools/src/commands/build_linux.dart:43:7)
#2 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:977:18)
#3 _rootRunUnary (dart:async/zone.dart:1198:47)
#4 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#5 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#6 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#7 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#8 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#9 Future._asyncCompleteWithValue.<anonymous closure> (dart:async/future_impl.dart:567:7)
#10 _rootRun (dart:async/zone.dart:1190:13)
#11 _CustomZone.run (dart:async/zone.dart:1093:19)
#12 _CustomZone.runGuarded (dart:async/zone.dart:997:7)
#13 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
#14 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#15 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#16 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#17 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)
[ +267 ms] ensureAnalyticsSent: 262ms
[ +7 ms] Running shutdown hooks
[ +1 ms] Shutdown hooks complete
[ +6 ms] exiting with code 1
Failed to run 'flutter build linux --release -v -t lib/main.dart' for 'aliyazdi75': Exited with code 1.
Verify that the part is using the correct parameters and try again.
- Then I have to change it manually by
snapcraft --debug
and running flutter channel master
, flutter upgeade
, flutter config --enable-linux-desktop
- Sometimes, by running
snapcraft
it says (I don’t know what’s the problem but it happens so randomly):
Could not find snap/snapcraft.yaml. Are you sure you are in the right directory?
To start a new project, use `snapcraft init`
and by checking the directory on VM, there is no snapcraft.yaml
:
snapcraft-aliyazdi75 # ls
parts prime project snap stage state
snapcraft-aliyazdi75 # cd snap/
snapcraft-aliyazdi75 ../snap# ls
flutter snapcraft
snapcraft-aliyazdi75 ../snap# cd
snapcraft-aliyazdi75 # snapcraft init
Created snap/snapcraft.yaml.
- I tried to build in
confinement: devmode
but faced a problem which I think related to url_launcher
:
[ +172 ms] Building without sound null safety
[ ] For more information see https://dart.dev/null-safety/unsound-null-safety
[ +23 ms] Building Linux application...
[ +41 ms] executing: [build/linux/release/] cmake -G Ninja -DCMAKE_BUILD_TYPE=Release /root/parts/aliyazdi75/build/linux
[ +80 ms] CMake Error at flutter/generated_plugins.cmake:12 (add_subdirectory):
[ +2 ms] add_subdirectory given source
[ ] "flutter/ephemeral/.plugin_symlinks/url_launcher_linux/linux" which is not
[ ] an existing directory.
[ ] Call Stack (most recent call first):
[ ] CMakeLists.txt:51 (include)
[ +1 ms] -- Configuring incomplete, errors occurred!
[ ] See also "/root/parts/aliyazdi75/build/build/linux/release/CMakeFiles/CMakeOutput.log".
[ +34 ms] Building Linux application... (completed in 142ms)
[ +1 ms] "flutter linux" took 1,594ms.
[ +11 ms] Unable to generate build files
[ +1 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:12:3)
#1 _runCmake (package:flutter_tools/src/linux/build_linux.dart:139:5)
<asynchronous suspension>
#2 buildLinux (package:flutter_tools/src/linux/build_linux.dart:72:5)
<asynchronous suspension>
#3 BuildLinuxCommand.runCommand (package:flutter_tools/src/commands/build_linux.dart:49:5)
<asynchronous suspension>
#4 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1159:12)
<asynchronous suspension>
#5 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1011:27)
<asynchronous suspension>
#6 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:152:19)
<asynchronous suspension>
#7 AppContext.run (package:flutter_tools/src/base/context.dart:151:12)
<asynchronous suspension>
#8 CommandRunner.runCommand (package:args/command_runner.dart:197:13)
<asynchronous suspension>
#9 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:280:9)
<asynchronous suspension>
#10 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:152:19)
<asynchronous suspension>
#11 AppContext.run (package:flutter_tools/src/base/context.dart:151:12)
<asynchronous suspension>
#12 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:236:5)
<asynchronous suspension>
#13 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:66:9)
<asynchronous suspension>
#14 run.<anonymous closure> (package:flutter_tools/runner.dart:64:12)
<asynchronous suspension>
#15 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:152:19)
<asynchronous suspension>
#16 AppContext.run (package:flutter_tools/src/base/context.dart:151:12)
<asynchronous suspension>
#17 runInContext (package:flutter_tools/src/context_runner.dart:75:10)
<asynchronous suspension>
#18 main (package:flutter_tools/executable.dart:92:3)
<asynchronous suspension>
[ +263 ms] ensureAnalyticsSent: 253ms
[ +3 ms] Running shutdown hooks
[ ] Shutdown hooks complete
[ ] exiting with code 1
Failed to run 'flutter build linux --release -v -t lib/main.dart' for 'aliyazdi75': Exited with code 1.
Verify that the part is using the correct parameters and try again.
- After all, finally, I built and snapped in
confinement: strict
and install my application by --dangerous
, and by running aliyazdi75
says:
Failed to register: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Connection ":1.177" is not allowed to own the service "io.github.aliyazdi75.my_site" due to AppArmor policy
@kenvandine Should I file these issues on flutter repository?