Amazon Chime SDK integration crashes on android (React Native)

0

I'm trying to integrate Amazon Chime SDK 0.18.3 into the React Native app. I need both video and audio meetings. I used the demo from https://github.com/aws-samples/amazon-chime-react-native-demo as a reference. On iOS it works fine and without any issues. But on Android, it crashes when someone leaves the meeting with more than one attendee. All of the attendees have an active camera. When all attendees are in the meeting without an active camera app doesn't crash. I explored the logs. And there I'm seeing the following: call to OpenGL ES API with no current context (logged once per thread)

A java_vm_ext.cc:578] JNI DETECTED ERROR IN APPLICATION: JNI CallLongMethodV called with pending exception java.lang.IllegalArgumentException: Object is set to null. java_vm_ext.cc:578] at boolean android.opengl.EGL14.eglMakeCurrent(android.opengl.EGLDisplay, android.opengl.EGLSurface, android.opengl.EGLSurface, android.opengl.EGLContext) (EGL14.java:-2) java_vm_ext.cc:578] at java.lang.Object com.amazonaws.services.chime.sdk.meetings.internal.video.gl.DefaultEglRenderer$releaseEglSurface$1.invokeSuspend(java.lang.Object (DefaultEglRenderer.kt:139) java_vm_ext.cc:578] at void kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(java.lang.Object) (ContinuationImpl.kt:33) java_vm_ext.cc:578] at void kotlinx.coroutines.DispatchedTask.run() (DispatchedTask.kt:106) java_vm_ext.cc:578] at void android.os.Handler.handleCallback(android.os.Message(Handler.java:938) java_vm_ext.cc:578] at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:99) java_vm_ext.cc:578] at void android.os.Looper.loop() (Looper.java:246) java_vm_ext.cc:578] at void android.os.HandlerThread.run() (HandlerThread.java:67) java_vm_ext.cc:578] java_vm_ext.cc:578] in call to CallLongMethodV java_vm_ext.cc:578] from boolean android.opengl.EGL14.eglMakeCurrent(android.opengl.EGLDisplay, android.opengl.EGLSurface, android.opengl.EGLSurface, android.opengl.EGLContext)

I've tried different versions of the Amazon Chime SDK but still facing this issue.

Maksym
asked 6 months ago214 views
1 Answer
0

The error message you're encountering suggests that there's an issue with the OpenGL context when an attendee leaves the meeting, which could be causing the crash on Android. This is likely related to how the Chime SDK is interacting with the OpenGL resources, possibly when it's trying to clean up or reconfigure the video rendering resources as attendees leave.

Here are some steps you can take to troubleshoot and potentially resolve the issue:

  1. Context Handling: Ensure that all OpenGL context handling is done correctly. This means that you should check if the context is active before making any OpenGL calls. Sometimes, OpenGL resources might be released when a user leaves, which could lead to calls with no current context.

  2. Thread Management: The error log suggests that there might be threading issues (JNI DETECTED ERROR IN APPLICATION: JNI CallLongMethodV called with pending exception). Ensure that OpenGL calls are made on the correct thread and that you're not accidentally making OpenGL calls from a background thread.

  3. Resource Cleanup: Check the cleanup code for when an attendee leaves. The error IllegalArgumentException: Object is set to null suggests that there's an attempt to use a null object as a parameter for the eglMakeCurrent function. Review the code to ensure that you're not releasing or nullifying resources prematurely.

  4. Chime SDK Versions: You've mentioned that you've tried different versions of the Amazon Chime SDK. It would be worth checking the release notes for the versions you've tried to see if there are any known issues or fixes related to this problem.

  5. Logging and Monitoring: Add additional logging around the points where the context is made current and where resources are cleaned up. This will help you pinpoint exactly where the issue is occurring.

  6. Amazon Chime SDK GitHub Issues: Have you looked at the GitHub issues for the Amazon Chime SDK (especially the one you're using) to see if others have encountered similar problems? You might find that someone has already posted a solution or workaround.

  7. Consult the Amazon Chime SDK Documentation: Review the official documentation for any notes on known issues or platform-specific considerations that need to be taken into account.

  8. Update or Patch: If you're not on the latest version of the SDK, update to the latest version as it may contain fixes for your issue. If you are on the latest, you may need to consider applying a patch or workaround.

  9. Minimal Reproducible Example: Try to create a minimal example that reproduces the issue. Sometimes, simplifying the code can help identify if the issue is with the SDK or the way it's being used.

  10. Check for Conflicts: Ensure there are no conflicts with other libraries or components in your application that might be causing the issue.

  11. Device and OS Specific: Test on multiple devices with different Android versions to see if the issue is device or OS-specific.

Make sure to test any changes you make in a controlled environment and to back up your code before making significant changes. It can also be helpful to incrementally implement changes and test to see if the issue persists, which can help isolate the cause.

AWS
Drew D
answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions