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

[de.check24.check24] BackgroundServiceStartNotAllowedException: Not allowed to start service Intent #2524

Open
ln-12 opened this issue Sep 4, 2024 · 8 comments

Comments

@ln-12
Copy link

ln-12 commented Sep 4, 2024

Affected app
Name: CHECK24
Package id: de.check24.check24

Describe the bug
I am a developer of the CHECK24 app. We are getting quite regular Sentry crash logs since 6th August with the error message Not allowed to start service Intent { act=com.google.android.gms.analytics.ANALYTICS_DISPATCH cmp=de.check24.check24/com.google.android.gms.analytics.AnalyticsService }: app is in background uid UidRecord{db0c2cc u0a241 CAC bg:+4m23s554ms idle change:procadj procs:0 seq(404703,399269)}. The Google Play version is set to 0.3.2.240913-22 which directly leads to microG when searching it in Google. So I assume that it is related to this project.

Here is the stack trace:

java.lang.RuntimeException: Error receiving broadcast Intent { act=com.google.analytics.RADIO_POWERED cat=[de.check24.check24] flg=0x10 (has extras) } in com.google.android.gms.internal.gtm.zzfe@fff8f18
    at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$android-app-LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1800)
    at android.app.LoadedApk$ReceiverDispatcher$Args$$ExternalSyntheticLambda0.run
    at android.os.Handler.handleCallback(Handler.java:942)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:201)
    at android.os.Looper.loop(Looper.java:288)
    at android.app.ActivityThread.main(ActivityThread.java:7924)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
android.app.BackgroundServiceStartNotAllowedException: Not allowed to start service Intent { act=com.google.android.gms.analytics.ANALYTICS_DISPATCH cmp=de.check24.check24/com.google.android.gms.analytics.AnalyticsService }: app is in background uid UidRecord{db0c2cc u0a241 CAC  bg:+4m23s554ms idle change:procadj procs:0 seq(404703,399269)}
    at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1908)
    at android.app.ContextImpl.startService(ContextImpl.java:1864)
    at android.content.ContextWrapper.startService(ContextWrapper.java:817)
    at com.google.android.gms.internal.gtm.zzbs.zzc(com.google.android.gms:play-services-analytics-impl@@18.0.4:0)
    at com.google.android.gms.internal.gtm.zzbs.zzc(com.google.android.gms:play-services-analytics-impl@@18.0.4:7)
    at com.google.android.gms.internal.gtm.zzfe.onReceive(com.google.android.gms:play-services-analytics-impl@@18.0.4:0)
    at com.google.android.gms.internal.gtm.zzfe.onReceive(com.google.android.gms:play-services-analytics-impl@@18.0.4:15)
    at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$android-app-LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1790)
    at android.app.LoadedApk$ReceiverDispatcher$Args$$ExternalSyntheticLambda0.run
    at android.os.Handler.handleCallback(Handler.java:942)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:201)
    at android.os.Looper.loop(Looper.java:288)
    at android.app.ActivityThread.main(ActivityThread.java:7924)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

To Reproduce
We can unfortunately not reproduce this crash locally as it a) seems to be rare and b) we don't have test devices running microG.

Expected behavior
The app should not crash when the user has microG installed instead of the regular Google Play Services.

System
Android Version: we got crash logs for Android 12 and 13
Custom ROM: I cannot see if a user has a custom ROM installed, but the Sentry root detection shows that the devices are not rooted

microG
microG Core version: 0.3.2.240913-22
microG Self-Check results: I cannot verify that as I don't use microG

Additional context
Please let me know if there is something that we can do on our side to prevent this.

@mar-v-in
Copy link
Member

mar-v-in commented Sep 4, 2024

Hi @ln-12, thanks for your report.

Version 0.3.2.240913-22 is the version of microG shipped in /e/OS 2.2 and 2.3. /e/OS 2.2 was released July 22 and should've been delivered to most endusers within a week or so - so timeframe does not exactly match August 6, but could still be related. None of the changes done in 0.3.2.240913-22 compared to upstream 0.3.2.240913 seem to be likely related to this. /e/OS should not show up as rooted on most devices.

a) Can you confirm that you see this issue exclusively with 0.3.2.240913-22 and not 0.3.2.240913 or any other version that may be related to microG (they all start with 0.)?
b) Can you confirm that there was no relevant change to CHECK24 app on or before August 6 that could be relevant in this context? Most relevant are changes to dependencies that are related to play services or firebase, e.g. the play-services-analytics-impl dependency.

Assuming this report is coming from multiple users, I guess we can rule out user specific settings (like blocking the app from running in background via battery settings in the OS). However /e/OS might include privacy related functionality like tracker blockers that block the execution of the analytics service and thereby cause this issue.

@ln-12
Copy link
Author

ln-12 commented Sep 4, 2024

Hey @mar-v-in, thanks for that fast response!

a) No, I cannot yet say that for sure. We only got crashes from that version so far, but there might also be other versions affected. The same goes for the time frame. Maybe we were just lucky that it did not show up earlier?

b) Shortly before that date, we updated (besides others) com.google.android.gms:play-services-analytics from 18.0.4 to 18.1.0 and com.google.firebase:firebase-analyticsfrom 21.6.2 to 22.0.2. Other than that I do not see any analytics related changes in our code.

I see, thanks for the explanation!

@mar-v-in
Copy link
Member

mar-v-in commented Sep 4, 2024

@ln-12 the above log shows play-services-analytics-impl@@18.0.4. Did you update play-services-analytics from 18.0.4 to 18.1.0 but still have play-services-analytics-impl at 18.0.4?

@ln-12
Copy link
Author

ln-12 commented Sep 4, 2024

Mh, that is strange. When I run ./gradlew app:dependencies | grep "play-services-analytics-impl", it outputs +--- com.google.android.gms:play-services-analytics-impl:{strictly 18.1.0} -> 18.1.0 (c). Sentry reports the same version.

I am not that deep into custom ROMs and alternative play service implementations, but could it be possible that our .apk is somehow patched at installation/run time? Or maybe the proguard symbol mapping is not up to date.

@mar-v-in
Copy link
Member

mar-v-in commented Sep 4, 2024

Maybe the stack trace you provided is a report from a user that used a version of Check24 app before the migration to 18.1.0? That would confirm that the issue is not related to the version of play-services-analytics being used.

@ln-12
Copy link
Author

ln-12 commented Sep 4, 2024

I double checked that. All crash logs I currently have are from the version after we switched to 18.1.0.

The number of crashes is also increased since 26th August:

image

@mar-v-in
Copy link
Member

mar-v-in commented Sep 4, 2024

Regarding the version discrepancies: It seems that Google repackaged the 18.0.4 version of play-services-analytics-impl and released it as 18.1.0 using the exact same binary class files. As such, the class file reports to be from 18.0.4 in stack traces even though it comes from 18.1.0. The only other change in 18.1.0 (beside the version bump in the metadata file) is an increase of the minimum sdk version (from 14 to 21). So for almost all purposes, play-services-analytics-impl 18.0.4 and 18.1.0 are identical.

August 26 somewhat matches the release data of /e/OS 2.3 (which was released August 22). You might want to open an issue at https://gitlab.e.foundation/e/os/backlog/-/issues.

It might well be that this crash is invisble to the user and has no negative side effects, as the log claims that starting the service is not allowed because the app is in background.

@ln-12
Copy link
Author

ln-12 commented Sep 4, 2024

That would be a comprehensible explanation. I will do so, but their strict registration policies force me to manually write them an email to set up an account.

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