Cli: Auto-detecting RN module pods sometimes breaks pod install (scoped packages)

Created on 8 Sep 2019  路  3Comments  路  Source: react-native-community/cli

Environment

System:
    OS: macOS 10.14.6
    CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
    Memory: 10.32 GB / 32.00 GB
    Shell: 3.0.0 - /usr/local/bin/fish
  Binaries:
    Node: 10.15.3 - ~/.nvm/versions/node/v10.15.3/bin/node
    Yarn: 1.16.0 - ~/.nvm/versions/node/v10.15.3/bin/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v10.15.3/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
  IDEs:
    Android Studio: 3.4 AI-183.6156.11.34.5522156
    Xcode: 10.3/10G8 - /usr/bin/xcodebuild
  npmPackages:
    @react-native-community/cli: ^2.9.0 => 2.9.0
    react: 16.8.6 => 16.8.6
    react-native: 0.60.4 => 0.60.4

Description

After installing some scoped NPM packages (e.g. @vforvasile/react-native-photos-framework), pod install fails every time.

Example output:

> pod install
Detected React Native module pods for @vforvasile/react-native-photos-framework, BVLinearGradient, RNCAsyncStorage, RNDeviceInfo, RNFS, RNFastImage, RNGestureHandler, RNReactNativeHapticFeedback, RNReanimated, RNSVG, RNScreens, RNSecureKeyStore, RNSharedElement, RNSketchCanvas, RNTextDetector, RNThumbnail, RNVectorIcons, ReactNativePermissions, react-native-cameraroll, react-native-image-picker, react-native-photo-manipulator, react-native-video, react-native-view-shot, and rn-fetch-blob
Analyzing dependencies
Fetching podspec for `@vforvasile` from `../node_modules/@vforvasile/react-native-photos-framework`
[!] No podspec found for `@vforvasile` in `../node_modules/@vforvasile/react-native-photos-framework`

This is likely the error:

[!] No podspec found for @vforvasile in ../node_modules/@vforvasile/react-native-photos-framework

The podspec for react-native-photos-framework does exist, but it does not exist in the @vforvasile directory within node_modules. It's in node_modules/@vforvasile/react-native-photos-framework.

I've only run into this issue when using forks of a handful of different libraries.

If there was a way to say "skip auto-linking for this package", then that would make this easier to work around, but I can't seem to find a way of doing that.

Reproducible Demo

I think this will reproduce it:

  1. react-native init test-app
  2. yarn add @vforvasile/react-native-photos-framework
  3. cd ios
  4. pod install
bug

Most helpful comment

The name of the package needs to be valid pod name, ideally the same as the podspec file.

Please change this line to just react-native-photos-framework.

All 3 comments

The name of the package needs to be valid pod name, ideally the same as the podspec file.

Please change this line to just react-native-photos-framework.

馃殌 鉂わ笍@thymikee you are my life saver. 猸愶笍 馃専 after almost one day struggling, I've found your comment and found the tiny beast hidden inside .podspec file.
You are very true that name inside .podspec file MUST be same as the package name BUT without organization scope, otherwise auto linking of react-native will become a nightmare.

Was this page helpful?
0 / 5 - 0 ratings