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 con
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.
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!
Go to this repository : ProjectName -> ios -> Podfile In Podfile, delete use_native_modules! Execute again pod install And Enjoy your use
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
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.
Don't use yarn install. Thats what worked for me...
sudo npm install or just npm installcd iospod install