react-native: pod install fails: Codegen issue (IOS)

Description

i am facing error after doing pod install

i removed node_modules, yarn.lock, reset cache, podfile.lock.

even after removing all of these still facing same issue

Steps to reproduce

  1. yarn install
  2. cd ios
  3. pod install

React Native Version

0.74.1

Affected Platforms

Runtime - iOS

Output of npx react-native info

System:
  OS: macOS 14.1.1
  CPU: (10) arm64 Apple M1 Pro
  Memory: 110.41 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 21.7.1
    path: /opt/homebrew/bin/node
  Yarn:
    version: 3.6.4
    path: /usr/local/bin/yarn
  npm:
    version: 10.5.0
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2024.01.22.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - visionOS 1.0
      - watchOS 10.2
  Android SDK:
    Android NDK: 22.1.7171670
IDEs:
  Android Studio: 2023.3 AI-233.14808.21.2331.11842104
  Xcode:
    version: 15.2/15C500b
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 11.0.22
    path: /usr/bin/javac
  Ruby:
    version: 3.3.0
    path: /opt/homebrew/opt/ruby/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.74.1
    wanted: 0.74.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Stacktrace or Logs

[!] Invalid `Podfile` file: [!] /opt/homebrew/bin/node ./../node_modules/react-native/scripts/generate-codegen-artifacts.js -p /Users/myuser/Desktop/Projects/myApp/ios/.. -o /Users/myuser/Desktop/Projects/myApp/ios -t ios

[Codegen] Analyzing /Users/myuser/Desktop/Projects/myApp/package.json
[Codegen] Searching for codegen-enabled libraries in the app.
[Codegen] The "codegenConfig" field is not defined in package.json. Assuming there is nothing to generate at the app level.
[Codegen] Searching for codegen-enabled libraries in the project dependencies.
[Codegen] Found @react-native-async-storage/async-storage
[Codegen] Found @react-native-clipboard/clipboard
[Codegen] Found lottie-react-native
[Codegen] Found react-native
[Codegen] Found react-native-blob-util
[Codegen] Found react-native-bootsplash
[Codegen] Found react-native-date-picker
[Codegen] Found react-native-document-picker
[Codegen] Found react-native-gesture-handler
[Codegen] Found react-native-haptic-feedback
[Codegen] Found react-native-image-picker
[Codegen] Found react-native-localize
[Codegen] Found react-native-pager-view
[Codegen] CodegenConfig Deprecated Setup for react-native-pager-view.
    The configuration file still contains the codegen in the libraries array.
    If possible, replace it with a single object.
  
BEFORE:
    {
      // ...
      "codegenConfig": {
        "libraries": [
          {
            "name": "libName1",
            "type": "all|components|modules",
            "jsSrcsRoot": "libName1/js"
          },
          {
            "name": "libName2",
            "type": "all|components|modules",
            "jsSrcsRoot": "libName2/src"
          }
        ]
      }
    }

    AFTER:
    {
      "codegenConfig": {
        "name": "libraries",
        "type": "all",
        "jsSrcsRoot": "."
      }
    }
  
[Codegen] Found react-native-pdf
[Codegen] Found react-native-permissions
[Codegen] Found react-native-reanimated
[Codegen] Found react-native-safe-area-context
[Codegen] Found react-native-screens
[Codegen] Found react-native-share
[Codegen] Found react-native-svg
[Codegen] Found react-native-vector-icons
[Codegen] Found react-native-webview


[Codegen] >>>>> Searching for codegen-enabled libraries in react-native.config.js
[Codegen] Processing rnasyncstorage
[Codegen] Searching for podspec in the project dependencies.
[Codegen] Supported Apple platforms: ios, macos, tvos, visionos for rnasyncstorage
[Codegen] Processing rnclipboard
[Codegen] Searching for podspec in the project dependencies.
[Codegen] Supported Apple platforms: ios, macos, tvos, visionos for rnclipboard
[Codegen] Processing lottiereactnative
[Codegen] Searching for podspec in the project dependencies.
[Codegen] Supported Apple platforms: ios, macos, tvos for lottiereactnative
[Codegen] Processing FBReactNativeSpec
[Codegen] Searching for podspec in the project dependencies.
[Codegen] Processing rncore
[Codegen] Searching for podspec in the project dependencies.
[Codegen] Processing ReactNativeBlobUtilSpec
[Codegen] Searching for podspec in the project dependencies.
[Codegen] Supported Apple platforms: ios for ReactNativeBlobUtilSpec
[Codegen] Processing RNBootSplashSpec
[Codegen] Searching for podspec in the project dependencies.
[Codegen] Supported Apple platforms: ios, tvos for RNBootSplashSpec
[Codegen] Processing RNDatePickerSpecs
[Codegen] Searching for podspec in the project dependencies.
[Codegen] Supported Apple platforms: ios for RNDatePickerSpecs
[Codegen] Processing rndocumentpicker
[Codegen] Searching for podspec in the project dependencies.
[Codegen] Supported Apple platforms: ios for rndocumentpicker
[Codegen] Processing rngesturehandler_codegen
[Codegen] Searching for podspec in the project dependencies.
[Codegen] Supported Apple platforms: ios, macos, tvos, visionos for rngesturehandler_codegen
[Codegen] Processing RNHapticFeedbackSpec
[Codegen] Searching for podspec in the project dependencies.
[Codegen] Supported Apple platforms: ios for RNHapticFeedbackSpec
[Codegen] Processing RNImagePickerSpec
[Codegen] Searching for podspec in the project dependencies.
[Codegen] Supported Apple platforms: ios for RNImagePickerSpec
[Codegen] Processing RNLocalizeSpec
[Codegen] Searching for podspec in the project dependencies.
[Codegen] Supported Apple platforms: ios, macos, tvos, visionos for RNLocalizeSpec
[Codegen] Processing RNCViewPager
[Codegen] Searching for podspec in the project dependencies.
[Codegen] Supported Apple platforms: ios, visionos for RNCViewPager
[Codegen] Processing LEGACY_RNCViewPager
[Codegen] Searching for podspec in the project dependencies.
[Codegen] Supported Apple platforms: ios, visionos for LEGACY_RNCViewPager
[Codegen] Processing rnpdf
[Codegen] Searching for podspec in the project dependencies.
[Codegen] Supported Apple platforms: ios, tvos for rnpdf
[Codegen] Processing RNPermissionsSpec
[Codegen] Searching for podspec in the project dependencies.
[Codegen] Supported Apple platforms: ios, tvos for RNPermissionsSpec
[Codegen] Processing rnreanimated
[Codegen] Searching for podspec in the project dependencies.
[Codegen] Supported Apple platforms: ios, macos, tvos, visionos for rnreanimated
[Codegen] Processing safeareacontext
[Codegen] Searching for podspec in the project dependencies.
[Codegen] Supported Apple platforms: ios, tvos, visionos for safeareacontext
[Codegen] Processing rnscreens
[Codegen] Searching for podspec in the project dependencies.
[Codegen] Supported Apple platforms: ios, tvos, visionos for rnscreens
[Codegen] Processing RNShareSpec
[Codegen] Searching for podspec in the project dependencies.
[Codegen] Supported Apple platforms: ios for RNShareSpec
[Codegen] Processing rnsvg
[Codegen] Searching for podspec in the project dependencies.
[Codegen] Supported Apple platforms: ios, macos, tvos, visionos for rnsvg
[Codegen] Processing RNVectorIconsSpec
[Codegen] Searching for podspec in the project dependencies.
[Codegen] Supported Apple platforms: ios, tvos, visionos for RNVectorIconsSpec
[Codegen] Processing RNCWebViewSpec
[Codegen] Searching for podspec in the project dependencies.
[Codegen] Supported Apple platforms: ios, macos, visionos for RNCWebViewSpec
[Codegen] Generating Native Code for ios
[Codegen] Generated artifacts: /Users/myuser/Desktop/Projects/myApp/ios/build/generated/ios
[Codegen] Generating Native Code for ios
[Codegen] Generated artifacts: /Users/myuser/Desktop/Projects/myApp/ios/build/generated/ios
[Codegen] Generating Native Code for ios
[Codegen] Generated artifacts: /Users/myuser/Desktop/Projects/myApp/ios/build/generated/ios
[Codegen] Generating Native Code for ios
[Codegen] Generated artifacts: /Users/myuser/Desktop/Projects/myApp/ios/build/generated/ios
[Codegen] Generating Native Code for ios
[Codegen] Generated artifacts: /Users/myuser/Desktop/Projects/myApp/node_modules/react-native/ReactCommon
[Codegen] Generating Native Code for ios
[Codegen] Generated artifacts: /Users/myuser/Desktop/Projects/myApp/ios/build/generated/ios
[Codegen] Generating Native Code for ios
[Codegen] Generated artifacts: /Users/myuser/Desktop/Projects/myApp/ios/build/generated/ios
[Codegen] Generating Native Code for ios
[Codegen] Generated artifacts: /Users/myuser/Desktop/Projects/myApp/ios/build/generated/ios
[Codegen] Generating Native Code for ios
[Codegen] Generated artifacts: /Users/myuser/Desktop/Projects/myApp/ios/build/generated/ios
[Codegen] Generating Native Code for ios
[Codegen] Generated artifacts: /Users/myuser/Desktop/Projects/myApp/ios/build/generated/ios
[Codegen] Generating Native Code for ios
[Codegen] Done.
Error: Union types are unsupported in structs
    at StructCollector.process (/Users/myuser/Desktop/Projects/myApp/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleObjCpp/StructCollector.js:195:15)
    at getParamObjCType (/Users/myuser/Desktop/Projects/myApp/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleObjCpp/serializeMethod.js:261:23)
    at /Users/myuser/Desktop/Projects/myApp/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleObjCpp/serializeMethod.js:117:31
    at Array.forEach (<anonymous>)
    at serializeMethod (/Users/myuser/Desktop/Projects/myApp/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleObjCpp/serializeMethod.js:115:10)
    at serializeProperty (/Users/myuser/Desktop/Projects/myApp/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleObjCpp/index.js:118:14)
    at Array.forEach (<anonymous>)
    at generate (/Users/myuser/Desktop/Projects/myApp/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleObjCpp/index.js:133:10)
    at Object.generate (/Users/myuser/Desktop/Projects/myApp/node_modules/@react-native/codegen/lib/generators/RNCodegen.js:212:9)
    at Object.generateSpecFromInMemorySchema (/Users/myuser/Desktop/Projects/myApp/node_modules/react-native/scripts/codegen/generate-specs-cli-executor.js:78:22)
.

 #  from /Users/myuser/Desktop/Projects/myApp/ios/Podfile:63
 #  -------------------------------------------
 #    $RNFirebaseAsStaticFramework = true
 >    use_react_native!(
 #      :path => config[:reactNativePath],
 #  -------------------------------------------

[!] [Codegen] warn: using experimental new codegen integration

Reproducer

https://github.com/Ammarlio/reproduce

Screenshots and Videos

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (1 by maintainers)

Most upvoted comments

⚠️ Newer Version of React Native is Available!
ℹ️ You are on a supported minor version, but it looks like there’s a newer patch available - 0.74.4. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

Updating

Please were you able have it fixed

Update react-native-haptic-feedback to 2.3.1-next.0, and watch the library for any further updates.

@Ammarlio Downgrading the package also works, that is a work around for me. for now I have version 2.2.0 for react-native-haptic-feedback

⚠️ Newer Version of React Native is Available!
ℹ️ You are on a supported minor version, but it looks like there’s a newer patch available - undefined. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

No, not at the moment.