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

Crashes when using TTS #1348

Open
tcitworld opened this issue Nov 13, 2023 · 5 comments
Open

Crashes when using TTS #1348

tcitworld opened this issue Nov 13, 2023 · 5 comments
Labels

Comments

@tcitworld
Copy link
Member

Reported from Google Play Console :

  • Android 13 (SDK 33)
  • Version : 229 (2.4.3)
Exception java.lang.NullPointerException: Attempt to invoke virtual method 'int android.speech.tts.TextToSpeech.setOnUtteranceProgressListener(android.speech.tts.UtteranceProgressListener)' on a null object reference
  at fr.gaulupeau.apps.Poche.tts.TtsService.onTtsInit (TtsService.java:813)
  at fr.gaulupeau.apps.Poche.tts.TtsService.lambda$onTtsInitListener$2$TtsService (TtsService.java:800)
  at fr.gaulupeau.apps.Poche.tts.-$$Lambda$TtsService$wRo8nfks0cyhkyc6GfJEBsmbwDo.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:7918)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:548)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:936)

Another issue:

Exception java.lang.NullPointerException:
  at fr.gaulupeau.apps.Poche.tts.TtsFragment.onReadFinished (TtsFragment.java:640)
  at fr.gaulupeau.apps.Poche.tts.TtsFragment.lambda$vXXw53yckoOIUcjDNACQ7yVr4MA
  at fr.gaulupeau.apps.Poche.tts.-$$Lambda$TtsFragment$vXXw53yckoOIUcjDNACQ7yVr4MA.run
  at android.os.Handler.handleCallback (Handler.java:942)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loopOnce (Looper.java:226)
  at android.os.Looper.loop (Looper.java:313)
  at android.app.ActivityThread.main (ActivityThread.java:8762)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:604)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1067)
@tcitworld tcitworld added the Bug label Nov 13, 2023
@kidpixo
Copy link

kidpixo commented Dec 2, 2023

Same with Android 14 , wallabag installed from Fdroid.

@jamietanna
Copy link

jamietanna commented Jan 13, 2024

I'm seeing a slightly different error on Android 14:

12-29 10:02:41.561 22194 22194 E AndroidRuntime: FATAL EXCEPTION: main
12-29 10:02:41.561 22194 22194 E AndroidRuntime: Process: fr.gaulupeau.apps.InThePoche, PID: 22194
12-29 10:02:41.561 22194 22194 E AndroidRuntime: android.app.MissingForegroundServiceTypeException: Starting FGS without a type  callerApp=ProcessRecord{2222502 22194:fr.gaulupeau.apps.InThePoche/u0a241} targetSDK=34
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at android.app.MissingForegroundServiceTypeException$1.createFromParcel(MissingForegroundServiceTypeException.java:53)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at android.app.MissingForegroundServiceTypeException$1.createFromParcel(MissingForegroundServiceTypeException.java:49)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at android.os.Parcel.readParcelableInternal(Parcel.java:4870)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at android.os.Parcel.readParcelable(Parcel.java:4852)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at android.os.Parcel.createExceptionOrNull(Parcel.java:3052)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at android.os.Parcel.createException(Parcel.java:3041)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at android.os.Parcel.readException(Parcel.java:3024)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at android.os.Parcel.readException(Parcel.java:2966)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:6761)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at android.app.Service.startForeground(Service.java:775)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at fr.gaulupeau.apps.Poche.tts.TtsService.setForegroundAndNotification(TtsService.java:1141)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at fr.gaulupeau.apps.Poche.tts.TtsService.setForegroundAndNotification(TtsService.java:1106)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at fr.gaulupeau.apps.Poche.tts.TtsService.playCmd(TtsService.java:436)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at fr.gaulupeau.apps.Poche.tts.TtsService.playPauseCmd(TtsService.java:504)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at fr.gaulupeau.apps.Poche.tts.TtsFragment.playPauseCommand(TtsFragment.java:539)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at fr.gaulupeau.apps.Poche.tts.TtsFragment.lambda$onCreateView$0$fr-gaulupeau-apps-Poche-tts-TtsFragment(TtsFragment.java:212)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at fr.gaulupeau.apps.Poche.tts.TtsFragment$$ExternalSyntheticLambda0.onClick(Unknown Source:2)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at android.view.View.performClick(View.java:7658)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at android.view.View.performClickInternal(View.java:7635)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at android.view.View$PerformClick.run(View.java:30167)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:958)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:99)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:205)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:294)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:8194)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
12-29 10:02:41.561 22194 22194 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)

Which looks like we can sort with https://stackoverflow.com/questions/77520968/why-am-i-encountering-the-error-starting-fgs-without-a-type-when-executing-the

@ngosang
Copy link
Contributor

ngosang commented May 1, 2024

@Strubbl I see this is already fixed on master. Could you publish a release?
This is affecting all users of Android 14 / 15

@Strubbl
Copy link
Contributor

Strubbl commented May 1, 2024

I do not have the keys to publish a release, we need the help from @tcitworld here.

@tcitworld
Copy link
Member Author

tcitworld commented May 1, 2024

2.5.2 is published on our side. Unfortunately as the changes from b0ea814 need to be manually reviewed it might take a while for the new version to be available on Google Play (I had to make videos illustrating the uses of FOREGROUND_SERVICE_DATA_SYNC and FOREGROUND_SERVICE_MEDIA_PLAYBACK).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants