react-native-async-storage / async-storage

An asynchronous, persistent, key-value storage system for React Native.
https://react-native-async-storage.github.io/async-storage/
MIT License
4.61k stars 458 forks source link

fix(android): bridgeless mode broken on react-native 0.74 #1068

Closed Kudo closed 4 months ago

Kudo commented 4 months ago

Summary

This PR tries to fix the [@RNC/AsyncStorage]: NativeModule: AsyncStorage is null error when running on react-native@0.74.0-rc.1. The regression was coming from https://github.com/facebook/react-native/pull/41412 and https://github.com/facebook/react-native/issues/43213 has more discussion. This PR follows the create-react-native-library template to rely on BuildConfig

Test Plan

$ npx @react-native-community/cli@latest init RN074 --version next
$ cd RN074
$ yarn add @react-native-async-storage/async-storage
# edit App.tsx for using async-storage
$ cd android
$ ./gradlew -PnewArchEnabled=true :app:installDebug
$ ./gradlew -PnewArchEnabled=true -PAsyncStorage_useNextStorage=true :app:installDebug
AsyncStorageBot commented 4 months ago

:tada: This PR is included in version 1.22.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

krizzu commented 4 months ago

Thanks @Kudo 🙏

Kudo commented 4 months ago

thank you folks for merging and releasing the fix quickly.