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
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
.
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
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.
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
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.
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
.