flutter_secure_storage
flutter_secure_storage copied to clipboard
Unable to build on linux version 5.10.0
I have installed all the packages mentioned here :

And also mentioned here.
I am actually able to build (i have no message package not found but i am seeing this error coming from libsecret :
[+2902 ms] [2/5] Building CXX object CMakeFiles/myappname.dir/flutter/generated_plugin_registrant.cc.o
[ +15 ms] [3/5] Building CXX object CMakeFiles/myappname.dir/my_application.cc.o
[ +453 ms] [4/5] Linking CXX executable intermediates_do_not_run/myappname
[ ] FAILED: intermediates_do_not_run/myappname
[ +12 ms] : && /snap/flutter/current/usr/bin/clang++ -O3 -DNDEBUG -B/snap/flutter/current/usr/lib/gcc/x86_64-linux-gnu/8
-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/8 -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 -B/snap/flutter/current/usr/lib/gcc/x86_64-linux-gnu/8
-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/8 -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 CMakeFiles/myappname.dir/main.cc.o
CMakeFiles/myappname.dir/my_application.cc.o CMakeFiles/myappname.dir/flutter/generated_plugin_registrant.cc.o -o intermediates_do_not_run/myappname
-Wl,-rpath,/home/tom/StudioProjects/myappname/build/linux/x64/release/plugins/flutter_secure_storage_linux:/home/tom/StudioProjects/myappname/build/linux/x64/relea
se/plugins/url_launcher_linux:/home/tom/StudioProjects/myappname/linux/flutter/ephemeral:
plugins/flutter_secure_storage_linux/libflutter_secure_storage_linux_plugin.so plugins/url_launcher_linux/liburl_launcher_linux_plugin.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/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
/home/tom/StudioProjects/myappname/linux/flutter/ephemeral/libflutter_linux_gtk.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 && :
[ +6 ms] //lib/x86_64-linux-gnu/libsecret-1.so.0: undefined reference to `g_task_set_name'
[ +5 ms] //lib/x86_64-linux-gnu/libjsoncpp.so.25: undefined reference to `std::__throw_bad_array_new_length()@GLIBCXX_3.4.29'
[ ] //lib/x86_64-linux-gnu/libjsoncpp.so.25: undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char>
>::basic_ostringstream()@GLIBCXX_3.4.26'
[ ] //lib/x86_64-linux-gnu/libsecret-1.so.0: undefined reference to `g_task_get_name'
[ ] clang: error: linker command failed with exit code 1 (use -v to see invocation)
[ +5 ms] ninja: build stopped: subcommand failed.
[ +27 ms] Building Linux application... (completed in 11.0s)
[ +4 ms] "flutter linux" took 12,038ms.
[ +4 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:186:5)
<asynchronous suspension>
#2 buildLinux (package:flutter_tools/src/linux/build_linux.dart:78:5)
<asynchronous suspension>
#3 BuildLinuxCommand.runCommand (package:flutter_tools/src/commands/build_linux.dart:85:5)
<asynchronous suspension>
#4 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1183:27)
<asynchronous suspension>
#5 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#6 CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#7 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)
<asynchronous suspension>
#8 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#9 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
<asynchronous suspension>
#10 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
<asynchronous suspension>
#11 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#12 main (package:flutter_tools/executable.dart:94:3)
<asynchronous suspension>
I have also run these commands.
Thanks in advance for any explanations
Same here.
Same here.
Try using a non-snap version of flutter.
Did a manual install but the errors persist:
[ +4 ms] executing: [build/linux/x64/debug/] cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DFLUTTER_TARGET_PLATFORM=linux-x64 /home/user/project/linux
[ +489 ms] -- Checking for module 'libsecret-1>=0.18.4'
[ +11 ms] -- No package 'libsecret-1' found
[ ] -- Configuring incomplete, errors occurred!
[ ] See also "/home/user/project/build/linux/x64/debug/CMakeFiles/CMakeOutput.log".
[ +2 ms] CMake Error at /home/linuxbrew/.linuxbrew/Cellar/cmake/3.24.0/share/cmake/Modules/FindPkgConfig.cmake:607 (message):
[ +14 ms] A required package was not found
[ +8 ms] Call Stack (most recent call first):
[ ] /home/linuxbrew/.linuxbrew/Cellar/cmake/3.24.0/share/cmake/Modules/FindPkgConfig.cmake:829 (_pkg_check_modules_internal)
[ ] flutter/ephemeral/.plugin_symlinks/flutter_secure_storage_linux/linux/CMakeLists.txt:13 (pkg_check_modules)
I have libsecret-1 installed
$ sudo apt-get install -y libsecret-1-0 libsecret-1-dev libjsoncpp-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libjsoncpp-dev is already the newest version (1.9.5-3).
libsecret-1-0 is already the newest version (0.20.5-2).
libsecret-1-dev is already the newest version (0.20.5-2).
0 upgraded, 0 newly installed, 0 to remove and 13 not upgraded.
@khanliKU Your distro name & version?
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"
Note: I am running this in VirtualBox
Weird. I don't exactly know what's wrong here. But I see you are using linuxbrew. You installed CMake from there. It's a wild guess but can you install CMake from the official repo as well?
Before installing, make sure to remove CMake or any other tools flutter uses you installed from linuxbrew and install them using apt
I created a new VM and install everything using apt/apt-get. Cloned flutter. It ran this time.
FYI
Sorry guys i have not time right now to check it out on a new VM instance and with the new instructions provided, surely will do and update here.
Try using a non-snap version of flutter.
It worked for me!
It's also working for me thanks !
Worked for me as well.
Try using a non-snap version of flutter.
Yes, this works. But I want to use snap. It's more convenient to download Flutter that way, personally.
Also, I'd prefer if my projects worked for everyone (with any environment regardless of how they installed Flutter).