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

[BUG] Crash on android S+ (API >= 31) #194

Open
Damjan94 opened this issue May 27, 2022 · 11 comments · Fixed by #195
Open

[BUG] Crash on android S+ (API >= 31) #194

Damjan94 opened this issue May 27, 2022 · 11 comments · Fixed by #195
Labels
✔️ approved This issue (suggestion, bug, etc.) is been approved 🐞 bug Something isn't working ✅ closed It's closed and implemented/solved correctly

Comments

@Damjan94
Copy link

General information

About OS*

OS version: Android 12 LineageOS 19

About the app (CV Project)*

App release: built from master branch

App language (in English): English

About you device

Device RAM: ?

Device display size (in Inches): ?

(Optional, but recommended) Device model (and brand): dream2lte

From what store have you installed the app?: built from source

Are there installed Google Services on your device? No

Description bug *

The app crashes on startup

How to reproduce the bug *

  1. Start the app

Log file

No log file as the app doesn't start. Here's a stack trace instead

E/AndroidRuntime: FATAL EXCEPTION: pool-3-thread-1
    Process: org.commonvoice.saverio, PID: 10436
    java.lang.IllegalArgumentException: org.commonvoice.saverio: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
    Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
        at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
        at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:645)
        at android.app.PendingIntent.getBroadcast(PendingIntent.java:632)
        at androidx.work.impl.utils.ForceStopRunnable.getPendingIntent(ForceStopRunnable.java:273)
        at androidx.work.impl.utils.ForceStopRunnable.isForceStopped(ForceStopRunnable.java:151)
        at androidx.work.impl.utils.ForceStopRunnable.forceStopRunnable(ForceStopRunnable.java:171)
        at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:102)
        at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:91)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:920)
@Damjan94 Damjan94 added ⁉️ not categorised Request not yet categorised 🐞 bug Something isn't working labels May 27, 2022
@Sav22999
Copy link
Owner

@Damjan94 Hi, sorry for this bug.

Have you tried the last version released in "Release"? (2.4.0.4)... it should work.

Update me 😄

@Damjan94
Copy link
Author

It does not work, sorry... Does it work on your emulator(running api >= 31 ?) maybe the problem is not there(even though the stack trace strongly suggests that it is). I have had a few apps crash on me before, because of no google play services(something as simple as using google's font could cause a crash if services aren't installed.)

@Damjan94
Copy link
Author

So, according to this
firebase/flutterfire#7237 (comment)
and this
firebase/flutterfire#8018
if you use an old library, it could also cause the crash

@Sav22999 Sav22999 added to verify This bug need to be verified and removed ⁉️ not categorised Request not yet categorised labels May 30, 2022
@Sav22999
Copy link
Owner

@Damjan94 I don't really know actually

@Damjan94
Copy link
Author

ok I fixed it. It was indeed an outdated library. Changing the workVersion to 2.8.0-alpha02

diff --git a/buildSrc/src/main/java/Versions.kt b/buildSrc/src/main/java/Versions.kt
-    const val workVersion = "2.5.0"
+    const val workVersion = "2.8.0-alpha02"

I hope there's nothing preventing you from updating that dependency.
Good luck.

@Sav22999
Copy link
Owner

Sav22999 commented May 30, 2022

@Damjan94 I cannot merge with an alpha version, the app could be unstable (alpha version for definition is not stable).

Could you try with 2.8.0 instead?

Thank you very much

@Damjan94
Copy link
Author

The latest stable version is 2.7.1 and it works there too.

@Sav22999
Copy link
Owner

@Damjan94 Thanks!
I'll update asap 😄

@Sav22999 Sav22999 added 🔜 in progress We are working on it, so it will be available soon and removed to verify This bug need to be verified labels May 31, 2022
Sav22999 added a commit that referenced this issue May 31, 2022
@Sav22999 Sav22999 added ✅ closed It's closed and implemented/solved correctly ✔️ approved This issue (suggestion, bug, etc.) is been approved and removed 🔜 in progress We are working on it, so it will be available soon labels May 31, 2022
@Roy-Orbison
Copy link

@Sav22999 Has there been a regression on this one? The app crashes so frequently it's barely usable, but I'm pretty sure it only started crashing after I logged into it. I get this log with v2.5.1:

java.lang.IllegalArgumentException: org.commonvoice.saverio: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
	at android.app.PendingIntent.checkFlags(PendingIntent.java:377)
	at android.app.PendingIntent.getActivityAsUser(PendingIntent.java:460)
	at android.app.PendingIntent.getActivity(PendingIntent.java:446)
	at android.app.PendingIntent.getActivity(PendingIntent.java:410)
	at org.commonvoice.saverio.ListenActivity.sendNotification(ListenActivity.kt:1533)
	at org.commonvoice.saverio.ListenActivity.showPopupAndSendNotification(ListenActivity.kt:1498)
	at org.commonvoice.saverio.ListenActivity.access$showPopupAndSendNotification(ListenActivity.kt:66)
	at org.commonvoice.saverio.ListenActivity$setupBadgeDialog$1$invokeSuspend$$inlined$collect$1.emit(Collect.kt:146)
	at kotlinx.coroutines.flow.SharedFlowImpl.collect(SharedFlow.kt:351)
	at kotlinx.coroutines.flow.SharedFlowImpl$collect$1.invokeSuspend(Unknown Source:15)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:234)
	at kotlinx.coroutines.DispatchedTaskKt.resumeUnconfined(DispatchedTask.kt:190)
	at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:161)
	at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:397)
	at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:431)
	at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:420)
	at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:328)
	at kotlinx.coroutines.flow.SharedFlowImpl.emitSuspend(SharedFlow.kt:472)
	at kotlinx.coroutines.flow.SharedFlowImpl.emit(SharedFlow.kt:374)
	at org.commonvoice.saverio_lib.preferences.StatsPrefManager$localValidated$1.invokeSuspend(StatsPrefManager.kt:125)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at android.os.Handler.handleCallback(Handler.java:938)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:226)
	at android.os.Looper.loop(Looper.java:329)
	at android.app.ActivityThread.main(ActivityThread.java:8063)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1026)

@Sav22999
Copy link
Owner

@Roy-Orbison sorry for the inconvenience. Thank you for reporting this.
I'll check asap and in case release an update. Please, let me know if the problem still remain after that.

😓

@Roy-Orbison
Copy link

No worries, thanks for your good work. I did find this bug report earlier but assumed a fix was on the way. The date looked recent, but I'd misread the year as 2023.

@Sav22999 Sav22999 reopened this Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✔️ approved This issue (suggestion, bug, etc.) is been approved 🐞 bug Something isn't working ✅ closed It's closed and implemented/solved correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants