leanflutter / tray_manager

This plugin allows Flutter desktop apps to defines system tray.
https://pub.dev/packages/tray_manager
MIT License
230 stars 36 forks source link

Failure to build on Ubuntu - "undefined reference to `g_time_zone_new_identifier'" #30

Open gaddlord opened 1 year ago

gaddlord commented 1 year ago

I have run

sudo apt-get install libayatana-appindicator3-dev

while building I am getting the following error:

/snap/flutter/current/usr/bin/ld: /lib/x86_64-linux-gnu/libayatana-ido3-0.4.so.0: undefined reference to 
`g_time_zone_new_identifier'  ⬅️ HERE

[  +10 ms] clang: error: linker command failed with exit code 1 (use -v to see invocation)
[  +62 ms] ninja: build stopped: subcommand failed.
[  +56 ms] Exception: Build process failed
Exited (sigterm)

cat etc/os-release

PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

Flutter Doctor -v

[✓] Flutter (Channel stable, 3.3.10, on Ubuntu 22.04.1 LTS 5.15.0-58-generic, locale en_US.UTF-8)
    • Flutter version 3.3.10 on channel stable at /home/gad/snap/flutter/common/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 135454af32 (5 weeks ago), 2022-12-15 07:36:55 -0800
    • Engine revision 3316dd8728
    • Dart version 2.18.6
    • DevTools version 2.15.0

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • clang version 10.0.0-4ubuntu1
    • cmake version 3.16.3
    • ninja version 1.10.0
    • pkg-config version 0.29.1

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).

[✓] VS Code (version 1.74.3)
    • VS Code at /usr/share/code
    • Flutter extension version 3.57.20221221

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 22.04.1 LTS 5.15.0-58-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 109.0.5414.74

[✓] HTTP Host Availability
    • All required HTTP hosts are available
lijy91 commented 1 year ago

It looks like the glib library is missing, you can try installing it first.

sudo apt-get install libgtk2.0-dev

glib is a part of : libgtk2.0-dev

See: https://askubuntu.com/questions/58321/how-do-i-install-glib

gaddlord commented 1 year ago

Installed but the error persists:

[+1100 ms] [4/5] Linking CXX executable intermediates_do_not_run/ui
[        ] FAILED: intermediates_do_not_run/ui
[  +12 ms] : && /snap/flutter/current/usr/bin/clang++  -g  -B/snap/flutter/current/usr/lib/gcc/x86_64-linux-gnu/9 -B/snap/flutter/current/usr/lib/x86_64-linux-gnu -B/snap/flutter/current/lib/x86_64-linux-gnu -B/snap/flutter/current/usr/lib/ -L/snap/flutter/current/usr/lib/gcc/x86_64-linux-gnu/9 -L/snap/flutter/current/usr/lib/x86_64-linux-gnu -L/snap/flutter/current/lib/x86_64-linux-gnu -L/snap/flutter/current/usr/lib/ -lblkid -lgcrypt -llzma -llz4 -lgpg-error -luuid -lpthread -ldl -lepoxy CMakeFiles/ui.dir/main.cc.o CMakeFiles/ui.dir/my_application.cc.o CMakeFiles/ui.dir/flutter/generated_plugin_registrant.cc.o  -o intermediates_do_not_run/ui  -Wl,-rpath,/home/gad/Documents/mtg.studio.project/frontend/build/linux/x64/debug/plugins/screen_retriever:/home/gad/Documents/mtg.studio.project/frontend/build/linux/x64/debug/plugins/sentry_flutter:/home/gad/Documents/mtg.studio.project/frontend/build/linux/x64/debug/plugins/tray_manager:/home/gad/Documents/mtg.studio.project/frontend/build/linux/x64/debug/plugins/url_launcher_linux:/home/gad/Documents/mtg.studio.project/frontend/build/linux/x64/debug/plugins/window_manager:/home/gad/Documents/mtg.studio.project/frontend/linux/flutter/ephemeral:  plugins/screen_retriever/libscreen_retriever_plugin.so  plugins/sentry_flutter/libsentry_flutter_plugin.so  plugins/tray_manager/libtray_manager_plugin.so  plugins/url_launcher_linux/liburl_launcher_linux_plugin.so  plugins/window_manager/libwindow_manager_plugin.so  /home/gad/Documents/mtg.studio.project/frontend/linux/flutter/ephemeral/libflutter_linux_gtk.so  /snap/flutter/current/usr/lib/x86_64-linux-gnu/libgtk-3.so  /snap/flutter/current/usr/lib/x86_64-linux-gnu/libgdk-3.so  /snap/flutter/current/usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so  /snap/flutter/current/usr/lib/x86_64-linux-gnu/libpango-1.0.so  /snap/flutter/current/usr/lib/x86_64-linux-gnu/libharfbuzz.so  /snap/flutter/current/usr/lib/x86_64-linux-gnu/libatk-1.0.so  /snap/flutter/current/usr/lib/x86_64-linux-gnu/libcairo-gobject.so  /snap/flutter/current/usr/lib/x86_64-linux-gnu/libcairo.so  /snap/flutter/current/usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so  /snap/flutter/current/usr/lib/x86_64-linux-gnu/libgio-2.0.so  /snap/flutter/current/usr/lib/x86_64-linux-gnu/libgobject-2.0.so  /snap/flutter/current/usr/lib/x86_64-linux-gnu/libglib-2.0.so && :
[        ] /snap/flutter/current/usr/bin/ld: /lib/x86_64-linux-gnu/libayatana-ido3-0.4.so.0: undefined reference to `g_time_zone_new_identifier'
[   +1 ms] ninja: build stopped: subcommand failed.
[        ] clang: error: linker command failed with exit code 1 (use -v to see invocation)
[+26631 ms] Exception: Build process failed
Exited (sigterm)
gaddlord commented 1 year ago

Can it be that I am using libayatana-ido3-0.4 and the installation manual asked for libayatana-ido3-0.1?

leomil72 commented 1 year ago

I'm experiencing the same issue. Today I tried to build an example app for my Linux box (Kubuntu 22.04 LTS) and got the same error: [ ] /snap/flutter/current/usr/bin/ld: /lib/x86_64-linux-gnu/libayatana-ido3-0.4.so.0: undefined reference tog_time_zone_new_identifier' [ ] clang: error: linker command failed with exit code 1 (use -v to see invocation) [ +1 ms] ninja: build stopped: subcommand failed. [ +8 ms] Building Linux application... (completed in 3,0s) [+5094 ms] Exception: Build process failed `