FBReactNativeSpec.h error after upgrading from 0.68.x to 0.69.0

Viewed 862

I just upgraded from RN 0.68.x to 0.69.0 using the react-native upgrade command.Its shows an error about
FBReactNativeSpec 'value' is unavailable : introduced in ios 12.0 react native and same error shown when i create a new project with latest version.

xcode:12.4 macVersion:10.15.7

enter image description here

enter image description here

2 Answers

I think this is caused by some pods in your react-native project that are not the latest version and as a result some of may have IPHONEOS_DEPLOYMENT_TARGET less than 12.0

In my case I did the following steps

  • In VS Code i did a search for IPHONEOS_DEPLOYMENT_TARGET i could see that in the ios/Pods/Pods.xcodeproj/project.pbxproj file a few pods had target version less then 12.0 I updated them to 12.4 (This step i feel can be sorted by updating your packages to the latest and re-run pod install/update but I had some packages that the latest update did not change it for me)
  • Under XCode top menu, Goto XCode->Preferences -> Locations -> Open Derived Data folder(By clicking the arrow button)
  • Finder will open Derived Data folder
  • Delete Derived Data Folder
  • Start Metro server using npm start or yarn start
  • In Xcode, perform Clean build using cmd+shift+k
  • In Xcode, run the application using cmd+r

In iOS Folder go to Pods/Pods.xcodeproj/xcuserdata/project.pbxproj

Change all the 'IPHONEOS_DEPLOYMENT_TARGET = 11.0' to 'IPHONEOS_DEPLOYMENT_TARGET = 12.4'. save and run.

Note: every time you pod install it will change so again you have to do it. If there is better approach please do mention.

Related