Skip to content

Format and update AndroidManifest.xml - #45

Merged
CodeBySonu95 merged 2 commits into
CodeBySonu95:mainfrom
kazemcodes:main
Sep 6, 2026
Merged

CodeBySonu95 merged 2 commits into
CodeBySonu95:mainfrom
kazemcodes:main

Conversation

@kazemcodes

Copy link
Copy Markdown
Contributor

1. Fix Critical Manifest Bug Blocking TTS Service Binding

In AndroidManifest.xml (line 105), VoxSherpaTtsService declared an invalid binding permission:

<service  
    android:name=".system.VoxSherpaTtsService"  
    android:label="VoxSherpa TTS"  
    android:permission="android.permission.BIND_TEXT_TO_SPEECH_ENGINE"  
    android:exported="true">

Problem Analysis

  • Mechanism: The android:permission attribute on a <service> tag enforces that any client application attempting to bind to the service must hold that specific permission.
  • Root Cause: android.permission.BIND_TEXT_TO_SPEECH_ENGINE does not exist in the Android OS framework. Consequently, no client app (such as IReader, Chrome, etc.) can ever hold or be granted it.
  • Failure Mode: When a client application initializes TextToSpeech(context), Android's ActiveServices.java verifies whether the calling app holds sInfo.permission. Because the client lacks this non-existent permission, Android aborts the bind operation and throws:
SecurityException: Not allowed to bind to service Intent { act=android.intent.action.TTS_service pkg=com.CodeBySonu.VoxSherpa }

Resolution

Remove the android:permission attribute from VoxSherpaTtsService. Standard Android TTS engines (e.g., Google TTS, Samsung TTS, eSpeak, RHVoice) do not require binding permissions so third-party applications can bind directly.

@CodeBySonu95

Copy link
Copy Markdown
Owner

Which app was unable to use VoxSherpa as a TTS engine and was crashing/failing to bind to the TTS service?

I tested both the current version and your PR build with Android System TTS and @voice, and both work correctly for me. I just want to know which specific app was affected.

@kazemcodes

Copy link
Copy Markdown
Contributor Author

I tried to use IReader app and LNReader app, both use tts engine from android to read books
I tried everything and finally found the problem in your code after changing that, the whole issue in tts is fixed easily and now both are working fine,
I think both app are using direct tts service in android, so that they could control speed, pitch sound, change voice directly in app for better experience, and your service intent, I haven't found it in android docs, where did you get it?

@kazemcodes

Copy link
Copy Markdown
Contributor Author

If you are not sure, I return that permission that was remove , and just add that service intent, I think that will fix my issue (not sure need to try again and text again I think)

@kazemcodes

Copy link
Copy Markdown
Contributor Author

I searched everywhere and don't see any android.permission.BIND_TEXT_TO_SPEECH_ENGINE in internet and offical android docs

@kazemcodes

kazemcodes commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor Author

This is my app https://github.com/IReaderorg/IReader

I was searching for a good offline tta engine, and found yours tried and found it's not working then find issue In your code

@CodeBySonu95

Copy link
Copy Markdown
Owner

I don't know much about the Android TTS service configuration, but I noticed these two lines:

"android.intent.action.TTS_service"
"android.intent.action.TTS_SERVICE"

Why are both needed? Is "TTS_service" required for any specific app or compatibility reason?

@kazemcodes

kazemcodes commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor Author

I don't know much about the Android TTS service configuration, but I noticed these two lines:

"android.intent.action.TTS_service" "android.intent.action.TTS_SERVICE"

Why are both needed? Is "TTS_service" required for any specific app or compatibility reason?

the whole issue was your app permissions

android:permission="android.permission.BIND_TEXT_TO_SPEECH_ENGINE"  

doesn't exists at all

@kazemcodes

Copy link
Copy Markdown
Contributor Author

now everything is working fine, I removed that extra line

@kazemcodes

kazemcodes commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor Author

just removing the permission is enough, the code is ready for merge without any extra line

@CodeBySonu95
CodeBySonu95 merged commit 7f05a35 into CodeBySonu95:main Sep 6, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants