react-native-jw-media-player
react-native-jw-media-player copied to clipboard
[iOS] RNJWPlayer is not getting installed on pod install
i Created a new RN project ran the android worked fine, but when i wanted to run ios i did cd ios and then ran pod install, pod installed all packages except RNJWPlayer (0.2.24), thats why the app was not working and giving this error:
ERROR: Invariant Violation: requireNativeComponent: "RNJWPlayerView" was not found in the UIManager.
This error is located at: in RNJWPlayerView (at react-native-jw-media-player/index.js:489) in JWPlayer (at App.js:89) in RCTView (at View.js:32) in View (at App.js:78) in App (at renderApplication.js:50) in RCTView (at View.js:32) in View (at AppContainer.js:92) in RCTView (at View.js:32) in View (at AppContainer.js:119) in AppContainer (at renderApplication.js:43) in StarterAppLatest(RootComponent) (at renderApplication.js:60)
Same here on RN 0.69.4, did you fix it??
Hi, I had the same issue with RN 0.70.1, and I fixed it moving the podspec file in the module root (outside ios folder). Once moved there, just modify the path to the package:
-package = JSON.parse(File.read('../package.json'))
+package = JSON.parse(File.read('./package.json'))
Could anyone place this little fix in the main repo?
Well... now pod gets installed, but the error is similar:
ERROR Invariant Violation: requireNativeComponent: "RNJWPlayerView" was not found in the UIManager.
This error is located at:
in RNJWPlayerView (at react-native-jw-media-player/index.js:489)
I can't make it work in iOS, although the Pod is now installed. I have tried different approuches, but no success...
Nobody has test this module in RN >= 0.69?
@danimarin i had also applied multiple approaches but was only able to run it on reactnative 0.68.1 or below, don't know whats the issue but on 0.68.1 and below it works completely fine.
I have the same issue here, started occurring when I upgraded react native from 0.68.x
to 0.69.x
Temporary Fix
Moving the podspec file up one directory out of the ios folder and then updating the paths to the source files and assets fixed it for me. I'm using patch-package
to apply the changes for now.
-package = JSON.parse(File.read('../package.json'))
+package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
-s.source_files = 'RNJWPlayer*.{h,m}'
+s.source_files = 'ios/RNJWPlayer*.{h,m}'
-s.resources = "Assets/*.png"
+s.resources = "ios/Assets/*.png"
Make sure to run npx pod-install
from your project root after this
Run npx patch-package react-native-jw-media-player
to apply this patch and commit the changes
I am running into this issue with a brand new app as well and can confirm that @archcorsair's comment above resolves the issue for me. I'm happy to make a PR, but I don't have access to push my local branch to the repo.
Versions: "react": "18.1.0", "react-native": "0.70.1"
@archcorsair I applied the patch as you described and the pod file is getting installed. However, I'm still seeing
ERROR Invariant Violation: requireNativeComponent: "RNJWPlayerView" was not found in the UIManager.
This error is located at:
in RNJWPlayerView (at react-native-jw-media-player/index.js:484)
Is there perhaps an additional step that you did?
Version info
"react": "18.0.0",
"react-native": "0.69.6",
@taschik did you move the podspec file up one directory?
@archcorsair Yes I did as per your patch. It's in the root folder of the react-native-jw-media-player
folder under node_modules
@taschik At this point it might be a caching issue. Can you clear metro cache and try again?
I have the same issue, did you find the solution to this problem.
I have the same issue, did you find the solution to this problem.
@94jesus I haven't had a chance to continue working on it. Will keep you posted when I get to it again.
Same problem here 🥲
"react": "18.1.0", "react-native": "0.69.6",
I fixed with @archcorsair solution, thanks a lot.
I saw the @chriswindings suggested a PR, but looks like we can't move forward with it.
Is there something that we could do to help with this ?
As per @archcorsair comments above which helped hugely, I've created a PR which fixes this issue for ReactNative 0.68.3+. https://github.com/chaimPaneth/react-native-jw-media-player/pull/242
Merged the PR in version 0.2.27
Thanks @chaimPaneth and @ddolheguy and everyone here =)