react-native-purchases: tvOS projects based on expo cannot install react-native-purchases

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.

  1. Environment
    1. Platform:tvOS
    2. SDK version: 7.24.0
    3. OS version: 17.4
    4. Xcode/Android Studio version: Xcode 15.3
    5. React Native version: react-native-tvos@0.73.6-0
    6. SDK installation (CocoaPods + version or manual): expo
    7. How widespread is the issue. Percentage of devices affected. Must appear
  2. Debug logs that reproduce the issue
  3. 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.

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

Commits related to this issue

Most upvoted comments

Thank you! I have installed version 7.26.0 and it runs perfectly. It’s amazing!

@vegaro It works fine, thank you so much! image