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

Crash while downloading all models #3

Open
mablue opened this issue Mar 3, 2024 · 1 comment
Open

Crash while downloading all models #3

mablue opened this issue Mar 3, 2024 · 1 comment

Comments

@mablue
Copy link
Contributor

mablue commented Mar 3, 2024

https://paste.crdroid.net/HnhPZo

time: 1709446801785
msg: java.lang.IllegalArgumentException: com.k2fsa.sherpa.onnx.tts.engine: Targeting U+ (version 34 and above) disallows creating or retrieving a PendingIntent with FLAG_MUTABLE, an implicit Intent within and without FLAG_NO_CREATE and FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT for security reasons. To retrieve an already existing PendingIntent, use FLAG_NO_CREATE, however, to create a new PendingIntent with an implicit Intent use FLAG_IMMUTABLE.
stacktrace: java.lang.RuntimeException: Unable to start service com.k2fsa.sherpa.onnx.tts.engine.service.ModelManagerService@78618c6 with Intent { dat=https://github.com/... cmp=com.k2fsa.sherpa.onnx.tts.engine/.service.ModelManagerService (has extras) }: java.lang.IllegalArgumentException: com.k2fsa.sherpa.onnx.tts.engine: Targeting U+ (version 34 and above) disallows creating or retrieving a PendingIntent with FLAG_MUTABLE, an implicit Intent within and without FLAG_NO_CREATE and FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT for security reasons. To retrieve an already existing PendingIntent, use FLAG_NO_CREATE, however, to create a new PendingIntent with an implicit Intent use FLAG_IMMUTABLE.
	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4880)
	at android.app.ActivityThread.-$$Nest$mhandleServiceArgs(Unknown Source:0)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2314)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:205)
	at android.os.Looper.loop(Looper.java:294)
	at android.app.ActivityThread.main(ActivityThread.java:8244)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
Caused by: java.lang.IllegalArgumentException: com.k2fsa.sherpa.onnx.tts.engine: Targeting U+ (version 34 and above) disallows creating or retrieving a PendingIntent with FLAG_MUTABLE, an implicit Intent within and without FLAG_NO_CREATE and FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT for security reasons. To retrieve an already existing PendingIntent, use FLAG_NO_CREATE, however, to create a new PendingIntent with an implicit Intent use FLAG_IMMUTABLE.
	at android.os.Parcel.createExceptionOrNull(Parcel.java:3065)
	at android.os.Parcel.createException(Parcel.java:3045)
	at android.os.Parcel.readException(Parcel.java:3028)
	at android.os.Parcel.readException(Parcel.java:2970)
	at android.app.IActivityManager$Stub$Proxy.getIntentSenderWithFeature(IActivityManager.java:6632)
	at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:757)
	at android.app.PendingIntent.getBroadcast(PendingIntent.java:740)
	at u4.c.b(SourceFile:165)
	at com.k2fsa.sherpa.onnx.tts.engine.service.ModelManagerService.onStartCommand(Unknown Source:52)
	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4862)
	... 9 more
@mablue
Copy link
Contributor Author

mablue commented Mar 3, 2024

The error message indicates an issue with how your app is trying to create a PendingIntent object on Android 14 (API level 34) and above. Here's a breakdown of the problem:

  • PendingIntent: This is an object that holds an intent (an action to be performed) that will be launched later at a specific time or when a certain event occurs.
  • FLAG_MUTABLE: This flag was previously used to allow modifications to the PendingIntent object after its creation. However, it's considered a security risk.
  • Implicit Intent: This is an intent that specifies an action to be performed without explicitly mentioning the app that should handle it.

The problem:

Your app is trying to create a PendingIntent with an implicit intent and the FLAG_MUTABLE flag. This combination is no longer allowed on Android 14 (API level 34) for security reasons.

The solution:

There are two options depending on what you're trying to achieve:

  1. Retrieve an existing PendingIntent: If you already have a PendingIntent created earlier, use the FLAG_NO_CREATE flag when calling getBroadcast or getBroadcastAsUser methods on the PendingIntent object.

  2. Create a new PendingIntent: If you need to create a new PendingIntent with an implicit intent, use the FLAG_IMMUTABLE flag instead of FLAG_MUTABLE.

Additional tips:

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

1 participant