software-mansion / react-native-screens

Native navigation primitives for your React Native app.
MIT License
3.01k stars 510 forks source link

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

Closed Sushmitha-BS25 closed 1 week ago

Sushmitha-BS25 commented 1 month ago

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

shivam-kakkar commented 1 month ago

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

waohwaohwaoh commented 1 month ago

Maybe someone has found a solution?

DudaMatiasS commented 1 month ago

same issue here

kumarnallagoni commented 1 month ago

same issue here

kumarnallagoni commented 1 month ago

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

install_modules_dependencies(s) -- line no 25

minhphamba-ct commented 1 month ago

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 commented 1 month ago

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

Sushmithabs-25 commented 1 month ago

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

Thank you. This works

DudaMatiasS commented 1 month ago

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

Sushmithabs-25 commented 4 weeks ago

What is the RCA of this issue?

kei95 commented 4 weeks ago

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 commented 3 weeks ago

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 commented 1 week ago

@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.

doneill commented 1 week ago

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 commented 10 hours ago

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...