Skip to content Skip to sidebar Skip to footer

Simple Kivy App Press Button To Play Mp3 Doesn't Work On Android Device

I created a simple App. When pressed on a button to play a mp3 file. It works in terminal but when I compile it with buildozer and install on an android device only splash image ap

Solution 1:

In my case, mp3 file makes app crashed on android device, if the app is made by kivy SoundLoader and compiled by Buildozer. Use .wav or .ogg file, instead.

Solution 2:

When my app crashed, I found a traceback saying NoneType object has no attribute 'state'. So I made sure there was an

if <SOUND_FILE>:
    <SOUND_FILE>.play() # <SOUND_FILE>.state = 'play' | <SOUND_FILE>.stop()

whenever I wanted to change the state of the audio. Now I can open my app on an Android device and use it, but the audio won't play. That's what I'm trying to fix currently. I'm thinking the audio files are always None. So if you want to have mp3 files in your apkand you want your app to not crash on an Android device, you can try what I did.

Post a Comment for "Simple Kivy App Press Button To Play Mp3 Doesn't Work On Android Device"