shivammaindola / AndroidWebRTC

Checkout step by step tutorial.
https://medium.com/@shivammaindola07/step-by-step-guide-to-build-webrtc-native-android-app-47898caa1594
122 stars 48 forks source link

App doesn't work on sdk versions > 29 #17

Closed wsogithub closed 1 year ago

wsogithub commented 1 year ago

Setup:

I run the signaling server first, then launch and start the app, then open the browser. The browser cam opens and the app's cam runs, but the stream does not start on the respective devices. The browser's console prints:

Attempted to create or join room foo main.js:121 Getting user media with constraints Object main.js:59 Message from server: Received request to create or join room foo main.js:59 Message from server: Room foo now has 0 client(s) main.js:59 Message from server: Client ID MfqG6Zhr2mE2HLgJAAAA created room foo main.js:39 Created room foo main.js:108 Adding local stream. main.js:65 Client sending message: got user media main.js:130 >>>>>>> maybeStart() false MediaStream false main.js:59 Message from server: Client said: got user media :3000/favicon.ico:1 Failed to load resource: the server responded with a status of 404 (Not Found)

djsamseng commented 1 year ago

Failing to load the favicon is just noise. Likely the issue is found from the logs on the android device. This might help too https://github.com/shivammaindola/AndroidWebRTC/issues/15#issuecomment-1345918838

Try starting the android app before opening the link in Chrome. If that doesn’t work feel free to post the Android Studio logs and I can take a look

wsogithub commented 1 year ago

Yeah I've been starting the app before the browser, killing the processes each time.

Logcat doesn't show that CompleteActivity is logging anything (set on verbose) so it appears that the client isn't connecting at all. The url I've set the app is http://my-pc-ip:3000

wsogithub commented 1 year ago

The app has all of the requested permissions as well

wsogithub commented 1 year ago

Interesting, so the app works fine when compileSdkVersion is <29. There are no errors in logcat when I set it to 30, so it might be some socket security changes with those versions of android.

wsogithub commented 1 year ago

Found the issue, it's related to security changes in android pie as discussed here: https://github.com/pchab/AndroidRTC/issues/189

these changes fix the issue.