react-native-libsodium icon indicating copy to clipboard operation
react-native-libsodium copied to clipboard

Libsodium react native does not support 16KB devices

Open dansecan25 opened this issue 3 months ago • 12 comments

When analyzing the apk of my react native app, according to the documentation instructions, react-native-libsodium version 1.4.0 appears with the warning 4KB LOAD section alignment, but 16KB is required

Android is requiring apps, starting november 1st to support 16KB page sizes, if not, the app can't be updated, are there any plans to update this library to comply this changes Android require?

dansecan25 avatar Sep 11 '25 15:09 dansecan25

Was just going to post this as well. Upgrading to Expo 53/54 also fails (React-Native 0.80, React 19), as there's a mismatch in RN-Folly dependencies from this packages Pods. I think this is a parallel requirement to fulfill the 16kb requirement, as Expo 52 does not natively support this upgrade.

Need to have first class support for libsodium on latest packages.

jwtong avatar Sep 11 '25 17:09 jwtong

I have issues too with expo run:ios.

react-native: 0.81.4 expo: 54.0.0 react-native-libsodium: ^1.4.0.

› Compiling react-native-libsodium Pods/react-native-libsodium » react-native-libsodium.cpp

❌  (node_modules/react-native-libsodium/cpp/react-native-libsodium.cpp:2:10)

  1 | #include "react-native-libsodium.h"
> 2 | #include <sodium.h> // libsodium
    |          ^ 'sodium.h' file not found
  3 | #include <sstream>
  4 | #include <string>
  5 | #include <utility>

Tonisg91 avatar Sep 12 '25 12:09 Tonisg91

Thanks for raising this! I'm also running into the same 16 KB page size issue with libsodium.so. Really appreciate the work on this library. Do you have any plans or suggestions on how to get it updated for the upcoming Play Store requirements? By the way, @jwtong I'm successfully using 1.3.1 with Expo 53 on both iOS and Android.

landabaso avatar Sep 19 '25 18:09 landabaso

I am halfway through making it compatible with 16KB page size support and Expo 54/RN 0.81. libsodium 1.0.20-stable has fixes for 16KB support. Though, there are some problems I am currently facing with libsodium build script:

  • iOS build gets stuck when building for watchOS simulators (Need to know if specific flags are required)
  • Signature verification fails for 1.0.20-stable tarball (Probably some issue on libsodium's side)

Android build does work, but due to iOS it is somewhat of a blocker. I haven't yet fixed the Folly issue which is easily fixable with some changes in the podspec.

I've noticed some open PRs that appear to have pending response. Is this library still actively maintained?

prathameshmm02 avatar Sep 20 '25 08:09 prathameshmm02

Raised a PR with the fixes: https://github.com/serenity-kit/react-native-libsodium/pull/82

In the meantime, I’ve also published a fork to npm, which can be used as:

"@more-tech/react-native-libsodium": "^1.5.5"

prathameshmm02 avatar Sep 21 '25 18:09 prathameshmm02

I'd advise against using the npm package above. It's better to apply the changes from the PR in your node_modules using patch-package and compile the .tgz binary yourself. You're putting trust in that package, and I'd wait until the official release from @nikgraf is published (still recommended to compile it yourself).

landabaso avatar Sep 25 '25 10:09 landabaso

FWIW, the binaries were created by the build script of the original repo. You can check the other changes here. Yeah I do agree with you on that @landabaso, you shouldn't trust the strangers on the internet.

prathameshmm02 avatar Sep 25 '25 12:09 prathameshmm02

FWIW, the binaries were created by the build script of the original repo. You can check the other changes here. Yeah I do agree with you on that @landabaso, you shouldn't trust the strangers on the internet.

Yeah. Thanks for the PR. Still, I'd personally wait for the official package (and/or use patch-package with your changes), which has a solid track record over the years. BTW, I added a few comments to #82.

landabaso avatar Sep 25 '25 13:09 landabaso

any update on this?

coderof19clc7 avatar Oct 13 '25 02:10 coderof19clc7

@nikgraf

dansecan25 avatar Oct 15 '25 16:10 dansecan25

@nikgraf

tgreco avatar Oct 17 '25 18:10 tgreco

on it, trying to get the iOS build working before publishing a new version

nikgraf avatar Nov 01 '25 22:11 nikgraf

just released 1.5.0

closing the issues, but in case this continues to be an issue feel free to ping ma and will re-open it

nikgraf avatar Nov 16 '25 18:11 nikgraf