'React/RCTMockDef.h' file not found - ios

I'm receiving the following error when trying to run my React Native app for iOS on Xcode: "'React/RCTMockDef.h' file not found". I'm on React Native v0.67.2 and I've already tried doing cd ios and pod install. Can anyone help? Thanks

Related

ERROR Error: [#RNC/AsyncStorage]: NativeModule: AsyncStorage is null

I am creating a React Native iOS app, NOT using Expo. I installed AsyncStorage #react-native-async-storage/async-storage and am using it in my app as illustrated in the code below.
The problem is that I am getting the below error message. I have tried to fix the problem by taking the following steps, however the error persists. Can anyone advise how to fix the error?
My code:
import AsyncStorage from '#react-native-async-storage/async-storage'
const authenticate = (token) => {
setAuthToken(token)
AsyncStorage.setItem('token', token)
}
Steps I've taken to resolve error (all unsuccessful):
quit the terminal and simulator, then rebuilt and restarted app
ran npm start --reset-cache
navigated to ios directory and ran pod install
The error message:
ERROR Error: [#RNC/AsyncStorage]: NativeModule: AsyncStorage is null.
To fix this issue try these steps:
• Rebuild and restart the app.
• Run the packager with `--reset-cache` flag.
• If you are using CocoaPods on iOS, run `pod install` in the `ios` directory and then rebuild and re-run the app.
• If this happens while testing with Jest, check out docs how to integrate AsyncStorage with it: https://react-native-async-storage.github.io/async-storage/docs/advanced/jest
This error usually occurs when the library was not linked correctly or if auto-linking is not working. Try linking the library manually as explained here.
react-native link #react-native-async-storage/async-storage

Build fails when archiving React Native App in Xcode

My build fails when attempting to archive my react native project in Xcode. The following appears when trying to archive:
Does anyone know what may be causing this error? I have tried editing the run script in 'Bundle React Native code and images' to the below as suggested by the link https://github.com/facebook/react-native/issues/3935:
. ~/.nvm/nvm.sh
../node_modules/react-native/scripts/react-native-xcode.sh
However, I'm still getting the same error. Can someone please advise? I'm really stuck here.
Thanks.

React Native archiving error - /ios/index.js. not found

I'm trying to archive an iOS react native app with Xcode but it give me these errors:
error The resource /Users/andreacolombo/Desktop/projectName/ios/index.js was not found..
'error: File /Users/MyUser/Library/Developer/Xcode/DerivedData/projectName-bxaxxwslkvjsrgcpsonpisxutuei/Build/Intermediates.noindex/ArchiveIntermediates/projectName/BuildProductsPath/Release-iphoneos/appName.app/main.jsbundle does not exist. This must be a bug with'
My react native version is: 0.59.10.
If i build and run it in release configuration, it give me the same errors
With an other mac it works so it is not a code problem..
I'm going crazy...
What could be?
Thanks!

Native module cannot be null. | React Native

I'm trying to run on the iOS simulator but keep receiving this error:
Native module cannot be null.
Image of error:
Did you do in ios directory the Podfile installation ?
cd ios
pod install

React-Native app can build for debugging but not for archiving

I'm trying to archive my iOS app which works fine when I build for debugging via xcode but when I try to archive the app I get the following errors which I'm not sure what's causing it
I think the real reason for failure would be a little above in the listing, which cannot be seen here.
I had similar kind of issue when updated react native to version 0.54.2 the iOS archive stopped working.
My error message was something like:
A problem occurred while trying to fetch the minifier. Path: "metro-minify-uglify" Cannot find module 'uglify-es'
And the problem was that my react native project only had uglify-js in node-modules (I quess that the new react native needed the uglify-es). So I installed that with:
npm install uglify-es --save
And after that I did (not sure if these are needed) xCode->clean project, shutdown xCode, delete Library->Developer->Xcode->DerivedData, restart Xcode and archive started working again.

Resources