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

NodeCameraView not showing camera on Android in React Native V0.60.0

Open aamirnbs opened this issue 5 years ago • 15 comments

After integrating as per instructions in readme, NodeCameraView not showing camera on Android for React-Native version 0.60.0. Any help please. Thanks

aamirnbs avatar Jul 17 '19 14:07 aamirnbs

Same issue.. i think this library is not being maintained anymore

Dgs-asohail4 avatar Jul 22 '19 04:07 Dgs-asohail4

@aamirnbs any workaround you found on this.. i am facing same issue

sam17896 avatar Jul 24 '19 15:07 sam17896

@Dgs-asohail4 @sam17896 I tried many solutions for this issue and ultimately following change in Android Library code worked for me. In RCTNodeCameraView.java class set isAutoPreview as true it was false by default. private Boolean isAutoPreview = true; I am still testing it to make sure it does not break anything else. Hope it will work for you!

aamirnbs avatar Jul 24 '19 16:07 aamirnbs

Yup it works for me.. but i think this is not the problem because we set the property autoPreview from the js files before and it work that way.. the main problem is with requireNativeComponent or UIManager the classes that wired up js files with native code.

sam17896 avatar Jul 24 '19 16:07 sam17896

Thats great! Let me know if you get some other solutions w.r.t. JS only so that we don't need to change the java code anymore. Thanks

aamirnbs avatar Jul 24 '19 17:07 aamirnbs

Make sure you manually request camera and audio permissions on Android. I was having this same issue because the library doesn't prompt the user for their permissions. Once I did that the camera appeared.

https://facebook.github.io/react-native/docs/permissionsandroid

jwillingham789 avatar Aug 02 '19 18:08 jwillingham789

Yes you are right @jwillingham789 library does not prompt. Even after manually prompting for requests and then opening NodeCameraView, it was not showing the camera.

aamirnbs avatar Aug 02 '19 18:08 aamirnbs

It does show the camera if all permissions are given and autopreview is set to true. However you cannot start or stop the camera preview without restarting the application. Currently investigating.

Update: This was the problem: https://github.com/facebook/react-native/issues/17968#issuecomment-457236577 - filing a PR soon

Update 2: Fixed in my fork over here: https://github.com/michelalbers/react-native-nodemediaclient - I guess this repo is dead.

michelalbers avatar Oct 02 '19 14:10 michelalbers

Fixed with now merged #50

michelalbers avatar Oct 14 '19 09:10 michelalbers

NodeCameraView is crashing on release apk. Any solutions for this issue? After I give camera & microphone permissions, the app crashes and exits.

rubensavio avatar Apr 26 '20 14:04 rubensavio

NodeCameraView is crashing on release apk. Any solutions for this issue? After I give camera & microphone permissions, the app crashes and exits.

same with me

blusclips avatar May 03 '20 14:05 blusclips

NodeCameraView is crashing on release apk. Any solutions for this issue? After I give camera & microphone permissions, the app crashes and exits.

same with me

Are you using progaurd rules?

rubensavio avatar May 03 '20 14:05 rubensavio

I'm using NodeCameraView for RSTP streaming and geting this error( "expo": "^38.0.0", "react-native": "^0.63.2") Invariant Violation: requireNativeComponent: "RCTNodePCamera" was not found in the UIManager. How i can fix it.

Moni-h avatar Aug 27 '20 17:08 Moni-h

I'm using NodeCameraView for RSTP streaming and geting this error( "expo": "^38.0.0", "react-native": "^0.63.2") Invariant Violation: requireNativeComponent: "RCTNodePCamera" was not found in the UIManager. How i can fix it.

I have the same problem, do you have any news about how to fix it ?

Hoango712 avatar Mar 18 '21 23:03 Hoango712

Hi Cephas,

Are you using proguard rules? If so then add in your proguard-rules.pro file these lines

-keep class cn.nodemedia.** {*;} -dontwarn cn.nodemedia.**

basically proguard rules is to shrink your app size & in doing so it removes unused java classes from the project. Sometimes it removes important classes as well & unfortunately it removes nodemedia classes. So we need to add conditions to keep the class. This should fix it.

Hope this helps

On Sun, May 3, 2020 at 8:13 PM Maseruka Cephas @.***> wrote:

NodeCameraView is crashing on release apk. Any solutions for this issue? After I give camera & microphone permissions, the app crashes and exits.

same with me

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/NodeMedia/react-native-nodemediaclient/issues/45#issuecomment-623120789, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN3XSQBJHVA6NTF2F4HRUOTRPV7KFANCNFSM4IERKDIA .

-- Regards, Ruben Gregory Technical Head Ph. No. - +91-9791291499

rubensavio avatar Mar 23 '21 04:03 rubensavio