react-native-jw-media-player icon indicating copy to clipboard operation
react-native-jw-media-player copied to clipboard

[iOS] RNJWPlayer is not getting installed on pod install

Open owais-star opened this issue 2 years ago • 6 comments

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)

owais-star avatar Aug 03 '22 10:08 owais-star

Same here on RN 0.69.4, did you fix it??

marc-slashmobility avatar Sep 07 '22 16:09 marc-slashmobility

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?

danimarin avatar Sep 21 '22 14:09 danimarin

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)

danimarin avatar Sep 21 '22 14:09 danimarin

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 avatar Sep 22 '22 10:09 danimarin

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

owais-star avatar Sep 22 '22 11:09 owais-star

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

archcorsair avatar Sep 23 '22 22:09 archcorsair

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"

chriswindings avatar Oct 11 '22 18:10 chriswindings

@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 avatar Oct 28 '22 23:10 taschik

@taschik did you move the podspec file up one directory?

archcorsair avatar Oct 28 '22 23:10 archcorsair

@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 avatar Oct 28 '22 23:10 taschik

@taschik At this point it might be a caching issue. Can you clear metro cache and try again?

archcorsair avatar Oct 28 '22 23:10 archcorsair

I have the same issue, did you find the solution to this problem.

94jesus avatar Nov 01 '22 00:11 94jesus

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.

taschik avatar Nov 01 '22 17:11 taschik

Same problem here 🥲

"react": "18.1.0", "react-native": "0.69.6",

jacksonsmith avatar Nov 07 '22 15:11 jacksonsmith

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 ?

jacksonsmith avatar Nov 08 '22 21:11 jacksonsmith

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

ddolheguy avatar Nov 09 '22 13:11 ddolheguy

Merged the PR in version 0.2.27

chaimPaneth avatar Nov 09 '22 21:11 chaimPaneth

Thanks @chaimPaneth and @ddolheguy and everyone here =)

jacksonsmith avatar Nov 11 '22 12:11 jacksonsmith