react-native-purchases: tvOS projects based on expo cannot install react-native-purchases
- I have updated Purchases SDK to the latest version
- I have read the Contribution Guidelines
- I have searched the Community
- I have read docs.revenuecat.com
- I have searched for existing Github issues
Describe the bug A clear and concise description of what the bug is. The more detail you can provide the faster our team will be able to triage and resolve the issue. Do not remove any of the steps from the template below. If a step is not applicable to your issue, please leave that step empty.
- Environment
- Platform:tvOS
- SDK version: 7.24.0
- OS version: 17.4
- Xcode/Android Studio version: Xcode 15.3
- React Native version: react-native-tvos@0.73.6-0
- SDK installation (CocoaPods + version or manual): expo
- How widespread is the issue. Percentage of devices affected. Must appear
- Debug logs that reproduce the issue
- Steps to reproduce, with a description of expected vs. actual behavior
a. Create a tvOS project https://github.com/expo/examples/tree/master/with-tv
b. Install react-native-purchases
npx expo install react-native-purchases
An error occurs at this time:
$ npx expo install react-native-purchases
› Installing 1 other package using npm
> npm install --save react-native-purchases
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: wktv@2.0.0
npm ERR! Found: react-native@0.73.6-0
npm ERR! node_modules/react-native
npm ERR! peer react-native@"*" from @react-native-tvos/virtualized-lists@0.73.6-0
npm ERR! node_modules/@react-native-tvos/virtualized-lists
npm ERR! @react-native-tvos/virtualized-lists@"0.73.6-0" from react-native@0.73.6-0
npm ERR! react-native@"npm:react-native-tvos@^0.73.6-0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! react-native-purchases@"*" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react-native@0.73.6
npm ERR! node_modules/react-native
npm ERR! peer react-native@">= 0.58.2" from react-native-purchases@7.24.0
npm ERR! node_modules/react-native-purchases
npm ERR! react-native-purchases@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
...
c. Force installation
npx expo install react-native-purchases -- --force
Report an error again
Invariant Violation: `new NativeEventEmitter()` requires a non-null argument., js engine: hermes
At this time, the native module of react-native-purchases cannot be found in the ios/Podfile.lock file
d. Try to use yarn install, but the error in step c is still displayed.
- Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)
Additional context
Also try to install react-native-iap in the same way, it can run normally, and you can find something similar to the following in the ios/Podfile.lock file
RNIap:
:path: "../node_modules/react-native-iap"
About this issue
- Original URL
- State: closed
- Created 4 months ago
- Comments: 17 (8 by maintainers)
Thank you! I have installed version 7.26.0 and it runs perfectly. It’s amazing!
@vegaro It works fine, thank you so much!