react-native-purchases icon indicating copy to clipboard operation
react-native-purchases copied to clipboard

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

Open wengqianshan opened this issue 1 year ago • 0 comments

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: [email protected]
    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: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react-native
npm ERR!   peer react-native@"*" from @react-native-tvos/[email protected]
npm ERR!   node_modules/@react-native-tvos/virtualized-lists
npm ERR!     @react-native-tvos/virtualized-lists@"0.73.6-0" from [email protected]
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: [email protected]
npm ERR! node_modules/react-native
npm ERR!   peer react-native@">= 0.58.2" from [email protected]
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"

wengqianshan avatar Mar 15 '24 18:03 wengqianshan