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

Fixed ringtone sound not playing in Release mode on Android #204

Merged
merged 1 commit into from
Dec 21, 2022

Conversation

mschudt
Copy link
Contributor

@mschudt mschudt commented Nov 14, 2022

Fixes #105 by using setDataSource(afd: AssetFileDescriptor) instead of setDataSource(context: Context, uri: Uri).
Using the URI-based method led to an exception (java.io.IOException: Prepare failed.: status=0x1) being thrown by MediaPlayer.prepare() which is fixed by using a file descriptor.
This works for the default system ringtone as well as sound files located in res/raw.

@booooohdan
Copy link

@hiennguyen92 please, do something or grant access to another contributor if you don't work on this package

@hiennguyen92 hiennguyen92 merged commit 5c2b6b7 into hiennguyen92:master Dec 21, 2022
@mschudt mschudt deleted the sound-fix branch March 28, 2023 16:19
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.

Sound not working in release mode
3 participants