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

App gettting crashed on android on final step #1587

Open
1 task
aliwaqar981 opened this issue Nov 22, 2024 · 6 comments
Open
1 task

App gettting crashed on android on final step #1587

aliwaqar981 opened this issue Nov 22, 2024 · 6 comments
Labels
question Further information is requested react-native React Native SDK issues

Comments

@aliwaqar981
Copy link

aliwaqar981 commented Nov 22, 2024

Which package/packages do you use?

  • @stream-io/video-react-native-sdk

Describe the bug

  useEffect(() => {
    const _call = client?.call('default', callId);
    _call
      ?.join({create: true})
      .then(() => {
        console.log("Call created successfully");
        
        setCall(_call) //App gets crashed when I set _call in state
      })
  }, [client, callId]);

I tried following the guideline for react native but in the end when I set call in state. App is getting crashed.

To Reproduce
Steps to reproduce the behavior:
Attaching a repo which might help in reproduction:
https://github.com/aliwaqar981/GetStreamRePro

I tried to create reproduction in separate project. It was working correctly there. My new project was on react-native 0.76.2. I'm thinking maybe that's the reason but I'm not sure.

Expected behavior
Video call should get starts after running above code snippet.

Screenshots
If applicable, add screenshots to help explain your problem.

Version

  • SDK version
  • "@stream-io/video-react-native-sdk": "^1.3.5",
  • @stream-io/react-native-webrtc: ^124.0.2

Env:

Fill out what's applicable

React Native
react-native: 0.74.3

  • OS: android
  • Device or emulator: Vivo v21e

Node JS client

  • Node version 20.12.0

Additional context
It seems some compatibility issue of sdk with react-native 0.74.3 because it worked on 0.76.2.

@aliwaqar981 aliwaqar981 added the bug Something isn't working label Nov 22, 2024
@oliverlaz
Copy link
Member

hi @aliwaqar981, the code snippet looks correct to me.
Can you please share the stack trace of the crash so we can analyze it?

@aliwaqar981
Copy link
Author

aliwaqar981 commented Nov 23, 2024

@oliverlaz There is not much in stack trace as I can't see any error and app get crashed. Although I'm attaching a video of crash and a log statement which I got.

Logs:
{"types": [64, 128]}

Video Recording
https://github.com/user-attachments/assets/389718ba-e909-4b82-bbc4-9f40e526c43e

@aliwaqar981
Copy link
Author

Hey @oliverlaz, Hi I've made a repository to produce the issue. It would be great if you can have a look:
https://github.com/aliwaqar981/GetStreamRePro.

@aliwaqar981
Copy link
Author

There is one discovery that app is crashing even on latest version (0.76.3) of react-native. It's working in one of my repo which I have created initially but while testing I've created a new project and it gave me same crash that I found on react-native 0.74.3

@oliverlaz
Copy link
Member

oliverlaz commented Nov 25, 2024

hi @aliwaqar981, thank you for taking the time to prepare a repro app! It made everything easier.

I tested with iOS but the fix should be the same for Android as well.

Upon running your sample app, I managed to reproduce the crash. The error message attached to it was the following:

This app has crashed because it attempted to access privacy-sensitive data without a usage description. 
The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.

Upon providing the permission information in Info.plist as described below, the app worked as expected and was able to join the call.

To fix the crash, open the ios/SpaceMobile/Info.plist and add the following lines:

<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) would like to use your camera</string>
<key>NSMicrophoneUsageDescription</key>
<string>$(PRODUCT_NAME) would like to use your microphone</string>

On Android, edit the android/app/src/main/AndroidManifest.xml add add the following lines:

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
  <uses-feature android:name="android.hardware.camera" />
  <uses-feature android:name="android.hardware.camera.autofocus" />
  <uses-feature android:name="android.hardware.audio.output" />
  <uses-feature android:name="android.hardware.microphone" />

  <uses-permission android:name="android.permission.CAMERA" />
  <uses-permission android:name="android.permission.RECORD_AUDIO" />
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
  <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
  <uses-permission android:name="android.permission.INTERNET" />
  ...
  <application
    ...
  />
  </application>
</manifest>

Please let me know if this fixes the issue for you.

@oliverlaz oliverlaz added question Further information is requested react-native React Native SDK issues and removed bug Something isn't working labels Nov 25, 2024
@aliwaqar981
Copy link
Author

Hi @oliverlaz I did tested only on android but these android permissions are already added in my manifest file. Please see here:
https://github.com/aliwaqar981/GetStreamRePro/blob/main/android/app/src/main/AndroidManifest.xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested react-native React Native SDK issues
Projects
None yet
Development

No branches or pull requests

2 participants