Repository navigation
Closed
Labels
Description
Environment
System:
OS: macOS Mojave 10.14.6
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 37.18 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.10.0 - /var/folders/05/dbq77cwj3c5cl2r9c0qkh6h80000gn/T/yarn--1571277638840-0.6997444993602164/node
Yarn: 1.17.3 - /var/folders/05/dbq77cwj3c5cl2r9c0qkh6h80000gn/T/yarn--1571277638840-0.6997444993602164/yarn
npm: 6.11.3 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.0, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0
Android SDK:
API Levels: 28, 29
Build Tools: 27.0.3, 28.0.3, 29.0.0
System Images: android-28 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 3.4 AI-183.6156.11.34.5522156
Xcode: 11.0/11A420a - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.1 => 0.61.1
Description
We use react-native-unimodules, which require us to add a use_unimodules! to our Podfile, and our Podfile.lock then has entries like this:
EXTERNAL SOURCES:
appcenter:
:path: "../node_modules/appcenter/ios"
appcenter-analytics:
:path: "../node_modules/appcenter-analytics/ios"
appcenter-crashes:
:path: "../node_modules/appcenter-crashes/ios"
BVLinearGradient:
:path: "../node_modules/react-native-linear-gradient"
CodePush:
:path: "../node_modules/react-native-code-push"
DoubleConversion:
:podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
EXAppLoaderProvider:
:path: !ruby/object:Pathname
path: "../node_modules/expo-app-loader-provider/ios"
Running react-native run-ios then results in an error:
error unknown tag !<!ruby/object:Pathname> at line 452, column 5:
path: "../node_modules/expo-app- ...
^. Run CLI with --verbose flag for more details.
YAMLException: unknown tag !<!ruby/object:Pathname> at line 452, column 5:
path: "../node_modules/expo-app- ...
^
at generateError (/Users/osmanosman/Developer/mobile/node_modules/js-yaml/lib/js-yaml/loader.js:167:10)
at throwError (/Users/osmanosman/Developer/mobile/node_modules/js-yaml/lib/js-yaml/loader.js:173:9)
at composeNode (/Users/osmanosman/Developer/mobile/node_modules/js-yaml/lib/js-yaml/loader.js:1428:7)
at readBlockMapping (/Users/osmanosman/Developer/mobile/node_modules/js-yaml/lib/js-yaml/loader.js:1089:11)
at composeNode (/Users/osmanosman/Developer/mobile/node_modules/js-yaml/lib/js-yaml/loader.js:1359:12)
at readBlockMapping (/Users/osmanosman/Developer/mobile/node_modules/js-yaml/lib/js-yaml/loader.js:1089:11)
at composeNode (/Users/osmanosman/Developer/mobile/node_modules/js-yaml/lib/js-yaml/loader.js:1359:12)
at readBlockMapping (/Users/osmanosman/Developer/mobile/node_modules/js-yaml/lib/js-yaml/loader.js:1089:11)
at composeNode (/Users/osmanosman/Developer/mobile/node_modules/js-yaml/lib/js-yaml/loader.js:1359:12)
at readDocument (/Users/osmanosman/Developer/mobile/node_modules/js-yaml/lib/js-yaml/loader.js:1519:3)
It seems that _warnAboutPodInstall fails on checking Podfile.lock, and the entire command fails. Commenting out that line in runIOS/index.js fixes this.
Reproducible Demo
Hopefully info above is enough, let me know if not. Note that this happens on 3.0.0-alpha* but not on 2.9.0m, which doesn't have that check.
Reacted by Brandon Maushund, Mike, Hussain Sherwani, Bardiamist, 404 and Martin Richter
Activity
Maushundb commentedon Oct 17, 2019
It seems like this line is the culprit -
cli/packages/platform-ios/src/link-pods/getDependenciesFromPodfileLock.ts
Line 21 in 926dcb7
When
Podfile.lockisn't a valid YAML file,js-yamlwill throw an error on this check. In our case, it thinks:path: !ruby/object:Pathnameis referring to a yaml key reference and can't find it, thus marking it as invalid. Seeing how ya'll only use theSPEC CHECKSUMSkey for this warning, I would imagine there's a fairly simple workaround.I do not know if Cocoapods guarantees that
Podfile.lockis always a valid YAML file, so this might be a good thing to address for other cases as well.Maushundb commentedon Oct 17, 2019
Changed that file to
With a test file of
Tried to create a PR but looks like I'm getting 403 permission denied when trying to push a branch.
thymikee commentedon Oct 17, 2019
@Titozzz @orta can you advise here?
@Maushundb you need to create a fork. See the contributing guide.
grabbou commentedon Oct 17, 2019
@Maushundb, just wanted to say - great investigation here! I appreciate writing this all down including reproductions and some troubleshooting.
Maushundb commentedon Oct 17, 2019
Ah I see, yeah happy to put up a PR if yall think excluding invalid parts of the file is the right way to go about it.
orta commentedon Oct 17, 2019
Hrm yeah, the ruby yaml parser must be leaking internal state - think @Maushundb has a solid answer above
enaluz commentedon Oct 17, 2019
@Maushundb Thanks for this find! I just ran into this issue while I was trying to upgrade React Native from 0.59.1 to 0.61.2. How can I implement this fix into my project?
Maushundb commentedon Oct 17, 2019
For now I'd suggest using patch-package to implement the fix to that file (in your repo it'll be babelified, but still readable) until this is fixed and released.
enaluz commentedon Oct 18, 2019
In case this is helpful to anyone else with this same problem, the path for me to fix this issue was
node_modules/@react-native-community/cli-platform-ios/build/link-pods/getDependenciesFromPodfileLock.js(notice it's not Typescript like the file Maushundb referenced in one of the comments above). I simply replaced the final line of thegetDependenciesFromPodfileLock()which looks like this:with the solution provided above:
Not sure if this will work for most people (or anyone else), but thought I should share 😄
Maushundb commentedon Oct 18, 2019
PR at #810
martinezguillaume commentedon Oct 22, 2019
For a quick fix, you can use :
in your package.json to force the version
update lock files, blocked to run iOS by react-native-community/cli#805
hzz780 commentedon Nov 9, 2019
Thanks.
RN 0.61
This one is ok.
@react-native-community/cli-platform-ios 3.0.0-alpha.7 is not ok
I changed this manually. I am waiting the the new package.
romanonthego commentedon Nov 19, 2019
I am still experience same issue with version 3.0.0 :(
Maushundb commentedon Nov 19, 2019
Are you sure you're on the right version? If you're using RN, make sure you set your resolutions in package.json so that the CLI version gets resolved correctly: