flutter_secure_storage icon indicating copy to clipboard operation
flutter_secure_storage copied to clipboard

Linux deprecated literal operator

Open TomBursch opened this issue 7 months ago • 4 comments

On the latest fedora version, I get the following errors:

project/linux/flutter/ephemeral/.plugin_symlinks/flutter_secure_storage_linux/linux/include/json.hpp:24392:35: error: identifier '_json' preceded by whitespace in a literal operator declaration is deprecated [-Werror,-Wdeprecated-literal-operator]
project/linux/flutter/ephemeral/.plugin_symlinks/flutter_secure_storage_linux/linux/include/json.hpp:24400:49: error: identifier '_json_pointer' preceded by whitespace in a literal operator declaration is deprecated [-Werror,-Wdeprecated-literal-operator]
project/linux/flutter/ephemeral/.plugin_symlinks/flutter_secure_storage_linux/linux/include/json.hpp:24464:58: error: identifier '_json' preceded by whitespace in a literal operator declaration is deprecated [-Werror,-Wdeprecated-literal-operator]
project/linux/flutter/ephemeral/.plugin_symlinks/flutter_secure_storage_linux/linux/include/json.hpp:24465:58: error: identifier '_json_pointer' preceded by whitespace in a literal operator declaration is deprecated [-Werror,-Wdeprecated-literal-operator]
Error: Build process failed

Using flutter_secure_storage 9.2.4 and flutter_secure_storage_linux 1.2.2

If I remove the spaces around the string literal, the app compiles again.

TomBursch avatar Apr 19 '25 13:04 TomBursch

I am encountering this on my ubuntu 25 too

lordvcs avatar Apr 19 '25 17:04 lordvcs

Same issue after upgrading to Fedora 42

m-berto avatar Apr 23 '25 20:04 m-berto

As a workaround until is https://github.com/juliansteenbakker/flutter_secure_storage/pull/923 merged, those two overrides fixes it for me on Ubuntu 25.04:

dependency_overrides:
  flutter_secure_storage_linux:
    git:
      url: https://github.com/m-berto/flutter_secure_storage.git
      ref: patch-2
      path: flutter_secure_storage_linux
  flutter_secure_storage_platform_interface: 2.0.0

krille-chan avatar May 21 '25 15:05 krille-chan

I encountered this build failure issue on Fedora 42, and the PR #923 fixed it.

EchoEllet avatar May 28 '25 08:05 EchoEllet

⚠️ This issue has been marked as stale because it has been open for 60 days with no activity.

If this issue is still relevant, please comment to keep it active. Otherwise, it will be closed in 60 days.

github-actions[bot] avatar Jul 28 '25 03:07 github-actions[bot]

I think this is still relevant, as the PR has not been merged.

Henry-Hiles avatar Aug 14 '25 02:08 Henry-Hiles

I successfully worked around this by adding -Wno-error=deprecated-literal-operator to linux/CMakeLists.txt, so that the corresponding section looks like this:

function(APPLY_STANDARD_SETTINGS TARGET)
  target_compile_features(${TARGET} PUBLIC cxx_std_14)
  target_compile_options(${TARGET} PRIVATE -Wall -Werror -Wno-error=deprecated-literal-operator)
  target_compile_options(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O3>")
  target_compile_definitions(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>")
endfunction()

This still produces a warning, but it does not stop the build

moritz157 avatar Sep 02 '25 18:09 moritz157

Gonna comment on this as well to keep everything from being stale. I too have this issue.

EvelynMakesThings avatar Oct 25 '25 01:10 EvelynMakesThings