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

element android 1.6.20 crash when joining video group/ jitsi conference. #8885

Closed
Eternumkr opened this issue Aug 19, 2024 · 8 comments · Fixed by #8911
Closed

element android 1.6.20 crash when joining video group/ jitsi conference. #8885

Eternumkr opened this issue Aug 19, 2024 · 8 comments · Fixed by #8911

Comments

@Eternumkr
Copy link

Description

join a video room, loads for a bit, then crashes.
using a google pixel 7 pro running graphineOS.
crash log shows the following.

type: crash
osVersion: google/cheetah/cheetah:14/AP2A.240805.005/2024080600:user/release-keys
package: im.vector.app:40106202
process: im.vector.app
processUptime: 24029 + 369 ms
installer: com.android.vending

java.lang.RuntimeException: Unable to create service org.jitsi.meet.sdk.JitsiMeetOngoingConferenceService: java.lang.SecurityException: Starting FGS with type mediaProjection callerApp=ProcessRecord{f51e57e 3678:im.vector.app/u0a193} targetSDK=34 requires permissions: all of the permissions allOf=true [android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION] any of the permissions allOf=false [android.permission.CAPTURE_VIDEO_OUTPUT, android:project_media]
at android.app.ActivityThread.handleCreateService(ActivityThread.java:4942)
at android.app.ActivityThread.-$$Nest$mhandleCreateService(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2414)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8623)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
at com.android.internal.os.ExecInit.main(ExecInit.java:50)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:369)
Caused by: java.lang.SecurityException: Starting FGS with type mediaProjection callerApp=ProcessRecord{f51e57e 3678:im.vector.app/u0a193} targetSDK=34 requires permissions: all of the permissions allOf=true [android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION] any of the permissions allOf=false [android.permission.CAPTURE_VIDEO_OUTPUT, android:project_media]
at android.os.Parcel.createExceptionOrNull(Parcel.java:3192)
at android.os.Parcel.createException(Parcel.java:3176)
at android.os.Parcel.readException(Parcel.java:3152)
at android.os.Parcel.readException(Parcel.java:3094)
at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:6975)
at android.app.Service.startForeground(Service.java:778)
at org.jitsi.meet.sdk.JitsiMeetOngoingConferenceService.onCreate(SourceFile:37)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:4929)
... 11 more
Caused by: android.os.RemoteException: Remote stack trace:
at com.android.server.am.ActiveServices.validateForegroundServiceType(ActiveServices.java:2842)
at com.android.server.am.ActiveServices.setServiceForegroundInnerLocked(ActiveServices.java:2530)
at com.android.server.am.ActiveServices.setServiceForegroundLocked(ActiveServices.java:1806)
at com.android.server.am.ActivityManagerService.setServiceForeground(ActivityManagerService.java:13879)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:3491)

@tienipia
Copy link

Same issue here, Samsung Galaxy S23, Folder 3.

It happens regardless on android phone model.

@Destinyg133
Copy link

On my GF's phone also crashes and she uses samsung
I use xiaomi and it does not crash for me

@christianrowlands
Copy link

christianrowlands commented Aug 27, 2024

I am running into the same issue. Here are my device details:

  • Pixel 8 Pro
  • Android 14
  • Build number: AP2A.240805.005
  • Element version: 1.6.20 [40106202] (G-fca16b67)

Worthy of note, this problem does not happen when joining a direct call, it needs to be a conference call.

As best I can tell, it seems to be an Android 14 permissions problem. Now that the Element Android app targets SDK 34 (Android 14) it has to abide by certain permission policies.

The problem seems to be coming from the Jitsi Meet SDK (which explains the conference call). I noticed that version 8.1.1 of the org.jitsi.react:jitsi-meet-sdk is being used, which is over a year old so I tried to upgrade it to 10.1.0 and ran into a different problem.

The new problem is the screen goes black when joining a conference call. Since it appears Element builds its own version of the jitsi SDK (see this build script), that might be why I am running into this problem, or it could be an issue with the latest version of jitsi-meet-sdk.

The errors I see (which may or may not be related) when the screen goes black are:

2024-08-27 08:55:34.089  1937-3099  JitsiMeetLogger         im.vector.app.debug                  E  [features/app] Error(Error){"message":"Exception in HostObject::get(propName:RNGoogleSignin): <unknown>","stack":"index.android.bundle:3378:163\[email protected]:2:1789\nindex.android.bundle:3377:225\[email protected]:2:1789\nindex.android.bundle:3164:234\[email protected]:2:1789\nindex.android.bundle:2977:681\[email protected]:2:1789\nindex.android.bundle:2976:172\[email protected]:2:1789\[email protected]:2:1180\nindex.android.bundle:774:1920\ngeneratorResume@[native code]\[email protected]:391:70\[email protected]:391:282\nindex.android.bundle:391:341\[email protected]:112:208\[email protected]:112:1593\[email protected]:112:487\nindex.android.bundle:391:232\nindex.android.bundle:774:2367\nindex.android.bundle:3532:1596\ngeneratorResume@[native code]\[email protected]:391:70\[email protected]:391:282\[email protected]:112:158\nindex.android.bundle:112:870\nindex.android.bundle:118:1668\[email protected]:118:499\[email protected]:118:889\[email protected]:118:3059\[email protected]:57:2897\nindex.android.bundle:57:984\[email protected]:57:2529\[email protected]:57:942\nvalue@[native code]\nvalue@[native code]"}
2024-08-27 08:55:34.089  1937-3099  JitsiMeetSDK            im.vector.app.debug                  E  [features/app] Error(Error){"message":"Exception in HostObject::get(propName:RNGoogleSignin): <unknown>","stack":"index.android.bundle:3378:163\[email protected]:2:1789\nindex.android.bundle:3377:225\[email protected]:2:1789\nindex.android.bundle:3164:234\[email protected]:2:1789\nindex.android.bundle:2977:681\[email protected]:2:1789\nindex.android.bundle:2976:172\[email protected]:2:1789\[email protected]:2:1180\nindex.android.bundle:774:1920\ngeneratorResume@[native code]\[email protected]:391:70\[email protected]:391:282\nindex.android.bundle:391:341\[email protected]:112:208\[email protected]:112:1593\[email protected]:112:487\nindex.android.bundle:391:232\nindex.android.bundle:774:2367\nindex.android.bundle:3532:1596\ngeneratorResume@[native code]\[email protected]:391:70\[email protected]:391:282\[email protected]:112:158\nindex.android.bundle:112:870\nindex.android.bundle:118:1668\[email protected]:118:499\[email protected]:118:889\[email protected]:118:3059\[email protected]:57:2897\nindex.android.bundle:57:984\[email protected]:57:2529\[email protected]:57:942\nvalue@[native code]\nvalue@[native code]"}
2024-08-27 08:55:34.094  1937-3099  JitsiMeetLogger         im.vector.app.debug                  E  [features/base/app] Error(TypeError){"message":"undefined is not an object (evaluating 'r(d[22])._getRouteToRender')","stack":"index.android.bundle:774:1927\ngeneratorResume@[native code]\[email protected]:391:70\[email protected]:391:282\nindex.android.bundle:391:341\[email protected]:112:208\[email protected]:112:1593\[email protected]:112:487\nindex.android.bundle:391:232\nindex.android.bundle:774:2367\nindex.android.bundle:3532:1596\ngeneratorResume@[native code]\[email protected]:391:70\[email protected]:391:282\[email protected]:112:158\nindex.android.bundle:112:870\nindex.android.bundle:118:1668\[email protected]:118:499\[email protected]:118:889\[email protected]:118:3059\[email protected]:57:2897\nindex.android.bundle:57:984\[email protected]:57:2529\[email protected]:57:942\nvalue@[native code]\nvalue@[native code]"}
2024-08-27 08:55:34.094  1937-3099  JitsiMeetSDK            im.vector.app.debug                  E  [features/base/app] Error(TypeError){"message":"undefined is not an object (evaluating 'r(d[22])._getRouteToRender')","stack":"index.android.bundle:774:1927\ngeneratorResume@[native code]\[email protected]:391:70\[email protected]:391:282\nindex.android.bundle:391:341\[email protected]:112:208\[email protected]:112:1593\[email protected]:112:487\nindex.android.bundle:391:232\nindex.android.bundle:774:2367\nindex.android.bundle:3532:1596\ngeneratorResume@[native code]\[email protected]:391:70\[email protected]:391:282\[email protected]:112:158\nindex.android.bundle:112:870\nindex.android.bundle:118:1668\[email protected]:118:499\[email protected]:118:889\[email protected]:118:3059\[email protected]:57:2897\nindex.android.bundle:57:984\[email protected]:57:2529\[email protected]:57:942\nvalue@[native code]\nvalue@[native code]"}

Either way, it would be great if someone smarter with the react-native, jitsi, and Element source code could take a look. I am hoping it is an easy fix (several threads mentioned changng npm library versions and clearing the cache).

@christianrowlands
Copy link

Ok, I can confirm that upgrading to version 10.1.0 of the Jitsi Mobile SDK fixes the issue! I compiled the Jitsi Mobile SDK myself (using the instructions in this repo) for 10.1.0 and got past the issue I was seeing before with the blank screen. No idea why that fixed it, but I am guessing it has something to do with a packaged react-android node library... or something like that.

Anyway, I will gen up a PR tomorrow and see if I can clean up my code enough to get it accepted.

@schildbach
Copy link

Since this is a regression from the previous version of Element-Android, and since it affects a major feature likely used by many, can a rollback of the specific change that causes this crash be considered? That way, Element could be used for video/voice conferences again while a more thorough fix is being prepared.

It seems the fix via #8891 and element-hq/jitsi_libre_maven#1 will take much longer to deploy, given the problems with missing dependencies described there.

@christianrowlands
Copy link

It seems the change can't be rolled back due to the following: When targeting Android 14 (SDK 34), foreground service permissions must be declared. Starting August 31st, 2024, new app versions are required to target SDK 34 to be published on Google Play (see this link).

Regarding the two PRs you mentioned, I just need someone from the Element team to provide feedback. There are several possible ways to address the decision not to use mavenCentral, but I’d prefer to align with the team’s best practices rather than implementing a solution independently. It's a bit disheartening to have spent time fixing this issue and submitting two PRs without any acknowledgment from the Element team. Even if they don't like the approach I took, just tell me that instead of leaving the PRs hanging.

@christianrowlands
Copy link

@bmarty , I have the code written up to fix this bug. Any chance you can take a look at my PRs?

@bmarty
Copy link
Member

bmarty commented Sep 18, 2024

I am looking at this right now.

@bmarty bmarty mentioned this issue Sep 18, 2024
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants