sony / flutter-elinux

Flutter tools for embedded Linux (eLinux)
BSD 3-Clause "New" or "Revised" License
424 stars 43 forks source link

about some path references #172

Closed kero990 closed 1 year ago

kero990 commented 1 year ago

Hi, I am trying to use flutter-elinux to compile localsend, this is its project https://github.com/localsend/localsend But whether I use cross-compilation or use an arm64 machine to compile locally, I will get a lot of errors. What appeared at the very beginning was an error report that some files could not be found, like this.

lib/main.dart:6:8: Error: Error when reading 'lib/gen/strings.g.dart': No such file or directory import 'package:localsend_app/gen/strings.g.dart'

As can be seen from this error report, it tries to find strings.g.dart under lib/gen/, but the last sentence shows that this file is not actually under lib/gen, it is under the project main directory /gen May I ask if you have any mistakes in the calling path? Because when I tried to compile flutter-embedded-linux, I found that you had a path error The compilation instructions for flutter-embedded-linux are as follows:

$ mkdir build $ cd build $ cmake -DUSER_PROJECT_PATH=examples/flutter-x11-client -DCMAKE_BUILD_TYPE=Release .. $ cmake --build .

But when cmake is executed, the returned information shows

Build files have been written to: /root/flutter-elinux/flutter-embedded-linux

In other words, the files generated by cmake are not in the build, but in the parent directory while the build directory is completely blank At this time, the last step will report an error

Error: could not load cache

So I think you guys might have a problem with getting the wrong path in the project

HidenoriMatsubayashi commented 1 year ago

Can you please attach the whole log message?

kero990 commented 1 year ago

Can you please attach the whole log message?

I'm not very familiar with flutter. According to the prompt of the project, I ran

flutter pub run build_runner build -d

,and the above error disappeared. The current error is

ERROR: Compilation to SkSL failed. /root/flutter-elinux/flutter/packages/flutter/lib/src/material/shaders/ink_sparkle.frag: warning: (version, profile) forced to be (460, core), while in source code it is (320, es)
/root/flutter-elinux/flutter/packages/flutter/lib/src/material/shaders/ink_sparkle.frag:9: error: '#include' : Included file not found. for header name: flutter/runtime_effect.glsl
/root/flutter-elinux/flutter/packages/flutter/lib/src/material/shaders/ink_sparkle.frag:93: error: 'FlutterFragCoord' : no matching overloaded function found
/root/flutter-elinux/flutter/packages/flutter/lib/src/material/shaders/ink_sparkle.frag:93: error: '=' : cannot convert from ' const float' to ' temp 2-component vector of float'
ERROR: Target release_bundle_linux-arm64_assets failed: ShaderCompilerException: Shader compilation of "/root/flutter-elinux/flutter/packages/flutter/lib/src/material/shaders/ink_sparkle.frag" to "/root/localsend/build/flutter_assets/shaders/ink_sparkle.frag" failed with exit code 1.
/root/flutter-elinux/flutter/packages/flutter/lib/src/material/shaders/ink_sparkle.frag: warning: (version, profile) forced to be (460, core), while in source code it is (320, es)
/root/flutter-elinux/flutter/packages/flutter/lib/src/material/shaders/ink_sparkle.frag:9: error: '#include' : Included file not found. for header name: flutter/runtime_effect.glsl
/root/flutter-elinux/flutter/packages/flutter/lib/src/material/shaders/ink_sparkle.frag:93: error: 'FlutterFragCoord' : no matching overloaded function found
/root/flutter-elinux/flutter/packages/flutter/lib/src/material/shaders/ink_sparkle.frag:93: error: '=' : cannot convert from ' const float' to ' temp 2-component vector of float'

Now I can't locate whether the problem is on flutter, on the project, or on flutter-elinux.

HidenoriMatsubayashi commented 1 year ago

Sorry for the late response. I believe this issue is same as https://github.com/sony/flutter-elinux/issues/161. Please use the latest version.

kero990 commented 1 year ago

@HidenoriMatsubayashi Latest progress I reconfigured the flutter environment and the above bug has been fixed in flutter3.10.x Now I can compile correctly with flutter-elinux, but it still won't work. The current error is as follows

flutter: Initializing tray failed: MissingPluginException(No implementation found for method InitSystemTray on channel flutter/system_tray/tray)
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method ensureInitialized on channel window_manager)
#0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:308)
<asynchronous suspension>
#1      WindowManager.ensureInitialized (package:window_manager/src/window_manager.dart:91)
<asynchronous suspension>
#2      preInit (package:localsend_app/init.dart:88)
<asynchronous suspension>
#3      main (package:localsend_app/main.dart:28)
<asynchronous suspension>

The project author does not have an arm platform, so no suggestions were given. So come here and ask if it has anything to do with Flutter-eLinux