Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid RNScreens.podspec file: undefined method `install_modules_dependencies' for module Pod. #2297

Closed
Sushmitha-BS25 opened this issue Aug 12, 2024 · 18 comments
Labels
Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snack or repo is provided

Comments

@Sushmitha-BS25
Copy link

Sushmitha-BS25 commented Aug 12, 2024

Description

Getting below error during pod installation:

[!] Invalid Podfile file:
[!] Invalid RNScreens.podspec file: undefined method `install_modules_dependencies' for module Pod.

from /Users/mac/mobileApp/node_modules/react-native-screens/RNScreens.podspec:25

-------------------------------------------

install_modules_dependencies(s)

if new_arch_enabled

-------------------------------------------

.

from /Users/mac/mobileApp/ios/Podfile:9

-------------------------------------------

target 'mobileApp' do

config = use_native_modules!

-------------------------------------------

Steps to reproduce

Below is the package.json file
{
"name": "mobileApp",
"version": "0.0.1",
"private": true,
"scripts": {
"postinstall": "patch-package",
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"@ptomasroos/react-native-multi-slider": "^2.2.2",
"@react-native-community/checkbox": "^0.5.17",
"@react-native-community/clipboard": "^1.5.1",
"@react-native-community/netinfo": "^11.3.1",
"@react-navigation/bottom-tabs": "^6.5.19",
"@react-navigation/drawer": "^6.6.15",
"@react-navigation/native": "^6.1.16",
"@react-navigation/native-stack": "^6.9.25",
"@shopify/flash-list": "^1.7.0",
"@turf/helpers": "^7.0.0",
"@twotalltotems/react-native-otp-input": "^1.3.11",
"axios": "^1.7.2",
"lodash": "^4.17.21",
"mappls-map-react-native": "^1.0.8",
"moment": "^2.30.1",
"patch-package": "^8.0.0",
"qs": "^6.12.3",
"react": "18.1.0",
"react-native": "0.70.0",
"react-native-actions-sheet": "0.9.6",
"react-native-blob-util": "^0.19.9",
"react-native-check-box": "^2.1.7",
"react-native-date-picker": "^4.4.2",
"react-native-dropdown-picker": "^5.4.6",
"react-native-elements": "^3.4.3",
"react-native-fast-image": "^8.6.3",
"react-native-gesture-handler": "^2.16.0",
"react-native-htmlview": "^0.17.0",
"react-native-image-picker": "^7.1.2",
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native-keychain": "^8.2.0",
"react-native-linear-gradient": "^2.8.3",
"react-native-localization": "^2.3.2",
"react-native-maps": "^1.15.4",
"react-native-pager-view": "^6.3.3",
"react-native-paper": "^5.12.3",
"react-native-popup-dialog": "^0.18.3",
"react-native-reanimated": "^2.14.1",
"react-native-safe-area-context": "^4.9.0",
"react-native-screens": "^3.30.0",
"react-native-snap-carousel": "^3.9.1",
"react-native-splash-screen": "^3.3.0",
"react-native-star-rating-widget": "^1.7.3",
"react-native-svg": "12.1.0",
"react-native-tab-view": "^3.5.2",
"react-native-vector-icons": "^10.1.0",
"react-native-webview": "^13.10.5",
"react-redux": "^7.2.0",
"redux": "^4.0.5",
"redux-devtools-extension": "^2.13.9",
"redux-logger": "^3.0.6",
"redux-persist": "5.6.12",
"redux-persist-filesystem-storage": "^3.0.0",
"redux-thunk": "^2.4.2",
"rn-fetch-blob": "^0.12.0",
"validate.js": "^0.13.1"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/runtime": "^7.12.5",
"@react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "^7.32.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.72.1",
"react-test-renderer": "18.1.0"
},
"jest": {
"preset": "react-native"
}
}

The same dependancies in another application with react native version 0.74.5, works fine. But upgrading the react native version is not possible at this point. Need to figure out what is the issue

Snack or a link to a repository

https://github.com/Sushmitha-BS25/RNScreens-issue

Screens version

3.30.0

React Native version

0.70.0

Platforms

iOS

JavaScript runtime

None

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

Debug mode

Device

None

Device model

No response

Acknowledgements

Yes

@github-actions github-actions bot added Platform: iOS This issue is specific to iOS Missing repro This issue need minimum repro scenario Missing info The user didn't precise the problem enough Repro provided A reproduction with a snack or repo is provided and removed Missing info The user didn't precise the problem enough Missing repro This issue need minimum repro scenario labels Aug 12, 2024
@shivam-kakkar
Copy link

I'm facing the exact same issue. Have you found any solution yet?

@waohwaohwaoh
Copy link

Maybe someone has found a solution?

@DudaMatiasS
Copy link

same issue here

1 similar comment
@kumarnallagoni
Copy link

same issue here

@kumarnallagoni
Copy link

i have fixed this issue
node_modules/react-native-screens/RNScreens.podspec file commented

install_modules_dependencies(s) -- line no 25

@minhphamba-ct
Copy link

minhphamba-ct commented Aug 12, 2024

I attempted to run your source code by following these steps:

Used the react-native-screens library version 3.29.0
Executed yarn install to install project dependencies
Navigated to the iOS directory and removed the Podfile.lock file:

cd ios && rm Podfile.lock

Ran bundle install to install required Ruby gems
Executed pod install to install CocoaPods dependencies

@shivam-kakkar
Copy link

I fixed the issue by strictly using react-native-screens v3.25.0

@Sushmithabs-25
Copy link

I fixed the issue by strictly using react-native-screens v3.25.0

Thank you. This works

@DudaMatiasS
Copy link

i removed (^) from "react-native-screens": "^3.29.0" and worked

@Sushmithabs-25
Copy link

What is the RCA of this issue?

@kei95
Copy link

kei95 commented Aug 14, 2024

What is the RCA of this issue?

install_modules_dependencies is only available from RN 0.71+. If your RN version is older than that you'd get this error. Thus, whoever with this issue you could either;

  1. Update RN to > 0.71+
  2. Downgrade the version of this package to compatible one

@ricardopetrere
Copy link

Suggestion to the devs

Why don't you set in "peerDependencies" the supported react-native version of each release? It would be faster and more pratical than us always having to come back here to check "is my project compatible with this new release?" or one of our colleagues updating the package to fix an issue in one OS, only to find out it doesn't work in another (based on a true story. My project is in react-native 0.69)

@kkafar
Copy link
Member

kkafar commented Aug 30, 2024

@ricardopetrere there are few reasons why we won't go for setting peerDependencies, but the main and deciding one is: there are different sets of supported react-native versions depending on react-native architecture the application is using, thus single "minimum supported react-native version" does simply not exist. However, we do acknowledge the problem of you (library user) having to check with every upgrade for changes in supported RN versions. Most likely we will go in direction of having clear & strict policy of what versions of RN are supported (e.g. three/four most recent ones), but we still need to discuss this internally.

I'm closing the issue, as it arises from mismatch between the library version & react-native version.

For everyone encountering this error: please refer to the readme for the list of supported react-native versions for given react-native-screens library version.

@kkafar kkafar closed this as completed Aug 30, 2024
@doneill
Copy link

doneill commented Sep 4, 2024

Update RN to > 0.71+
Downgrade the version of this package to compatible one

@kkafar

I am getting this error with v3.22.0 to address #1787, that version is compatable with RN < 0.71-, any insights for downgraded versions of the lib?

@estani
Copy link

estani commented Sep 12, 2024

The dependency matrix shows what version you need. Sadly, this is not encoded in the dependency:

"peerDependencies": {
    "react": "*",
    "react-native": "*"
  },

So npm has no way of knowing this limitations... so you have to manually fix them...

@alex-mironov
Copy link

alex-mironov commented Nov 18, 2024

I'm still getting the same error:

Something went wrong running `pod install` in the `ios` directory.
Command `pod install` failed.
└─ Cause: Invalid `Podfile` file:
[!] Invalid `RNScreens.podspec` file: undefined method `project_header_files=' for #<Pod::Specification name="RNScreens">.

 #  from /Users/username/projects/../node_modules/react-native-screens/RNScreens.podspec:22
 #  -------------------------------------------
 #    s.source_files = source_files
 >    s.project_header_files = "cpp/**/*.h" # Don't expose C++ headers publicly to allow importing framework into Swift files
 #    s.requires_arc = true
 #  -------------------------------------------
.

 #  from /Users/username/projects/../ios/Podfile:40
 #  -------------------------------------------
 #  # @generated end react-native-maps
 >    config = use_native_modules!(config_command)
 #
 #  -------------------------------------------

pod install --repo-update --ansi exited with non-zero code: 1

I would appreciate any help with fixing it

    "react-native": "0.76.2",
    "expo": "^52.0.7",

@zubyrbutt
Copy link

zubyrbutt commented Nov 29, 2024

How i fix this issue:

I was facing same issue.
system: macbook pro m1 2021
react native : 0.69.12
react native screen: 3.3.0

Even when i downgrade the version and compatible with react native but there issue still remain.

first check the compatible version

  1. delete the node_module
  2. delete yarn.lock/package.lock file
  3. delete the pod.lock
  4. delete the pod folder (not pod file)
  5. yarn install
  6. cd ios && pod install
  7. Done

@fabiancarlos
Copy link

I fixed the issue by strictly using react-native-screens v3.25.0

works on React Native "0.70.15"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snack or repo is provided
Projects
None yet
Development

No branches or pull requests