Azure / communication-ui-library-android

Azure Communication UI Mobile Library for Android
https://learn.microsoft.com/en-us/azure/communication-services/concepts/ui-library/ui-library-overview?pivots=platform-web
MIT License
24 stars 29 forks source link

Calling-v1.5.0 - App crash targeting SDK 34 #919

Closed sainz closed 8 months ago

sainz commented 9 months ago

If an app targets API 34, it crashes when initiating a video call. Below is the crash log:

FATAL EXCEPTION: main
Process: ******, PID: 9706
java.lang.RuntimeException: Unable to start service
com.azure.android.communication.ui.calling.service.InCallService@a453a11 with Intent {
cmp=com.***.****/com.azure.android.communication.ui.calling.service.InCallService }:
java.lang.SecurityException: Starting FGS with type microphone callerApp=ProcessRecord{6e0be75
9706:com.***.*****/u0a713} targetSDK=34 requires permissions: all of the permissions
allOf=true [android.permission.FOREGROUND_SERVICE_MICROPHONE] any of the permissions
allOf=false [android.permission.CAPTURE_AUDIO_HOTWORD,
android.permission.CAPTURE_AUDIO_OUTPUT, android.permission.CAPTURE_MEDIA_OUTPUT,
android.permission.CAPTURE_TUNER_AUDIO_INPUT,
android.permission.CAPTURE_VOICE_COMMUNICATION_OUTPUT,
android.permission.RECORD_AUDIO] and the app must be in the eligible state/exemptions to access the
foreground only permission
pavelprystinka commented 9 months ago

Thanks @sainz for pointing to this issue. It will be addressed in the upcoming release.

Meanwhile, if you are blocked, you can add this permission to your App's AndroidManifest.xml to avoid crashing: <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />

sainz commented 9 months ago

This solution prevents the crash, but on devices running Android 14 and targeting API 34, the video call still does not start.

patelsonu905 commented 8 months ago

After clicking on "Join Call," redirects to the initial page, and the video call does not start. An error message is displayed below:

[communication.ui] com.azure.android.communication.ui.calling.redux.action.ErrorAction$FatalErrorOccurred@53b88e [DOTNET] callJoinFailed [communication.ui] com.azure.android.communication.ui.calling.redux.action.ErrorAction$EmergencyExit@b13ec45 [communication.ui] com.azure.android.communication.ui.calling.redux.action.NavigationAction$Exit@bd6cf9a [EGL_emulation] app_time_stats: avg=27.87ms min=6.72ms max=290.67ms count=31 Thread finished: #11 Thread finished: #8 [AndroidRuntime] Shutting down VM [AndroidRuntime] FATAL EXCEPTION: main [AndroidRuntime] Process: com.azure.communication.ui.calling.mauisampleapp, PID: 8012 [AndroidRuntime] java.lang.StackOverflowError: stack size 8188KB [AndroidRuntime] at android.util.ArrayMap.get(ArrayMap.java:487) [AndroidRuntime] at android.app.SystemServiceRegistry.getSystemService(SystemServiceRegistry.java:1593)

pavelprystinka commented 8 months ago

@sainz, @patelsonu905 could you please try latest version (currently v1.6.0). It does not require a workaround anymore. Thanks