'Error when archiving IOS app in react native with error : ld: library not found for -lFBReactNativeSpec

I cannot build my IOS app. the error says

Showing Recent Errors Only Library not found for -lFBReactNativeSpec

After investigation, i found that the new version react-native "react-native": "^0.64.0" move the react FBReactNativeSpec folder from ../node_modules/react-native/libraries/FBReactNativeSpec" to ../node_modules/react-native/React/FBReactNativeSpec"

i have checked the build settings header paths, check the react-native pod script file, and the file FBReactNativeSpec is included

the strange thing is that the application is running normally in debug version and not when trying to product/archive for test flight



Solution 1:[1]

I got the same problem, when updating an app that had been generated for IOS 13, when updating to IOS 14 the XCode informed that the minimum for the build should be version 12, and it was for 9.0, trying to generate the build in version 9 and 10, these lib not found errors will occur, when accepting the minimum for version 12 the build was generated without errors.

Solution 2:[2]

The "library not found" errors occur most of the time because installing the react-native node package and running "pod install" is often not enough. The error should go away after running a clean build in xcode using the xcworkspace file. After that, running "npm run ios" or "npm start" in the termal should work again.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Gustavo Costa
Solution 2 Noah Kanyo