Skip to content

Commit 58e97c6

Browse files
committed
fix: expo plugin sodium not working on SDK 55+
Expo SDK 55 removed ENV['RCT_NEW_ARCH_ENABLED'] from the Podfile template since New Architecture is now mandatory (RN 0.83+). The withSodiumIos plugin was using that line as a regex anchor to insert ENV['SODIUM_ENABLED'], so the replacement silently matched nothing. Instead of anchoring to any specific Podfile line, prepend the ENV assignment to the top of the file. This works regardless of Podfile template changes across Expo SDK versions. Fixes #957
1 parent 750767b commit 58e97c6

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

packages/react-native-quick-crypto/src/expo-plugin/withSodiumIos.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,8 @@ export const withSodiumIos: ConfigPlugin<ConfigProps> = config => {
1414
);
1515
let contents = fs.readFileSync(podfilePath, 'utf-8');
1616

17-
// Check if SODIUM_ENABLED is already set
1817
if (!contents.includes("ENV['SODIUM_ENABLED']")) {
19-
// Add it right after the RCT_NEW_ARCH_ENABLED ENV variable
20-
contents = contents.replace(
21-
/^(ENV\['RCT_NEW_ARCH_ENABLED'\].*$)/m,
22-
`$1\nENV['SODIUM_ENABLED'] = '1'`,
23-
);
18+
contents = `ENV['SODIUM_ENABLED'] = '1'\n${contents}`;
2419
fs.writeFileSync(podfilePath, contents);
2520
}
2621

0 commit comments

Comments
 (0)