In Android AsyncStorage works fine for me, I have tried in an iOS emulator and it is returning this error:

I've tried all the instructions in the error message, and I've looked for the same error and can't find the solution.
First I linked RNCAsyncStorage, but now I get unlinked.
I have in Podfile RNCAsyncStorage like this
pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-community/async-storage'
Remove pod 'RNCAsyncStorage' entry from Podfile, run pod install again and reinstall the app (react-native run-ios). Async Storage is linked automatically, so you don't have to include it manually
Remove
pod 'RNCAsyncStorage'entry from Podfile, runpod installagain and reinstall the app (react-native run-ios).Async Storageis linked automatically, so you don't have to include it manually
I have followed the following steps:
I have deleted RNCAsyncStorage from podfile as you told me
I have added yarn add @ react-native-community / async-storage in case it had been necessary
I have run inside the ios folder pod install
I have used react-native start --reset-cache -force
Finally I started normally with react-native run-ios
I have also opened the project with xcode with the command xed ios and I have executed on the play button
Result: same error
Can you think of anything else? Do you need me to provide more information?
Hi, I have the same problem and followed the same steps, using:
I am also using use_flipper for pod install.
Let me know if you have a solution.
@picknamexd Can you provide your Podfile ? It seems like it's missing use_native_modules script. Do you use any other Native Modules?
In case it could be useful, mine is like this.
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
require_relative '../node_modules/react-native/scripts/react_native_pods'
platform :ios, '10.0'
target 'myCompany' do
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
target 'myCompanyTests' do
inherit! :complete
# Pods for testing
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
use_flipper!
post_install do |installer|
flipper_post_install(installer)
end
end
target 'myCompany-tvOS' do
# Pods for myCompany-tvOS
target 'myCompany-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
@pichon-e what about starting clean (remove Pods and Podfile.lock) and re-running pod install ? The Podfile looks fine to me
I succed fixing my error.
I had upgraded my react-native version manualy because of error during npx react-native upgrade. Probably why I have this error.
Not sure if it can be helpful but I created a new repository with npx react-native init command and compared it to my actual project. I fixed some mistakes but it was not the cause but may be useful.
After that, my problem wasn't solved and removing the build folder in ios folder and relaunching it, fixed it.
Of course don't forget to:
rm -rf node_modulesrm -rf ios/Podsrm ios/Podfile.locknpm inpx pod-installThanks for your help @Krizzu
@Krizzu @pichon-e I have solved my problem, and it has been a mistake of mine that has caused me a lot of headaches, but I will explain it in case someone could help them at some point.
when executing react-native start and it is later in another terminal react-native run-ios I got an error in the second terminal, but I manually opened the application and the first terminal with start started and seemed to run it, the problem is that I wasn't doing it.
I've had to go commit by commit running the application without the run-ios command error, seeing where the bug was, and I discovered that I was missing a font file.
After making the necessary changes I followed these steps:
Start the application with react-native start and react-native run-ios (crashing the application)
Opening Xcode with the xed ios command
Running from Xcode (app crashing)
Changing the settings to Legacy and Running the application, it works!
I hope it can be of use to someone.
And thank you both very much for your help!
Glad you got it sorted!
Most helpful comment
For future, this tools is super useful when doing RN upgrades