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

"java.lang.IllegalStateException: There is no matched resolution!" #152

Open
xxrraa opened this issue Jun 12, 2024 · 2 comments
Open

"java.lang.IllegalStateException: There is no matched resolution!" #152

xxrraa opened this issue Jun 12, 2024 · 2 comments

Comments

@xxrraa
Copy link

xxrraa commented Jun 12, 2024

Hi all, thanks for the amazing release! I'm having a really weird issue. Everything was working fine and then I messed w the code and versions of java, gradle kotlin, etc via homebrew and now the app crashes on start and logcat shows the error in the title of this issue. Some background info/things I've tried

  • Testing via a call between a blackberry BBB100-1 and android 7 on a pixel 7 virtual phone in android studio (which used to work fine) Running MacOS 12.7.5. Tried both on Iguana and Jellyfish, same issue
  • Solution attempt 1: Re-downloaded fresh code from the github page, Result: Build failed with weird deprecation warnings that never occurred before (Dependencies and IP address were set in the fresh code as instructed on the github page)
Screen Shot 2024-06-11 at 8 31 00 PM
  • Solution attempt 2: Wiped everything android related from my mac. (Users/username/.android, AndroidStudioProjects, Preferences files, Library/Android, etc.) Also wiped gradle, kotlin, java (except the versions shipped w the os), node, npm, etc

  • Solution attempt 3: Reinstalled android jellyfish, using fresh code again, set IP address in local.properties, ensure webrtc in libs.toml and reflected in build.gradle, Result: No build errors but app still crashes on call start with the message in the title of this issue

Full error below, thanks for your time, any help is greatly appreciated

FATAL EXCEPTION: main
Process: io.getstream.webrtc.sample.compose, PID: 3235
java.lang.IllegalStateException: There is no matched resolution!
at io.getstream.webrtc.sample.compose.webrtc.sessions.WebRtcSessionManagerImpl.getResolution(WebRtcSessionManagerImpl.kt:105)
at io.getstream.webrtc.sample.compose.webrtc.sessions.WebRtcSessionManagerImpl.access$getResolution(WebRtcSessionManagerImpl.kt:62)
at io.getstream.webrtc.sample.compose.webrtc.sessions.WebRtcSessionManagerImpl$videoSource$2.invoke(WebRtcSessionManagerImpl.kt:117)
at io.getstream.webrtc.sample.compose.webrtc.sessions.WebRtcSessionManagerImpl$videoSource$2.invoke(WebRtcSessionManagerImpl.kt:114)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at io.getstream.webrtc.sample.compose.webrtc.sessions.WebRtcSessionManagerImpl.getVideoSource(WebRtcSessionManagerImpl.kt:114)
at io.getstream.webrtc.sample.compose.webrtc.sessions.WebRtcSessionManagerImpl.access$getVideoSource(WebRtcSessionManagerImpl.kt:62)
at io.getstream.webrtc.sample.compose.webrtc.sessions.WebRtcSessionManagerImpl$localVideoTrack$2.invoke(WebRtcSessionManagerImpl.kt:123)
at io.getstream.webrtc.sample.compose.webrtc.sessions.WebRtcSessionManagerImpl$localVideoTrack$2.invoke(WebRtcSessionManagerImpl.kt:121)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at io.getstream.webrtc.sample.compose.webrtc.sessions.WebRtcSessionManagerImpl.getLocalVideoTrack(WebRtcSessionManagerImpl.kt:121)
at io.getstream.webrtc.sample.compose.webrtc.sessions.WebRtcSessionManagerImpl.onSessionScreenReady(WebRtcSessionManagerImpl.kt:195)
at io.getstream.webrtc.sample.compose.ui.screens.video.VideoCallScreenKt$VideoCallScreen$1.invokeSuspend(VideoCallScreen.kt:48)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
at androidx.compose.ui.platform.AndroidUiDispatcher.performTrampolineDispatch(AndroidUiDispatcher.android.kt:81)
at androidx.compose.ui.platform.AndroidUiDispatcher.access$performTrampolineDispatch(AndroidUiDispatcher.android.kt:41)
at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.run(AndroidUiDispatcher.android.kt:57)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@b1ea14a, androidx.compose.runtime.BroadcastFrameClock@a6b68bb, StandaloneCoroutine{Cancelling}@546c1d8, AndroidUiDispatcher@3408931]
2024-06-11 20:10:24.659 2308-2396 WorkSourceUtil com.google.android.gms E Could not find package: io.getstream.webrtc.sample.compose

@xxrraa
Copy link
Author

xxrraa commented Jun 12, 2024

I've done some more troubleshooting since posting this and was able to get the app not to crash by changing

private val resolution: CameraEnumerationAndroid.CaptureFormat get() { val frontCamera = cameraEnumerator.deviceNames.first { cameraName -> cameraEnumerator.isFrontFacing(cameraName) } val supportedFormats = cameraEnumerator.getSupportedFormats(frontCamera) ?: emptyList() return supportedFormats.firstOrNull { (it.width == 720 || it.width == 480 || it.width == 360) } ?: error("There is no matched resolution!") }

to this

private val resolution: CameraEnumerationAndroid.CaptureFormat get() { val frontCamera = cameraEnumerator.deviceNames.first { cameraName -> cameraEnumerator.isFrontFacing(cameraName) } val supportedFormats = cameraEnumerator.getSupportedFormats(frontCamera) ?: emptyList() return supportedFormats.firstOrNull { (it.width == 720 || it.width == 480 || it.width == 360) } ?: CameraEnumerationAndroid.CaptureFormat(640, 480, CameraEnumerationAndroid.CaptureFormat.FramerateRange(15, 120)) // Default resolution if no match found }

Now, the audio/video from the blackberry is displayed on the virtual device in android studio perfectly, but the virtual machine's video, which used to display a pixelated green android avatar, now shows a checkered background with a red box in it

Additional troubleshooting results: With the original code (after my hard to diagnose hiccup), no combination of front/back camera and None, Emulated, Webcam prevents crashing. But with the modified code, if I set front to webcam it crashes, if I set it to emulate it doesn't crash, and while it's set to emulate, back can be set to webcam and work perfectly

Thanks again for any help

@skydoves
Copy link
Member

Hi @xxrraa , the new release, version 1.3.0, is now available and includes the m125 patches. Could you check if this issue still occurs with the updated release?

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

2 participants