React Native - CocoaPods could not find compatible versions for pod "FBReactNativeSpec" - react-native

The react native version has been updated from 0.61.5 to 0.65.0.
After pod install I receive an error stating,
[!] CocoaPods could not find compatible versions for pod "FBReactNativeSpec":
In Podfile:
FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`)
Specs satisfying the `FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`)` dependency were found, but they required a higher minimum deployment target.
The path for FBReactNativeSpec in Podfile is,
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/React/FBReactNativeSpec"
I cannot figure out how to resolve this.

try updating the platform version in your podfile.
platform :ios, '11.0' => change 11 to 15.
This worked for me

This could be an error with dependency, you may need to install react-native-codegen library like:
If you're using yarn packager:
yarn add --dev react-native-codegen
If you're using npm packager:
npm install react-native-codegen --force
And it will add the library in package.json
"dependencies": {
"react-native-codegen": "^0.0.7"
}
Check this link out for more info.
Also, I'll recommend you to follow React Native Upgrade Helper document for Package.json and Podfile changes.

Related

React Native: Pod install leads to different versions in podfile.lock than package.json

I just did a clean clone of my repo, did npm install and then pod install in the ios/ directory. This leads to a change in my Podfile.lock, which seemed to have upgraded a couple of modules to a newer version than what is specified in the package.json for that corresponding module, for example:
Podfile.lock:
- - react-native-webview (8.1.0):
+ - react-native-webview (8.2.1):
package.json:
"react-native-webview": "^8.1.0",
I would like to understand why this happens and whether this is a problem. I would avoid this but I can't do npm run ios, because it says that there are version issues and I have to run pod install.
When i get deep issues with Podfile/package.json, i do something like that:
Delete ./node_modules;
Delete package-lock.json and Podfile.lock;
Set a fixed version to component: "^8.1.0" -> "8.1.0" [w/o ^];
Do the npm install then pod install.

After unlink all packages it again following modules are linked manually while react-native upgrade

I have updated react-native version to latest.
So I have unlink all manually linked packages. But If i run react-native run-ios after pod install it shows the list of packages again to unlink.
error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually
When pod install it shows the below error
[!] CocoaPods could not find compatible versions for pod "react-native-webview":
In Podfile:
react-native-webview (from `../node_modules/react-native-webview`)
Specs satisfying the `react-native-webview (from `../node_modules/react-native-webview`)` dependency were found, but they required a higher minimum deployment target.
I have changed the platform ios to 9.0 in podfile. It worked for me

Could not find the following native modules after upgrading the react-native to latest version 0.61.4

After upgrading the react-native version I am getting the following. And failed to run the build in simulator
After this, I have run react-native run-ios it shows all my packages are manually linked and you need to unlink all packages.
Also, can anyone clarify the react-native-config.js file is mandatory for this after updating to the latest react-native.
Always I open the app.Xcodeproj but the below shows I need to open app.xcworkspace. Can anyone clarify this?
warn The following packages use deprecated "rnpm" config that will stop working from next release:
- react-native-fetch-blob: https://github.com/wkh237/react-native-fetch-blob#readme
- react-native-orientation: https://github.com/yamill/react-native-orientation#readme
- rn-fetch-blob: https://github.com/joltup/rn-fetch-blob#readme
Please notify their maintainers about it. You can find more details at https://github.com/react-native-community/cli/blob/master/docs/configuration.md#migration-guide.
error Could not find the following native modules: BugsnagReactNative, react-native-camera, react-native-cookies, react-native-fast-image, react-native-fetch-blob, RNFS, RNGestureHandler, RNImageCropPicker, react-native-image-picker, RNImageRotate, BVLinearGradient, react-native-orientation, RNShare, RNSVG, RNVectorIcons, RNViewShot, react-native-webview, rn-fetch-blob. Did you forget to run "pod install" ?
info Found Xcode workspace "Fashion.xcworkspace"
This should fix your issue.
rm -rf ios/Pods && rm -rf ios/build && cd ios && pod install && cd ../
rm -rf node_modules && rm yarn.lock && yarn install
PS: In react-native version 0.60 and above, native modules are now auto-linked. See the docs for more: https://facebook.github.io/react-native/blog/2019/07/03/version-60#native-modules-are-now-autolinked
firstly, when you update the react-native version, you should react-native official document. to avoid some wrong things. the details for update in the react-native update helper.
and for your question, since 0.60, CocoaPods are now part of React Native's iOS project. If you weren't already, be sure to open iOS platform code using the xcworkspace file from now on.
At the same time, a react-native link is now not needed in most situations anymore. the react-native team overhauled the linking process in general. Be sure to react-native unlink any preexisting dependencies as mentioned in the docs above.for more details, you can read this article.
for the rnpm problem, firstly you should delete it in the package.json.
then create a react-native.config.js file in project folder.
const ios = require('#react-native-community/cli-platform-ios');
const android = require('#react-native-community/cli-platform-android');
module.exports = {
project: {
ios: {},
android: {},
},
// assets: ['Resources/fonts'], // stays the same
// commands: require('./path-to-commands.js'),
};
then in the rn-fetch-blob(make is as an example), you also create
react-native.config.js and modify it according to its rnpm config
In the latest react-native stable version, you dont need to link the 3rd party libraries, just install it and it will work fine
Firstly,
So, when you are migrating from lower version to higher stable version,
then what you need to do, just unlink all the libraries you have used
in your project as react-native automatically detects its
dependencies. and moreover remember that whenever you install such
libaries you don't need to run the react-native link <library-name>
to link it.
Secondly,
Now you need to work with xcworkspace file as in the latest version,
ios are dealing with pods, and when pods comes into picture then you
have to use xcworkspace instead of Xcodeproj in your ios project
You can check the changelog here for react native 0.61.4 version.
I hope this helps....Thanks :)
My solution is to combine some tips above and update mine Pod file
Simply reset:
rm -rf ios/Pods && rm -rf ios/build
cd ios && pod install && cd ..
rm -rf node_modules && rm yarn.lock && yarn install
Reason is to maximize future compatibility.
Here is a facebook provided template, pick some goodies for your existing old pod file:
https://github.com/facebook/react-native/blob/0.63-stable/template/ios/Podfile
You may found code below is auto linking,
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
You may need to upgrade ios target
platform :ios, '10.0'
You may use Flipper without use_frameworks! enabled
Could be that there is something in your podfile that causes this. For example, I removed a library from my project but there was still a reference to it in the podfile:
pod 'react-native-onesignal', :path => '../node_modules/react-native-onesignal'
Once commenting/removing this line, pod install works great.
For me just converting npm install to yarn install worked because other team was using yarn and i was trying to install packages using npm so it created some conflict.
I recloned the project then
'yarn install', 'react-native link' and then
'pod install'

ios pod install returns "No podspec found for `FBSDKCoreKit"

I have a RN app which works on Windows. I pulled down the code to my Mac and I'm trying to run the code on my Mac. When I run pod install on my project's ios directory, the following error is output to the Terminal:
No podspec found for FBSDKCoreKit
Here is the full Terminal output:
My-MacBook-Pro:ios myname$ pod install Detected React Native module
pods for RNCAsyncStorage, RNFirebase, RNGestureHandler, RNReanimated,
RNVectorIcons, react-native-fbsdk, and react-native-safe-area-context
Analyzing dependencies Fetching podspec for DoubleConversion from
../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec
[!] No podspec found for FBSDKCoreKit in
../node_modules/react-native/Libraries/FBSDKCoreKit
What is the most likely root cause of this error and what troubleshooting steps would you recommend?
1) Make sure the path is there
../node_modules/react-native/Libraries/FBSDKCoreKit
2) Run a pod repo update and a pod install
If still not working I would try an unlink followed by a cleanup of any old links related to that library in project.pbxproj then link the library again.
Note: in some cases a pod deintegrate && pod install helped me with link errors like this.

Attempted to register RCTBridgeModule class LRNAnimationViewManager for the name 'LottieAnimationView', but name was already registered by

I am trying to run 'lottie' for React Native however after successful XCODE build, I get an error:
Attempted to register RCTBridgeModule class LRNAnimationViewManager for the name 'LottieAnimationView', but name was already registered by...
Similar issue:
Attempted to register RCTBridgeModule class RCTFileReaderModule.
Uninstalling, unlinking and reinstalling, relinking does not seem to work. Installed the correct version of 'lottie-ios', 'lottie-react-native' associated with >RN 0.58 on:
https://github.com/react-native-community/lottie-react-native/blob/master/README.md#getting-started.
Also tried adding "Lottie.framework" in the 'embedded framework' tab of XCODE. I am trying to set up the animation screens using this package.
Any leads/suggestions welcomed and thanks in advance!
The versions of lottie-ios and lottie-react-native matter depending on the react-native version you have on your package.json.
For React Native == 0.59.x (which is used by Expo sdk 35 and 36):
Install lottie-react-native (3.0.2) and lottie-ios (3.0.3):
yarn add lottie-react-native#3.0.2
yarn add lottie-ios#3.0.3
or
npm i --save lottie-react-native#3.0.2
npm i --save lottie-ios#3.0.3
Do not use react-native link to add the library to your project, if you are using ExpoKit.
react-native link lottie-ios
react-native link lottie-react-native
Note:
Go to your ios folder and run:
pod install
If you get the error:
[!] CocoaPods could not find compatible versions for pod "lottie-ios":
In snapshot (Podfile.lock):
lottie-ios
In Podfile:
ExpoKit/Core (from `http://github.com/expo/expo.git`, tag `ios/2.13.0`) was resolved to 35.0.0, which depends on
lottie-ios (~> 2.5.0)
lottie-ios (from `../node_modules/lottie-ios`)
You would better remove the pod lottie-ios and pod lottie-react-native from your Podfile, because ExpoKit will have the dependencies sorted out when you run pod install.