rive-flutter icon indicating copy to clipboard operation
rive-flutter copied to clipboard

Unable to build flutter application for linux

Open rolandgeider opened this issue 1 year ago • 7 comments

Description

It seems it's not possible to build flutter application for linux

Steps To Reproduce

$ flutter build linux

/home/roland/entwicklung/wger/flutter/linux/flutter/ephemeral/.plugin_symlinks/rive_common/macos/SheenBidi/Source/SBParagraph.c:618:16: error: unused variable 'stringLength' [-Werror,-Wunused-variable]
Building Linux application...                                           
Build process failed

Source .riv/.rev file

n/a

Expected behavior

The build succeds. It seems that 0.13.0 is the version that introduced the bug, it's possible to build the application with 0.12.4 without any problems.

Screenshots

n/a

Device & Versions (please complete the following information)

  • Device: linux
  • OS: Ubuntu 22.04
  • Flutter Version:
Flutter 3.19.6 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 54e66469a9 (vor 4 Wochen) • 2024-04-17 13:08:03 -0700
Engine • revision c4cd48e186
Tools • Dart 3.3.4 • DevTools 2.31.1

Additional context

Also happens on github's CI: https://github.com/wger-project/flutter/actions/runs/9052280531/job/24869782253

rolandgeider avatar May 12 '24 18:05 rolandgeider

Got the same error: https://ci.appveyor.com/project/flet-dev/flet/build/job/8ml3csb67k1mi5dr#L1994

FeodorFitsner avatar May 21 '24 23:05 FeodorFitsner

0.13.2 introduced that issue. 0.13.1 gives successful build: https://ci.appveyor.com/project/flet-dev/flet/builds/49860784/job/ctoa28981dcvrgg5#L1926

0.13.2 adds rive_common native plugin: https://github.com/flet-dev/flet/commit/40030648ff9de15c80dfe83990aeb729cfd80c25#diff-b944988673a542aa817aea9d0faaa93591b3acab9f6b5ca62be94d0b951c8989

FeodorFitsner avatar May 21 '24 23:05 FeodorFitsner

Same error with 0.13.1 and latest 0.13.5 on Linux Mint. Build is OK with 0.12.4 thanks rolandgeider

/home/cdesbois/Documents/flutter_app/SP/linux/flutter/ephemeral/.plugin_symlinks/rive_common/macos/SheenBidi/Source/SBParagraph.c:619:16: error: unused variable 'stringLength' [-Werror,-Wunused-variable]

flutter --version
Flutter 3.22.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 5dcb86f68f (il y a 3 semaines) • 2024-05-09 07:39:20 -0500
Engine • revision f6344b75dc
Tools • Dart 3.4.0 • DevTools 2.34.3

Toph92 avatar Jun 01 '24 00:06 Toph92

This should be higher priority issue. Almost 2 months but no fix is applied for an unused variable warning causing build error. Please update it with a fix.

KingkorAtMaxint avatar Jul 26 '24 07:07 KingkorAtMaxint

Is there any update? It's still impossible to build the app for Linux with the latest Rive.

FeodorFitsner avatar Sep 03 '24 00:09 FeodorFitsner

As a data point I build Rive 0.4.11 (added CMake) for Yocto Linux using this repo: https://github.com/meta-flutter/rive-common/

The install target also installs a package config file.

This Yocto recipe supports both GCC 13 and Clang 18: https://github.com/meta-flutter/meta-flutter/blob/scarthgap/recipes-graphics/rive/rive-text_0.4.11.bb

jwinarske avatar Sep 28 '24 15:09 jwinarske

Same issue, please fix this bug.

wenyue avatar Oct 24 '24 06:10 wenyue

You can get around this by adding -Wno-unused-variable and -Wno-unused-function flags after the existing -Werror flags on this line of your CMakeLists.txt file in the linux directory.

target_compile_options(${TARGET} PRIVATE -Wall -Werror -Wno-unused-variable -Wno-unused-function)

Those flags are already in the clang build command for rive and the SheenBidi dependency...I don't know why I have to add the flags to my global flutter linux config in order to make things work.

Running with flutter build linux -v shows the particular clang command causing the error. Maybe someone has insight as to why it still throws the error despite those two -Wno flags already being included.

[  +52 ms] [2/7] Building C object plugins/rive_common/CMakeFiles/rive_common_plugin.dir/__/macos/SheenBidi/Source/SheenBidi.c.o
[        ] FAILED: plugins/rive_common/CMakeFiles/rive_common_plugin.dir/__/macos/SheenBidi/Source/SheenBidi.c.o 
[   +6 ms] /usr/bin/clang -DAPPLICATION_ID=\"com.example.example\" -DFLUTTER_PLUGIN_IMPL -DNDEBUG -Drive_common_plugin_EXPORTS
-I/home/caseymdk/tmp/rive-flutter/example/linux/flutter/ephemeral/.plugin_symlinks/rive_common/linux/../macos/harfbuzz/src
-I/home/caseymdk/tmp/rive-flutter/example/linux/flutter/ephemeral/.plugin_symlinks/rive_common/linux/../macos/rive-cpp/skia/renderer/include
-I/home/caseymdk/tmp/rive-flutter/example/linux/flutter/ephemeral/.plugin_symlinks/rive_common/linux/../macos/rive-cpp/include
-I/home/caseymdk/tmp/rive-flutter/example/linux/flutter/ephemeral/.plugin_symlinks/rive_common/linux/../macos/SheenBidi/Headers
-I/home/caseymdk/tmp/rive-flutter/example/linux/flutter/ephemeral/.plugin_symlinks/rive_common/linux/../macos/miniaudio
-I/home/caseymdk/tmp/rive-flutter/example/linux/flutter/ephemeral/.plugin_symlinks/rive_common/linux/../macos/yoga
-I/home/caseymdk/tmp/rive-flutter/example/linux/flutter/ephemeral -isystem /usr/include/gtk-3.0 -isystem /usr/include/pango-1.0 -isystem /usr/include/glib-2.0
-isystem /usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem /usr/include/harfbuzz -isystem /usr/include/freetype2 -isystem /usr/include/libpng16 -isystem
/usr/include/libmount -isystem /usr/include/blkid -isystem /usr/include/fribidi -isystem /usr/include/cairo -isystem /usr/include/pixman-1 -isystem
/usr/include/gdk-pixbuf-2.0 -isystem /usr/include/webp -isystem /usr/include/gio-unix-2.0 -isystem /usr/include/atk-1.0 -isystem /usr/include/at-spi2-atk/2.0
-isystem /usr/include/at-spi-2.0 -isystem /usr/include/dbus-1.0 -isystem /usr/lib/x86_64-linux-gnu/dbus-1.0/include -DYOGA_EXPORT= -DSB_CONFIG_UNITY
-DWITH_RIVE_TEXT -DWITH_RIVE_AUDIO_TOOLS -DWITH_RIVE_AUDIO -DMA_NO_RESOURCE_MANAGER -DHAVE_OT -DHB_NO_FALLBACK_SHAPE -DHB_NO_WIN1256  -DHB_NO_CFF
-DHB_NO_BUFFER_VERIFY -DHB_NO_BUFFER_MESSAGE -DHB_NO_PAINT -DHB_NO_MMAP -DHB_NO_META -Wno-documentation -Wno-comma -Wno-unreachable-code -Wno-shorten-64-to-32
-ansi -pedantic -Wno-unused-function -Wno-unused-variable -DANSI_DECLARATORS -O3 -DNDEBUG -fPIC -Wall -Werror -O3 -pthread -MD -MT
plugins/rive_common/CMakeFiles/rive_common_plugin.dir/__/macos/SheenBidi/Source/SheenBidi.c.o -MF
plugins/rive_common/CMakeFiles/rive_common_plugin.dir/__/macos/SheenBidi/Source/SheenBidi.c.o.d -o
plugins/rive_common/CMakeFiles/rive_common_plugin.dir/__/macos/SheenBidi/Source/SheenBidi.c.o -c
/home/caseymdk/tmp/rive-flutter/example/linux/flutter/ephemeral/.plugin_symlinks/rive_common/macos/SheenBidi/Source/SheenBidi.c
[   +2 ms] In file included from
/home/caseymdk/tmp/rive-flutter/example/linux/flutter/ephemeral/.plugin_symlinks/rive_common/macos/SheenBidi/Source/SheenBidi.c:36:
[        ] /home/caseymdk/tmp/rive-flutter/example/linux/flutter/ephemeral/.plugin_symlinks/rive_common/macos/SheenBidi/Source/SBParagraph.c:618:16: error:
unused variable 'stringLength' [-Werror,-Wunused-variable]
[   +1 ms]   618 |     SBUInteger stringLength = codepointSequence->stringLength;
[        ]       |                ^~~~~~~~~~~~
[        ] 1 error generated.

caseymdk avatar Nov 21 '24 08:11 caseymdk

I got an error, flet version 0.25.2 package:proyect_main/main.dart [ ] [+2528 ms] ../../../../.pub-cache/hosted/pub.dev/flet-0.25.1/lib/src/utils/theme.dart:356:2 8: Error: A value of type 'TabBarThemeData' can't be returned from a function with return type 'TabBarTheme?'. [ ] [ ] - 'TabBarThemeData' is from 'package:flutter/src/material/tab_bar_theme.dart' ('/usr/bin/flutter/packages/flutter/lib/src/material/tab_bar_theme.dart'). [ ] [ ] - 'TabBarTheme' is from 'package:flutter/src/material/tab_bar_theme.dart' ('/usr/bin/flutter/packages/flutter/lib/src/material/tab_bar_theme.dart'). [ ] [ ] return theme.tabBarTheme.copyWith( [ ] [ ] ^ [ ] [ ] ../../../../.pub-cache/hosted/pub.dev/flet-0.25.1/lib/src/utils/theme.dart:438:2 8: Error: A value of type 'DialogThemeData' can't be returned from a function with return type 'DialogTheme?'. [ ] [ ] - 'DialogThemeData' is from 'package:flutter/src/material/dialog_theme.dart' ('/usr/bin/flutter/packages/flutter/lib/src/material/dialog_theme.dart'). [ ] [ ] - 'DialogTheme' is from 'package:flutter/src/material/dialog_theme.dart' ('/usr/bin/flutter/packages/flutter/lib/src/material/dialog_theme.dart'). [ ] [ ] return theme.dialogTheme.copyWith( [ ] [ ] ^ [ ] [ ] ../../../../.pub-cache/hosted/pub.dev/flet-0.25.1/lib/src/utils/theme.dart:482:2 6: Error: A value of type 'CardThemeData' can't be returned from a function with return type 'CardTheme?'. [ ] [ ] - 'CardThemeData' is from 'package:flutter/src/material/card_theme.dart' ('/usr/bin/flutter/packages/flutter/lib/src/material/card_theme.dart'). [ ] [ ] - 'CardTheme' is from 'package:flutter/src/material/card_theme.dart' ('/usr/bin/flutter/packages/flutter/lib/src/material/card_theme.dart'). [ ] [ ] return theme.cardTheme.copyWith( [ ] [ ] ^ [ ] [+4789 ms] Persisting file store [ ] [ +9 ms] Done persisting file store [ ] [ +1 ms] Target kernel_snapshot_program failed: Exception [ ] #0 KernelSnapshotProgram.build (package:flutter_tools/src/build_system/targets/common.dart:274:7) [ ] [ ] #1 _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:891:9) [ ] [ +1 ms] #2 Future.wait. (dart:async/future.dart:520:21) [ ] [ ] #3 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:829:32) [ ] [ ] #4 Future.wait. (dart:async/future.dart:520:21) [ ] [ ] #5 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:829:32) [ ] [ ] #6 Future.wait. (dart:async/future.dart:520:21) [ ] [ ] #7 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:829:32) [ ] [ ] #8 Future.wait. (dart:async/future.dart:520:21) [ ] [ ] #9 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:829:32) [ ] [ ] #10 Future.wait. (dart:async/future.dart:520:21) [ ] [ ] #11 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:829:32) [ ] [ ] #12 Future.wait. (dart:async/future.dart:520:21) [ ] [ ] #13 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:829:32) [ ] [ ] #14 FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:651:16) [ ] [ ] #15 AssembleCommand.runCommand (package:flutter_tools/src/commands/assemble.dart:329:32) [ ] [ ] #16 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1450:27) [ ] [ ] #17 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19) [ ] [ ] #18 CommandRunner.runCommand (package:args/command_runner.dart:212:13) [ ] [ ] #19 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:421:9) [ ] [ ] #20 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19) [ ] [ ] #21 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:364:5) [ ] [ ] #22 run.. (package:flutter_tools/runner.dart:131:9) [ ] [ ] #23 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19) [ ] [ ] #24 main (package:flutter_tools/executable.dart:94:3) [ ] [ ] [ +4 ms] "flutter assemble" took 7,776ms. [ ] [ +6 ms] [ ] #0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3) [ ] #1 AssembleCommand.runCommand (package:flutter_tools/src/commands/assemble.dart:346:7) [ ] [ ] #2 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1450:27) [ ] [ ] #3 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19) [ ] [ ] #4 CommandRunner.runCommand (package:args/command_runner.dart:212:13) [ ] [ ] #5 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:421:9) [ ] [ ] #6 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19) [ ] [ ] #7 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:364:5) [ ] [ ] #8 run.. (package:flutter_tools/runner.dart:131:9) [ ] [ ] #9 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19) [ ] [ ] #10 main (package:flutter_tools/executable.dart:94:3) [ ] [ ] [ +122 ms] ensureAnalyticsSent: 121ms [ ] [ ] Running 1 shutdown hook [ ] [ ] Shutdown hooks complete [ ] [ +11 ms] exiting with code 1 [ ] ninja: build stopped: subcommand failed. [ +6 ms] Building Linux application... (completed in 8.3s) [ ] "flutter linux" took 8,613ms. [ +3 ms] Build process failed [ ] #0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3) #1 _runBuild (package:flutter_tools/src/linux/build_linux.dart:210:5) #2 buildLinux (package:flutter_tools/src/linux/build_linux.dart:83:5) #3 BuildLinuxCommand.runCommand (package:flutter_tools/src/commands/build_linux.dart:87:5) #4 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1450:27) #5 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19) #6 CommandRunner.runCommand (package:args/command_runner.dart:212:13) #7 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:421:9) #8 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19) #9 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:364:5) #10 run.. (package:flutter_tools/runner.dart:131:9) #11 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19) #12 main (package:flutter_tools/executable.dart:94:3) build process failed

yizu13 avatar Dec 14 '24 16:12 yizu13

Same issue here, 0.13.20 has same issue, cannot build on linux, I'm trying to build with 0.12.4, it's removing rive_common and it can be build successfully. Please fix this issue ASAP

MarlonJD avatar Jan 03 '25 05:01 MarlonJD

We've changed how Rive Flutter works from version 0.14.0 and up. The latest dev release supports Linux. We also now pre-build the libraries (while still giving you the option to build them yourself). This issue should be resolved. If you still have Linux-related issues, please open a new ticket. Note that the Rive Renderer support for Linux is tracked in this issue: https://github.com/rive-app/rive-flutter/issues/505

You can read more here:

HayesGordon avatar Aug 01 '25 14:08 HayesGordon