Closed AminAzGol closed 1 year ago
had some search and find this solution.
it suggests to run flutter create .
before flutter build linux
but I got a new error this time:
💪 Building with sound null safety 💪
ERROR: ../flutter/flutter/.pub-cache/hosted/pub.dartlang.org/overlay_support-1.2.1/lib/src/overlay_entry.dart:101:24: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
ERROR: - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../flutter/flutter/packages/flutter/lib/src/widgets/binding.dart').
ERROR: WidgetsBinding.instance?.scheduleFrameCallback((_) => animateRemove());
ERROR: ^
ERROR: ../flutter/flutter/.pub-cache/hosted/pub.dartlang.org/feedback-2.2.1/lib/src/utilities/back_button_interceptor.dart:12:22: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
ERROR: - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../flutter/flutter/packages/flutter/lib/src/widgets/binding.dart').
ERROR: WidgetsBinding.instance!.addObserver(this);
ERROR: ^
ERROR: ../flutter/flutter/.pub-cache/hosted/pub.dartlang.org/feedback-2.2.1/lib/src/utilities/back_button_interceptor.dart:19:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
ERROR: - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../flutter/flutter/packages/flutter/lib/src/widgets/binding.dart').
ERROR: WidgetsBinding.instance!.removeObserver(this);
ERROR: ^
ERROR: ../flutter/flutter/.pub-cache/hosted/pub.dartlang.org/feedback-2.2.1/lib/src/l18n/localization.dart:44:41: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
ERROR: - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../flutter/flutter/packages/flutter/lib/src/widgets/binding.dart').
ERROR: final Locale? locale = WidgetsBinding.instance?.window.locale;
ERROR: ^
ERROR: ../flutter/flutter/.pub-cache/hosted/pub.dartlang.org/feedback-2.2.1/lib/src/utilities/media_query_from_window.dart:25:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
ERROR: - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../flutter/flutter/packages/flutter/lib/src/widgets/binding.dart').
ERROR: WidgetsBinding.instance!.addObserver(this);
ERROR: ^
ERROR: ../flutter/flutter/.pub-cache/hosted/pub.dartlang.org/feedback-2.2.1/lib/src/utilities/media_query_from_window.dart:70:54: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
ERROR: - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../flutter/flutter/packages/flutter/lib/src/widgets/binding.dart').
ERROR: data: MediaQueryData.fromWindow(WidgetsBinding.instance!.window),
ERROR: ^
ERROR: ../flutter/flutter/.pub-cache/hosted/pub.dartlang.org/feedback-2.2.1/lib/src/utilities/media_query_from_window.dart:77:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
ERROR: - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../flutter/flutter/packages/flutter/lib/src/widgets/binding.dart').
ERROR: WidgetsBinding.instance!.removeObserver(this);
ERROR: ^
ERROR: ../flutter/flutter/.pub-cache/hosted/pub.dartlang.org/fl_chart-0.41.0/lib/src/chart/pie_chart/pie_chart.dart:42:20: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
ERROR: - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../flutter/flutter/packages/flutter/lib/src/widgets/binding.dart').
ERROR: WidgetsBinding.instance?.addPostFrameCallback((_) {
ERROR: ^
Building Linux application...
You need to update the feedback, fl_chart and overlay_support packages, but when doing so will create new errors due to breaking changes in the updated packages.
Though it's a bit challenging, I've managed to compile Syrius on Arch and Ubuntu.
As AminAzGol pointed out
had some search and find this solution. it suggests to run
flutter create .
beforeflutter build linux
Another point to consider is the directory name for the syrius project.
For my first attempt, I downloaded the zipped archive for the master branch, resulting in my Syrius directory being named syrius-master
.
Due to an issue with flutter create
, I had to rename the directory to syrius
in order to be Flutter-compliant.
This will allow us to build the project and flutter to execute the code. Also, the WidgetsBinding warnings that follow don't prevent the app from running. Maybe someone else will know how to troubleshoot those but I've found them to be irrelevant.
Instead, after the Syrius splash screen, I see the following message:
PlatformException(channel-error, Unable to establish connection on channel., null, null)'
This is caused by the Wakelock plugin; due to a lack of Linux support and no operating system distinction in the Syrius code, the Wakelock code is called immediately after the splash screen and causes the error to be displayed.
In order to solve this, I commented out the Wakelock checks in the following files:
After patching those calls, we'll see some unhandled exceptions due to missing files. Example
[ERROR:flutter/runtime/dart_isolate.cc(1098)] Unhandled exception: Zenon SDK Exception: Library libznn could not be found
0 EmbeddedNode.initializeNodeLib (package:zenon_syrius_wallet_flutter/embedded_node/embedded_node.dart:63:7)
1 EmbeddedNode.runNode (package:zenon_syrius_wallet_flutter/embedded_node/embedded_node.dart:85:7)
2 _delayEntrypointInvocation.
(dart:isolate-patch/isolate_patch.dart:300:17) 3 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)
To solve this, we need to supply some files manually to the Syrius root directory (before or after we run the project, doesn't matter).
Download the Zenon Dart SDK and copy these files to the Syrius root
Apparently, the errors I mentioned could be ignored, and the build was completed. I'm not sure this can cause any future problems but for now, I could build and run the app without doing anything about the errors. After the build, at runtime, I encounter the exact problem mentioned by @Sol-Sanctum I followed you're instructions one by one, and the problem was fixed on my next run. Thank you @Sol-Sanctum for your detailed and easy to follow explanation. I'm looking forward to an official Snap release of Syrius.
Install Instructions
git clone -b linux_poc https://github.com/Sol-Sanctum/syrius.git
git clone https://github.com/zenon-network/znn_sdk_dart.git
Download the Zenon Dart SDK and copy these files to the Syrius root
Syrius v0.0.6 includes the solution I previously described. Anyone should be able to build Syrius from source or use the automatically generated release.
Commit: https://github.com/zenon-network/syrius/commit/c996cc404f721b329d12e9a638a149acd6648bf3
@AminAzGol @zenon-network please close this issue.
After installing flutter successfully and setting up
linux
environment according to official documentation, still get the following error when I runfluttter build linux