Open qinghua-pactera opened 9 months ago
Sorry for the delay, is this log from running the demo app with the SDK? Did you observe the same error on previous OS versions?
It appears within our APP. For Android 13 or below, this error does not occur and the function is normal. On Android 14, this error occurred.
Compiler Environment: compileSdk 34 targetSdk 34
Phone:Pixel 5,OS 14
Sorry for the delay, is this log from running the demo app with the SDK? Did you observe the same error on previous OS versions?
This problem also occurs in the demo app. It should be an adaptation problem to Android 14. Thanks
@qinghua-pactera I would think so as well, will post updates once any.
when using targetSdk 34, it's required to register a callback before mediaProjection.createVirtualDisplay
.
add mediaProjection?.registerCallback(object : MediaProjection.Callback() {}, handler)
before mediaProjection?.createVirtualDisplay
in DefaultScreenCaptureSource.startInternal()
to fix.
https://developer.android.com/about/versions/14/behavior-changes-14#callback
@JasonChiAT Thanks for pointing out. Android team is crazy.
Is this going to be addressed this year? We have no issues downloading the source and just fixing it for now, but would prefer if there was an update from the aws team. Right now our Android 14 users are unable to do screen sharing because of this change that we completely missed when updating to the latest sdk.
Yes, we're working on that. Refer to https://github.com/aws/amazon-chime-sdk-android/commit/2eac126f3822d5ce6a1e3fa21f92054578a1fc58 for the fix, will update once it's been released.
oh thanks for the update. we did make a temp fix using the above suggestions. just forgot to update here. again thanks
java.lang.IllegalStateException: Must register a callback before starting capture, to manage resources in response to MediaProjection states. at android.media.projection.MediaProjection.createVirtualDisplay(MediaProjection.java:206) at com.amazonaws.services.chime.sdk.meetings.audiovideo.video.capture.DefaultScreenCaptureSource.startInternal(DefaultScreenCaptureSource.kt:192) at com.amazonaws.services.chime.sdk.meetings.audiovideo.video.capture.DefaultScreenCaptureSource.access$startInternal(DefaultScreenCaptureSource.kt:49) at com.amazonaws.services.chime.sdk.meetings.audiovideo.video.capture.DefaultScreenCaptureSource$start$1.run(DefaultScreenCaptureSource.kt:113) at android.os.Handler.handleCallback(Handler.java:958) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:205) at android.os.Looper.loop(Looper.java:294) at android.os.HandlerThread.run(HandlerThread.java:67)