I have a react-native project with these dependencies (all are the latest available):
"#react-native-firebase/analytics": "^14.5.1",
"#react-native-firebase/app": "^14.5.1",
"#react-native-firebase/config": "^0.1.5",
"#react-native-firebase/perf": "^14.5.1",
But when I go to pod install, I get:
[!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly":
In Podfile:
RNFBApp (from `../node_modules/#react-native-firebase/app`) was resolved to 14.5.1, which depends on
Firebase/CoreOnly (= 8.12.1)
RNFBConfig (from `../node_modules/#react-native-firebase/config`) was resolved to 0.1.5, which depends on
Firebase/RemoteConfig (~> 6.5.0) was resolved to 6.5.0, which depends on
Firebase/CoreOnly (= 6.5.0)
I do not understand why config has a different version to all the others and how the latest versions of a project are conflicting.
I have tried the following to fix this:
rm -rf ios/Pods ios/Podfile.lock
pod repo remove trunk
pod install
pod update
pod install --repo-update
My ios/Podfile does not contain explicit pods for Firebase.
Usually these commands tend to fix problems like this. But not this time. Thanks for any suggestions.
react-native-firebase maintainer here!
The 'config' package was wrapping the firebase "Remote Config" SDK packages, so that name was not used in the final release of react-native-firebase - we used "remote-config" in the end, but the alpha releases with the wrong name were still up on npmjs.com.
I just deprecated all versions of that package on npmjs.com so users should get a warning if they try to install it - no one should use that package. If you use the 'remote-config' one, you'll be all set I think
The problem is that #react-native-firebase/config appears unrelated to the #react-native-firebase project, hence the different latest version and pod conflicts. I had to use #react-native-firebase/remote-config instead, as found in the documentation https://github.com/invertase/react-native-firebase
The problem is that react native update a new architecture
Open the file Podfile and add use_frameworks! :linkage => :static inside your targets
Disable the :flipper_configuration line
Put $RNFirebaseAsStaticFramework = true
at the top of podfile
Then run
pod install --repo-update
For Mac M1
arch -x86_64 pod install --repo-update
Hope this useful to someone
I solved the issue by deleting the ./ios/Podfile.lock and run again pod install --repo-update command.
Charts suggested us to install them with cocoapods without specifying release tag:
pod 'Charts'
and this is means that we are working with the master / trunk branch, right?
So what is about potential risks of the inability of the existing Application with the last changes in Charts? How can I add Charts with specifying the concrete version?
P.S. specifying tag neither
pod 'Charts', '4.0.1'
nor
pod 'Charts', :git => 'https://github.com/danielgindi/Charts.git', :tag => '4.0.1'
doesn't help, and brings us the error:
% pod update
...
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "Charts":
In Podfile:
Charts (= 4.0.1)
None of your spec sources contain a spec satisfying the dependency: `Charts (= 4.0.1)`.
You have either:
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
Looking in GitHub, it appears that their tags have a "v" at the front of the version number. I would change your versioned attempt to be:
pod 'Charts', :git => 'https://github.com/danielgindi/Charts.git', :tag => 'v4.0.1'
Note I've changed 4.0.1 to v4.0.1 to match the tag name on GitHub.
With help of Scott Thompson, I've found that
pod 'Charts', '3.6.0'
is worked and there are no error at build time! So, I think this is the right solution.
I've taken several steps to resolve this issue, including deleting node_modules, deleting pod.lock, ran yarn cache clean, ran npx react-native-clean-project, ran pod install --repo-update ... but nothing so far has worked. This is for an Expo bare workflow project.
[!] CocoaPods could not find compatible versions for pod "ReactCommon/callinvoker":
In Podfile:
ReactCommon/callinvoker (from `../node_modules/react-native/ReactCommon`)
None of your spec sources contain a spec satisfying the dependency: `ReactCommon/callinvoker (from `../node_modules/react-native/ReactCommon`)`.
You have either:
* out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
open podfile in ios folder
and replace
pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"
pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
to
pod 'React-callinvoker', :path => "../node_modules/react-native/ReactCommon/callinvoker"
pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
I downgraded from react-native 0.63.3 to react-native 0.62.2, and that solved my cocoa pods issue.
To downgrade react-native use either of the following commands depending on your package manager.
npm install react-native#x.x.x or yarn add react-native#x.x.x
For more information on how to downgrade react-native check out the link below and hopefully it helps!
Proper mechanism to downgrade react-native
open podfile in ios folder
and replace
pod 'React-callinvoker', :path => "#{rnPrefix}/ReactCommon"
to
pod 'React-callinvoker', :path => "#{rnPrefix}/ReactCommon/callinvoker"
In my react-native project (react-native#0.60) in the ios/ dir I run pod install and get this error:
[!] Invalid `Podfile` file: no implicit conversion of nil into String.
# from /Users/coryrobinson/projects/hhs2/ios/Podfile:37
# -------------------------------------------
#
> use_native_modules!
# end
# -------------------------------------------
I haven't added or changed anything in this Podfile - it's all react-native generated. (I'm not experienced in iOS dev so this might be a simple fix, I just don't know what to look for :-|) Thanks for any help!
Here is my Podfile
platform :ios, '9.0'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
target 'hhs2' do
# Pods for hhs2
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/React'
pod 'React-DevSupport', :path => '../node_modules/react-native/React'
pod 'React-fishhook', :path => '../node_modules/react-native/Libraries/fishhook'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'
pod 'RNFS', :path => '../node_modules/react-native-fs'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
target 'hhs2Tests' do
inherit! :search_paths
# Pods for testing
end
use_native_modules!
end
target 'hhs2-tvOS' do
# Pods for hhs2-tvOS
target 'hhs2-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
Here is the correct answer:
1 - Your POD File should contain this line on top
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
2 - Make sure your package.json and node_module folders has this module installed
cli-platform-ios/native_modules
3 - If you didn't find after you run yarn install - means you have old cache node_modules in your machine and you need to clean it before reinstalling the package again.
4 - Clean cache yarn cache clean
5 - Make sure you have this file react-native.config.js and its configuration is VALID - and it doesn't have non-existing NPM packages - this step is LAST AND MOSTLY THE CAUSE of the error
Example of my react-native.config.js
module.exports = {
project: {
ios: {},
android: {},
},
assets: ['./assets/fonts/'],
dependencies: {}, // make sure this dependencies are all valid installed packages or empty if you don't need it
};
6 - Install node packages yarn install and your pods should work now! pod install --repo-update
HAPPY coding!
Downgraded #react-native-community/cli-platform-ios from 3.1.0 to 3.0.0 and it worked.
Added
"#react-native-community/cli-platform-ios": "3.0.0"
to package.json.
Run npm install and then pod install to get it working again.
If you are using
pod install --project-directory=ios
you might need to tweak the Podfile by replacing
use_native_modules!
to
use_native_modules!(".")
Maybe this behavior will be improved in the future, I opened an issue about it https://github.com/react-native-community/cli/issues/657
this is because the outdate yarn version on your device,
if you on macOS you can upgrade/install the yarn with follow this link:
here it is
be aware to delete node-module and yarn.lock file, install all packages again, navigate to ios folder and run pod install.
Verify if you have #react-native-community/cli-platform-ios in your package.json,
if you dont run:
npm install #react-native-community/cli-platform-ios
then
cd ios && pod install
i just dropped the whole node_modules and RN cache folder and did a clean reinstall, this fixed the "use_native_modules" problem so far....but after that i had to hassle a lot with other libs which where just not RN0.60 ready ;)
For me, I deleted the node_modules and installed again by using npm install . After that, I navigated to /ios folder and ran pod install it worked.
Ok, my guess is for most people, the accepted answer will fix their issue. For me, the fix was so bizarre, I had to add it here.
For whatever reason, I ended up creating an invalid AndroidManifest.xml file in my android native setup.
I looked at the full error output, and the first lines of the error referenced a line number and column number. At that point in my xml file I broke the xml formatting.
2 days of searching to find a GitHub Issue with a description of where to look.
Don't use yarn install. Thats what worked for me...
Go to main folder
Delete nodes folder
Run sudo npm install or just npm install
cd ios
pod install
Having same issue while building app on AppCenter, locally works perfectly
Is there any possibility to track this error? Cause I've seen that there can be a lof of reasons why I see it.
Steps to follow :
npm install
npm install -g react-native-cli
go to your ios folder -> cd ios
pod install
Easily:
Run sudo xcode-select --switch /Applications/Xcode.app in the root of your React Native project.
In the ios folder run pod install.
Edit:
No hacks with any of:
#react-native-community/cli-platform-ios
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
were needed.
After removing several react-native npm packages (ie: react-native-bluetooth-serial, react-native-sound, and more...) pod install works.
It appears the pod install error is related to older react-native packages that don't support cocoa pods? I'm not sure the details but removing those packages from node_modules & package.json solved my issue.
The issue is that:
use_native_modules!
is unsupported by earlier versions of CocoaPods. For example, our install was the app downloaded from the CocaoPods website. That version is 1.5.2.
Run:
pod --version
to check which version. If need be, uninstall and then re-install but in Terminal by running:
sudo gem install cocoapods
At least as of late October 2019, the current gem version available is 1.8.4. Once successfully installed, re-attempt the pod install and hopefully all is well.
I got this error after I tried to react-native run-ios an Expo app. The error I got indicated that something was wrong with the Pods, so I ran cd ios && pod install, which is how I got a similar error as the OP.
In that case, you obviously need to expo start instead of react-native run-ios.
This started happening out of the blue today, and the problem was a space in my directory structure. Ex:
/path/to/Directory\ Name/RNProject throws the !native_modules error
/path/to/DirectoryName/RNProject works as it should
Pods was looking for "Directory. "
maybe its related to rights issues
adding "#react-native-community/cli-platform-ios": "3.0.0" in package.json
and
sudo chown -R user .
worked for me
In my case I had to switch to a newer version of node.
One of the reasons may be outdated version of Ruby. Use following command to upgrade it.
rvm install 2.6.1
rvm use 2.6.1 --default
Or you can follow below article, which has a detailed explanation of upgrading ruby and associated gems.
https://help.learn.co/en/articles/2789231-how-to-upgrade-from-ruby-2-3-to-2-6
Does anyone have a consistently recreatable solution for this issue that does not revolve around getting rid of use_native_modules? I have looked into:
Changing Ruby Version
Changing CocoaPods version
Invalidating NPM and Cocoapods cache
And I am unable to fix the issue. It appears to be some npm dependency, but others on my team are not seeing it.
Getting rid of the line use_native_modules! works as well. Maybe this has been deprecated or syntax has changed? Curious to hear from others.
Update: Seems to be an issue with react-native 0.60.0. Until a release fixes this bug, 0.59.10 can be explicitly installed, and you only need to add CocoaPods as necessary.
react-native init APP_NAME --version react-native#0.59.10
Go to this repository :ProjectName -> ios -> Podfile
In the Podfile, delete use_native_modules!
Execute again pod install
Enjoy your new pod
I'm trying to install Firebase via CocoaPods for my Objective-C iOS Application. My Podfile is as follows:
target 'RandomName' do
pod 'Firebase/Core'
pod 'Firebase/AdMob'
end
When I run pod install, I get the following error:
[!] Unable to satisfy the following requirements:
- `Firebase/Core` required by `Podfile`
None of your spec sources contain a spec satisfying the dependency: `Firebase/Core`.
You have either:
* out-of-date source repos which you can update with `pod repo update`.
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.
The latest version of CocoaPods is installed, and I have tried running pod repo update. Having a Podfile of the following works fine, but when I try to #import Firebase; in my AppDelegate.m file, Xcode cannot find the module.
target 'RandomName' do
pod 'Firebase'
end
However, the following combination does not install:
target 'RandomName' do
pod 'Firebase'
pod 'Firebase/AdMob'
end
Any help would be appreciated!
Check what version of Firebase is installed when you use pod 'Firebase'. For me it installs 2.4.3 which is an old version. The docs say that the pod should install 3.2 using that pod. It explains why the other pods don't work as they are part of Firebase 3. Pod update doesn't update Firebase to the latest version either. Even forcing a version doesn't work. It can't seem to find the new Firebase versions even though they are in the same podspec.
Here is how I solved it:
make sure you have the latest version of git installed
make sure you have cocoapods >= 1.0.0 installed
delete your pods repo (run pod repo remove master) and use pod setup to make a new one
use the following in your pod file
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Core'
(use whatever you want, just don't use 'Firebase')
pod install
everything should install properly
Running 'pod repo remove master' to remove the Pods repo //removes the library
Running 'pod setup' //clones the updated git repo for specs which takes long time as its size is beyond 300K (Be patient!)
Running 'pod install' //problem is solved
have you tried to add
frameworks
use_frameworks!
after target 'RandomName' line
and adding
platform :ios, '9.0'
before target ....
A couple of items to try. From your question, you did try the first two items, but leaving here for completeness of my answer.
The error response you get is helpful. Follow the steps for pod repo update
Make sure your pod is up to date.
pwd> pod --version
1.0.0
Make certain that your git is up to date. I had a build machine that had an outdated git (1.7), and I had the same exact error
-
When I updated to this version from git 1.7 it worked fine.
pwd> git --version
git version 2.8.1
My Podfile for using Firebase Dynamic Links
run pod init from the folder where your .xcodeproj is
Be sure to only launch the .xcworkspace instead of the .xcodeproj from here out.
platform :ios, '8.0'
use_frameworks!
target 'the-name-of-target' do
pod 'Firebase/DynamicLinks'
end
The Same problem occurred while on pod install command.
Please relaunch terminal and navigate to your Xcode project then
simply fire same pod install command. 'Firebase/Database' will installed successfully :)
I just doing following step to fix this error:
$pod setup -- verbose
Then do $pod install
that works for me and my pod file is:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target 'the-name-of-target' do
pod 'Eureka', '~> 1.6'
end
UPDATE:
Then you can remove your master and re-install cocoapods using following code:
cd ~/.cocoapods/repos
rm -rf master
pod setup
I had the same error, and my solution was to downgrade Cocoapods to 1.0.0, because Cocoapods 1.0.1 didn't work as I expected. Everything works great now!
sudo gem uninstall cocoapods -v 1.0.1
sudo gem install cocoapods -v 1.0.0
My Podfile:
platform :ios, '8.0'
target 'XXX' do
pod 'Firebase/Auth'
pod 'Firebase/Database'
end
For people still having problems with this. When directly coping the firebase walkthourgh website, the install string is:
pod `Firebase/Core`
While it should have been:
pod 'Firebase/Core'
No need for pod setup if this applies to you too.
Update Git and Cocoapods to the last version:
Git: $ brew update && brew upgrade
Cocoapods: $ pod repo update