mogol / flutter_secure_storage

A Flutter plugin to store data in secure storage
https://pub.dartlang.org/packages/flutter_secure_storage
BSD 3-Clause "New" or "Revised" License
1.09k stars 340 forks source link

Linux App Won't build #676

Open GoranSustekJr opened 4 months ago

GoranSustekJr commented 4 months ago

dMy ubuntu machine gives error when executing flutter run -d linux. I get the following error when Using flutter run -d linux -v ] [ ] Shutdown hooks complete [ ] [ ] exiting with code 0 [ +758 ms] [2/5] Building CXX object CMakeFiles/crocut.dir/flutter/generated_plugin_registrant.cc.o [ +210 ms] [3/5] Building CXX object CMakeFiles/crocut.dir/my_application.cc.o [ +288 ms] [4/5] Linking CXX executable intermediates_do_not_run/crocut [ +1 ms] FAILED: intermediates_do_not_run/crocut [ +42 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 -lfontconfig CMakeFiles/crocut.dir/main.cc.o CMakeFiles/crocut.dir/my_application.cc.o CMakeFiles/crocut.dir/flutter/generated_plugin_registrant.cc.o -o intermediates_do_not_run/crocut -Wl,-rpath,/home/gsustek/projects/crocut-10-2-2024/crocut/build/linux/x64/debug/plugins/flutter_secure_storage_linux:/home/gsustek/projects/crocut-10-2-2024/crocut/build/linux/x64/debug/pl ugins/native_context_menu:/home/gsustek/projects/crocut-10-2-2024/crocut/build/linux/x64/debug/plugins/screen_retriever:/home/gsustek/projects/crocut-10-2-2024/crocut/build/linux/x64/debug /plugins/url_launcher_linux:/home/gsustek/projects/crocut-10-2-2024/crocut/build/linux/x64/debug/plugins/window_manager:/home/gsustek/projects/crocut-10-2-2024/crocut/build/linux/x64/debug /plugins/window_to_front:/home/gsustek/projects/crocut-10-2-2024/crocut/linux/flutter/ephemeral: plugins/flutter_secure_storage_linux/libflutter_secure_storage_linux_plugin.so plugins/native_context_menu/libnative_context_menu_plugin.so plugins/screen_retriever/libscreen_retriever_plugin.so plugins/url_launcher_linux/liburl_launcher_linux_plugin.so plugins/window_manager/libwindow_manager_plugin.so plugins/window_to_front/libwindow_to_front_plugin.so /home/gsustek/projects/crocut-10-2-2024/crocut/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 && : [ +3 ms] /snap/flutter/current/usr/bin/ld: /lib/x86_64-linux-gnu/libsecret-1.so.0: undefined reference tog_task_set_static_name' [ +1 ms] clang: error: linker command failed with exit code 1 (use -v to see invocation) [ +4 ms] ninja: build stopped: subcommand failed. [ +26 ms] Building Linux application... (completed in 9.3s) [+8564 ms] Exception: Build process failed [ +4 ms] "flutter run" took 19,436ms. [ +5 ms]

0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)

       #1      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:790:9)
       <asynchronous suspension>
       #2      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1367:27)
       <asynchronous suspension>
       #3      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
       <asynchronous suspension>
       #4      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
       <asynchronous suspension>
       #5      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:348:9)
       <asynchronous suspension>
       #6      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
       <asynchronous suspension>
       #7      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:294:5)
       <asynchronous suspension>
       #8      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:112:9)
       <asynchronous suspension>
       #9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
       <asynchronous suspension>
       #10     main (package:flutter_tools/executable.dart:90:3)
       <asynchronous suspension>

[ +84 ms] ensureAnalyticsSent: 82ms [ ] Running 1 shutdown hook [ +11 ms] Shutdown hooks complete [ ] exiting with code 1 `

I installed libsecret-1-dev, libsecret-tools, libsecret-1-0 and libjsoncpp-dev packages.

I think that error lines are these: [ +3 ms] /snap/flutter/current/usr/bin/ld: /lib/x86_64-linux-gnu/libsecret-1.so.0: undefined reference tog_task_set_static_name' [ +1 ms] clang: error: linker command failed with exit code 1 (use -v to see invocation)`

abarrafo commented 4 months ago

I had this same error. My app was working fine, then I attempted to introduce flutter_secure_storage.

This issue here leads us in the right direction to repair: https://github.com/mogol/flutter_secure_storage/issues/362

sudo snap remove flutter --purge

Then manually download and re-install flutter on linux from the manual installation instructions.

This, gets me to a few more errors, in which I lacked other required dependencies. I had to install the following:

sudo apt-get install build-essential libgtk-3-dev clang ninja-build cmake libsecret-1-0 libsecret-1-dev libjsoncpp-dev libsecret-tools libusb-dev

then

flutter clean flutter pub cache clean

finally,

flutter run -d linux -v :heavy_check_mark:

GoranSustekJr commented 4 months ago

Thank you very much it works!

On Wed, 21 Feb 2024 at 21:48, abarrafo @.***> wrote:

I had this same error. My app was working fine, then I attempted to introduce flutter_secure_storage.

This issue here leads us in the right direction to repair: #362 https://github.com/mogol/flutter_secure_storage/issues/362

sudo snap remove flutter --purge

Then manually download and re-install flutter on linux from the manual installation instructions.

This, gets me to a few more errors, in which I lacked other required dependencies. I had to install the following:

sudo apt-get install build-essential libgtk-3-dev clang ninja-build cmake libsecret-1-0 libsecret-1-dev libjsoncpp-dev libsecret-tools libusb-dev

then

flutter clean flutter pub cache clean

finally,

flutter run -d linux -v ✔️

— Reply to this email directly, view it on GitHub https://github.com/mogol/flutter_secure_storage/issues/676#issuecomment-1957884345, or unsubscribe https://github.com/notifications/unsubscribe-auth/BBEQTYKGW34YUUAVOI24TELYUZMR5AVCNFSM6AAAAABDC4PTWSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJXHA4DIMZUGU . You are receiving this because you authored the thread.Message ID: @.***>