Reputation: 71
I am new to React Native so bear with me but does anyone know how to resolve this error? For some reason when I run my app on an older simulator it does not give me the error (image attached) but when I run it on a newer simulator it does. Thanks for the help!
Upvotes: 6
Views: 2603
Reputation: 11
Try this method, for me it worked for react-native 0.77
linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
end
# Add these lines in your Podfile
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
Upvotes: 1
Reputation: 228
You need to reintall the dependencies. Just follow the given steps:
Step I:
npm install @react-navigation/native @react-navigation/native-stack
Step II:
npm install react-native-screens react-native-safe-area-context
Step III:
cd ios && pod install && cd ..
Thanks to the MultiClick article that helped me to fix my issue.
Upvotes: 0
Reputation: 21
This error was resolved for me when I followed the following steps:
npm install react-native-safe-area-context
Then rebuild the app: for ios:
cd ios
pod install
cd ..
npx react-native run-ios
Restart Metro clearing the cache:
npx react-native start --reset-cache
Upvotes: 2
Reputation: 11
I was having the same issue. Installing react-native-safe-area-context worked for me.
npm i react-native-safe-area-context
Upvotes: 1
Reputation: 1
Stop the metro server and run pod install in the iOS folder
cd ios && pod install
Upvotes: 0
Reputation: 29
Try wrapping your component in a SafeAreaProvider tag
import { SafeAreaProvider } from 'react-native-safe-area-context';
export default App = () => {
return (
<SafeAreaProvider>
<MainNavigation />
</SafeAreaProvider>
);
}
Upvotes: 0
Reputation: 894
Not a long term fix but for me downgrading to these versions, fixed the issue for me.
Upvotes: 0