React-native - iOS - Module name prefixes error with RCTJSCExecutor - ios

I'm getting an error in one project in react-native (I've tried init'ing new projects and it's not happening in those). The build succeeds, the simulator loads, the default loading screen shows briefly, then I get the red screen of frustration with the following error:
Unhandled JS Exception: Invariant Violation: Module name prefixes should've been stripped by the native side but wasn't for RCTJSCExecutor.
I've tried the solutions here: https://github.com/facebook/react-native/issues/10585
No luck.
I've deleted/reinstalled node_modules - No luck.
Cleared xcode cache in ~/library/developer/xcode/deriveddata. No luck.
Cleard /var/folders. No luck.
I've run react-native upgrade. No luck.
Other members on the team aren't experiencing this, and we have the same codebase.
Versions:
OSX: 10.11.6
Xcode: 8.2.1
Node: 7.6.0
Npm: 4.1.2
React-Native: 0.33.1
React-Native-CLI: 2.0.1

stop terminal, and re-run react-native run-ios

Related

'Flutter/Flutter.h' file not found

Hello Folks,
When I try to run my project either in xcode or in Android studio in iOS 16.1 device then it says like "error: 'Flutter/Flutter.h' file not found" and "error: failed to emit precompiled header ios/Runner/Runner-Bridging-Header.h".
Following are my current details:
MacOS: 13.0.1 Ventura
Flutter: 3.3.8
Dart: 2.18.4
Android Studion Chipmunk
If anyone have any valid solution to this issue which actually works then it will be very helpful.
Thanks.
I did try following solutions:
https://stackoverflow.com/questions/64973346/error-flutter-flutter-h-file-not-found-when-flutter-run-on-ios
Tried deleting ios flutter and regenerate it.
Tried Flutter clean, pub get, cd ios, pod install, pod update but nothing worked.

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

react-native run-ios fails - Could not find simulator

I am using
react-native-cli: 2.0.1
react-native: 0.55.3
Xcode : 10.2.1
I am trying to get a certain react-native project to build and run for the first time from my system using react-native run-ios.
I get :
Found Xcode workspace App.xcworkspace
Could not find iPhone 6 simulator
I looked for the different answers here but they didn't help me solve my problem (I changed the condition in node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js)
What's the meaning of this error ?
How to get the project to build and run ?
Thanks
Yaron
This happened to me after updating to the latest Xcode.
I went to the Download simulators, chose the newest one, and after it got downloaded and installed, I got back the devices you see in the screenshot

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.

How to fix ionic 2 Apple Mach-O Linker error?

I'm building an ionic 2 app, and I can build the app with ionic build ios and I get no erros, but on xcode when I build my application I get the following error.
Apple Mach-O Linker (id) Error
Linker command failed with exit code 1 (use -v to see invocation).
How can I fix this?
Here is my system information
Cordova CLI: 6.5.0
Ionic Framework Version: 2.3.0
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.1.4
ios-deploy version: 1.9.0
OS: macOS Sierra
Node Version: v6.9.4
Xcode Version: Xcode 8.3 Build version 8E162
You are probably opening the .xcodeproj on Xcode, try opening the .xcworkspace. This fixed this error for me.
Had the same issue, spent almost a day trying to figure out what was causing it. For me the following solved it. Everything was working fine on ios#4.3.1, but on 4.5.3, I got this annoying error.
Check if this plugin "cordova-plugin-console" is there in the plugins folder. If it is there, remove it. Then it started building without any errors.
ionic cordova plugin remove cordova-plugin-console
Look for a file named libPods-AppName.a in Frameworks directory
where AppName is your app name.
Deleting it fixes it in most cases.
Take a look at the screenshot for reference.
Quick Fix
Disclaimer: My project uses Ionic v1
I had the same error and, once I had added a Android-only plugin, I thought that it was the cause of the error - I was wrong (so, ignore this cause if you think the same as I).
After some search I found the truly cause of the error: the cordova-ios version (4.5). I followed the steps suggested here and I solve this issue.
Steps:
ionic cordova platform remove ios
ionic cordova platform add ios#4.4.0
ionic cordova platform
Last step is used to check if ios#4.4.0 is actually the installed version.
Hope it helps.
In your platforms folder for ios, there are both .xcodeproj and .xcworkspace files. Open the /platforms/ios/.xcworkspace.
I found the issue that was causing this error.
On the config.xml file on the tag I had the email with my#email.com and you cannot have the .com on the email. I removed and it works fine now.
Thanks for the help

Resources