Page MenuHomePhabricator

TTS Start error
Closed, ResolvedPublicBUG REPORT

Description

Crashing when clicking on the TTS headphones icon.

Error log:
Stack trace:
java.lang.RuntimeException: Unable to start service org.cis_india.wsreader.reader.MediaService@e1f5761 with Intent { cmp=org.cis_india.wsreader/.reader.MediaService }: java.lang.SecurityException: Permission Denial: startForeground from pid=29617, uid=10339 requires android.permission.FOREGROUND_SERVICE
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5274)
at android.app.ActivityThread.-$$Nest$mhandleServiceArgs(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2540)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loopOnce(Looper.java:267)
at android.os.Looper.loop(Looper.java:371)
at android.app.ActivityThread.main(ActivityThread.java:8836)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:620)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:966)
Caused by: java.lang.SecurityException: Permission Denial: startForeground from pid=29617, uid=10339 requires android.permission.FOREGROUND_SERVICE
at android.os.Parcel.createExceptionOrNull(Parcel.java:3242)
at android.os.Parcel.createException(Parcel.java:3226)
at android.os.Parcel.readException(Parcel.java:3209)
at android.os.Parcel.readException(Parcel.java:3151)
at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:7378)
at android.app.Service.startForeground(Service.java:776)
at org.cis_india.wsreader.reader.MediaService.onStartCommand(MediaService.kt:162)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5256)
... 9 more
Caused by: android.os.RemoteException: Remote stack trace:
at com.android.server.am.ActivityManagerService.enforcePermission(ActivityManagerService.java:6583)
at com.android.server.am.ActiveServices.setServiceForegroundInnerLocked(ActiveServices.java:2190)
at com.android.server.am.ActiveServices.setServiceForegroundLocked(ActiveServices.java:1842)
at com.android.server.am.ActivityManagerService.setServiceForeground(ActivityManagerService.java:14520)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:3668)

Event Timeline

@Muguro The TTS icon is missing in the playstore production release but it is working in local debugging. Can you check if this is related?

@Muguro The TTS icon is missing in the playstore production release but it is working in local debugging. Can you check if this is related?

Okay, I'm on it.

Hi @Saiphani02, When i build with this changes in build.gradle, it works fine

buildTypes {
    release {
        minifyEnabled false
        shrinkResources false

I'm digging deeper so as to identify the files I should guard in proguard-rules.pro as it builds.
Should I create a separate issue for this?