Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force close using huawei devices #11

Closed
flixyudh opened this issue Nov 15, 2022 · 14 comments
Closed

Force close using huawei devices #11

flixyudh opened this issue Nov 15, 2022 · 14 comments
Assignees

Comments

@flixyudh
Copy link

flixyudh commented Nov 15, 2022

Hi, i just tried to implement broadcasting using this library in my Huawei Phone, but it suddenly force close after navigated to <IVSBroadcastCameraView/>

Flow:
At Home screen i have a button called Broadcast and it handling permission before navigate to broadcast screen

Home.js Broadcast button function:

const isLocationGranted = await check(PERMISSIONS.ANDROID.RECORD_AUDIO)
if(isLocationGranted===RESULTS.GRANTED) navigation.navigate('Broadcast')
else {
  const isRequestLocationGranted = await request(PermissionSpecificPlatform)
  if(isRequestLocationGranted === RESULTS.GRANTED) navigation.navigate('Broadcast')
  else RequestPermission()
}

Broadcast.js:

<IVSBroadcastCameraView
  rtmpsUrl={rtmpURL}
  streamKey={streamKey}
  {...(__DEV__ && {
    logLevel: 'debug',
    sessionLogLevel: 'debug',
  })}
/>

is there any required props to make it work?

Here's a full log

FATAL EXCEPTION: main
11-16 00:20:01.792 16844 16844 E AndroidRuntime: Process: com.mysecretapps, PID: 16844
11-16 00:20:01.792 16844 16844 E AndroidRuntime: java.lang.NullPointerException: Attempt to read from field 'android.content.Context android.view.ViewRootImpl.mContext' on a null object reference
11-16 00:20:01.792 16844 16844 E AndroidRuntime:        at android.view.TextureView.onSizeChangedEx(TextureView.java:471)
11-16 00:20:01.792 16844 16844 E AndroidRuntime:        at android.view.TextureView.onSizeChanged(TextureView.java:397)
11-16 00:20:01.792 16844 16844 E AndroidRuntime:        at android.view.View.sizeChange(View.java:22687)
11-16 00:20:01.792 16844 16844 E AndroidRuntime:        at android.view.View.setFrame(View.java:22639)
11-16 00:20:01.792 16844 16844 E AndroidRuntime:        at android.view.View.layout(View.java:22493)
11-16 00:20:01.792 16844 16844 E AndroidRuntime:        at com.amazonivsreactnativebroadcast.IVSBroadcastCameraView.IVSBroadcastCameraView.addCameraPreview(IVSBroadcastCameraView.java:52)
11-16 00:20:01.792 16844 16844 E AndroidRuntime:        at com.amazonivsreactnativebroadcast.IVSBroadcastCameraView.IVSBroadcastCameraView.onReceiveCameraPreviewHandler(IVSBroadcastCameraView.java:58)
11-16 00:20:01.792 16844 16844 E AndroidRuntime:        at com.amazonivsreactnativebroadcast.IVSBroadcastCameraView.IVSBroadcastCameraView.lambda$initBroadcastSession$0$IVSBroadcastCameraView(IVSBroadcastCameraView.java:114)
11-16 00:20:01.792 16844 16844 E AndroidRuntime:        at com.amazonivsreactnativebroadcast.IVSBroadcastCameraView.-$$Lambda$IVSBroadcastCameraView$WnQaBbfcct3uMwZyQVZcO0t6X7s.run(Unknown Source:2)
11-16 00:20:01.792 16844 16844 E AndroidRuntime:        at com.amazonivsreactnativebroadcast.IVSBroadcastCameraView.IVSBroadcastSessionService.lambda$getCameraPreviewAsync$5$IVSBroadcastSessionService(IVSBroadcastSessionService.java:408)
11-16 00:20:01.792 16844 16844 E AndroidRuntime:        at com.amazonivsreactnativebroadcast.IVSBroadcastCameraView.-$$Lambda$IVSBroadcastSessionService$bPW9mYOpmUqSbTFH06LMRWF5y58.run(Unknown Source:4)
11-16 00:20:01.792 16844 16844 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:900)
11-16 00:20:01.792 16844 16844 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:103)
11-16 00:20:01.792 16844 16844 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:219)
11-16 00:20:01.792 16844 16844 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:8668)
11-16 00:20:01.792 16844 16844 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
11-16 00:20:01.792 16844 16844 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
11-16 00:20:01.792 16844 16844 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1109)
@AndrewShapovalov
Copy link
Contributor

@zxccvvv hello!

Have you tried running sample app to check out if the same issue happens?

@flixyudh
Copy link
Author

Hi @AndrewShapovalov , I just tried run example project and it force closing too

11-17 11:31:49.075 21407 21407 E AndroidRuntime: FATAL EXCEPTION: main
11-17 11:31:49.075 21407 21407 E AndroidRuntime: Process: com.example.amazonivsreactnativebroadcast, PID: 21407
11-17 11:31:49.075 21407 21407 E AndroidRuntime: java.lang.NullPointerException: Attempt to read from field 'android.content.Context android.view.ViewRootImpl.mContext' on a null object reference
11-17 11:31:49.075 21407 21407 E AndroidRuntime:        at android.view.TextureView.onSizeChangedEx(TextureView.java:471)
11-17 11:31:49.075 21407 21407 E AndroidRuntime:        at android.view.TextureView.onSizeChanged(TextureView.java:397)
11-17 11:31:49.075 21407 21407 E AndroidRuntime:        at android.view.View.sizeChange(View.java:22687)
11-17 11:31:49.075 21407 21407 E AndroidRuntime:        at android.view.View.setFrame(View.java:22639)
11-17 11:31:49.075 21407 21407 E AndroidRuntime:        at android.view.View.layout(View.java:22493)
11-17 11:31:49.075 21407 21407 E AndroidRuntime:        at com.amazonivsreactnativebroadcast.IVSBroadcastCameraView.IVSBroadcastCameraView.addCameraPreview(IVSBroadcastCameraView.java:52)
11-17 11:31:49.075 21407 21407 E AndroidRuntime:        at com.amazonivsreactnativebroadcast.IVSBroadcastCameraView.IVSBroadcastCameraView.onReceiveCameraPreviewHandler(IVSBroadcastCameraView.java:58)
11-17 11:31:49.075 21407 21407 E AndroidRuntime:        at com.amazonivsreactnativebroadcast.IVSBroadcastCameraView.IVSBroadcastCameraView.lambda$initBroadcastSession$0$IVSBroadcastCameraView(IVSBroadcastCameraView.java:114)
11-17 11:31:49.075 21407 21407 E AndroidRuntime:        at com.amazonivsreactnativebroadcast.IVSBroadcastCameraView.-$$Lambda$IVSBroadcastCameraView$3_ha8rgtWc4nXoFe9f_1wdECz8M.run(Unknown Source:2)
11-17 11:31:49.075 21407 21407 E AndroidRuntime:        at com.amazonivsreactnativebroadcast.IVSBroadcastCameraView.IVSBroadcastSessionService.lambda$getCameraPreviewAsync$5$IVSBroadcastSessionService(IVSBroadcastSessionService.java:408)
11-17 11:31:49.075 21407 21407 E AndroidRuntime:        at com.amazonivsreactnativebroadcast.IVSBroadcastCameraView.-$$Lambda$IVSBroadcastSessionService$igT8BKZgG9UH-7AIBDMdnzoqncg.run(Unknown Source:4)
11-17 11:31:49.075 21407 21407 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:900)
11-17 11:31:49.075 21407 21407 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:103)
11-17 11:31:49.075 21407 21407 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:219)
11-17 11:31:49.075 21407 21407 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:8668)
11-17 11:31:49.075 21407 21407 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
11-17 11:31:49.075 21407 21407 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
11-17 11:31:49.075 21407 21407 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1109)

@AndrewShapovalov
Copy link
Contributor

Hi @AndrewShapovalov , I just tried run example project and it force closing too

@zxccvvv thanks! Could you also provide a little bit more information about your phone (e.g. phone model, OS version etc)?

@chrisedington
Copy link

Hi @AndrewShapovalov

I literally just got a crash alert about a Huawei device too 😄

NullPointerException
Attempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)' on a null object reference

image

@flixyudh
Copy link
Author

Hi @AndrewShapovalov , I just tried run example project and it force closing too

@zxccvvv thanks! Could you also provide a little bit more information about your phone (e.g. phone model, OS version etc)?

@AndrewShapovalov my Huawei devices model is Nova 7 SE

@chrisedington your issue is not related to this package, i bet your RN version is lower than 0.67.0, because those error has been fixed at 0.67.0 (Read Here)

@chrisedington
Copy link

Thanks for the info @zxccvvv - appreciated - looks like you're right. I retract my comment above :)

@AndrewShapovalov
Copy link
Contributor

Hi @zxccvvv!

I've just published the fix on the next branch. Could you give it a try and say if the problem's gone?

$ yarn add amazon-ivs-react-native-broadcast@next

@AndrewShapovalov AndrewShapovalov self-assigned this Dec 1, 2022
@flixyudh
Copy link
Author

flixyudh commented Dec 2, 2022

Sure @AndrewShapovalov , i'll take a look and let you know soon

@flixyudh
Copy link
Author

flixyudh commented Dec 2, 2022

Hi @AndrewShapovalov , i just tried your next version, but when i tried using props rtmpsUrl and streamKey it throw error ReadableNativeMap as below
screen

but it works when i pass rtmpsUrl and streamKey as start() ref method

@AndrewShapovalov
Copy link
Contributor

Hi @zxccvvv! Thanks for answering.

I've just updated the next branch with the fix. Could you try again?

@flixyudh
Copy link
Author

flixyudh commented Dec 5, 2022

Hi @AndrewShapovalov , i just tried to implement broadcast in my ios too, but it throw error while npx pod-install

The Swift pod `amazon-ivs-react-native-broadcast` depends upon `React-Core`, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.

could you help me how to fix the problem when installing cocoapods?

my RN version is 0.62.2 btw

@AndrewShapovalov
Copy link
Contributor

Hi @zxccvvv!

To solve the problem you can add use_modular_headers! in your Podfile, however I would recommend you instead to upgrade RN to the 0.64.0 version or higher.

@AndrewShapovalov
Copy link
Contributor

Hi @zxccvvv!

Do you have any updates regarding the issue?

@flixyudh
Copy link
Author

flixyudh commented Dec 9, 2022

Hi @AndrewShapovalov sorry for late response

currently i've another task priority to do, so i just skip this issue

ill close it for now and i'll give you an update when i've time to test it

@flixyudh flixyudh closed this as completed Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants