Skip to content

Invalid Podfile Error - dependency with no podspec #506

@RyanThomas73

Description

@RyanThomas73

Environment

System:
OS: macOS 10.14.4
CPU: (8) x64 Intel(R) Core(TM) i7-3740QM CPU @ 2.70GHz
Memory: 391.61 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.13.0 - /var/folders/st/dpvzyxq913s2mxv8dzb_fcv979pvgz/T/yarn--1562612651190-0.6482734780758797/node
Yarn: 1.15.2 - /var/folders/st/dpvzyxq913s2mxv8dzb_fcv979pvgz/T/yarn--1562612651190-0.6482734780758797/yarn
npm: 6.7.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
Android SDK:
API Levels: 19, 21, 22, 23, 24, 25, 26
Build Tools: 23.0.1, 25.0.2, 25.0.3, 26.0.3
System Images: android-19 | ARM EABI v7a, android-19 | Intel x86 Atom, android-21 | Android TV ARM EABI v7a, android-21 | Android TV Intel x86 Atom, android-21 | Android Wear ARM EABI v7a, android-21 | Android Wear Intel x86 Atom, android-21 | ARM EABI v7a, android-21 | Intel x86 Atom, android-21 | Intel x86 Atom_64, android-21 | Google APIs ARM EABI v7a, android-21 | Google APIs Intel x86 Atom, android-21 | Google APIs Intel x86 Atom_64, android-22 | Android TV ARM EABI v7a, android-22 | Android TV Intel x86 Atom, android-22 | ARM EABI v7a, android-22 | Intel x86 Atom, android-22 | Intel x86 Atom_64, android-22 | Google APIs ARM EABI v7a, android-22 | Google APIs Intel x86 Atom, android-22 | Google APIs Intel x86 Atom_64, android-23 | Android TV ARM EABI v7a, android-23 | Android TV Intel x86 Atom, android-23 | Android Wear Intel x86 Atom, android-23 | Intel x86 Atom, android-23 | Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom, android-25 | Android TV Intel x86 Atom, android-25 | Google APIs ARM 64 v8a, android-25 | Google APIs ARM EABI v7a, android-25 | Google APIs Intel x86 Atom, android-25 | Google APIs Intel x86 Atom_64
IDEs:
Android Studio: 1.1.0 AI-135.1740770
Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.0 => 0.60.0
npmGlobalPackages:
react-native-cli: 2.0.1

Description

The use_native_modules! function defined in https://github.com/react-native-community/cli/blob/master/packages/platform-ios/native_modules.rb loads the list of react-native dependencies using the react-native config command. While iterating over these dependencies it does not null check the podspecPath value for null/nil to confirm a podspec is present.

The function attempts to load the pod spec using the null podspecPath value resulting in the pod install command outputting the following error message.

[!] Invalid 'Podfile' file: no implicit conversion of nil into String.

Reproducible Demo

  1. Configure a new react-native project using react-native version 0.60.0.
  2. Install a dependency into node_modules that the react-native config command will return in which the ios platform's podspecPath value is returned as null. (e.g. react-native-text-input-mask)
  3. Run the pod install command in the ios/ directory.

Expected Output: The command does not attempt to link the dependency since it does not have a .podspec.

Actual Output: The command errors with the described error message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions