App built with buildozer crashing

58 views
Skip to first unread message

Ondřej Pelikán

unread,
Jan 14, 2021, 11:14:47 AM1/14/21
to Kivy users support
Hello, I build an app with buildozer on ubuntu and installed it on my android using Android studio. App loaded, screens worked, but sound did not. So, I tried to fix it by converting it from mp3 to wav and then used
 
 ffmpeg -i "orig_thrmlpu2.wav" -f wav -acodec pcm_s16le -ar 22050 -ac 1 "ffmpeg_thrmlpu2.wav"
 
on the wav files. Suddenly the app turns black and freezes after the loading screen.
Here is the log from android studio and my app:


There are no errors apart from those which I got even when the app worked so I am clueless. 

planckp...@gmail.com

unread,
Jan 14, 2021, 12:32:35 PM1/14/21
to Kivy users support
1) The log is filtered, basically only showing Python events. Any event that abuses Android won't show.
Try
adb install -r my.apk
adb logcat -c
adb logcat > log.txt
The log will be huge, and it may be difficult to see the issue.

2) If you share code, first cut it down to the smallest possible example (think Hello World).

3) I don't think (but I don't really know this) that Soundloader plays .wav on Android

4) Go back to using .mp3 , debug that case.

5) Does this work (with mp3) ? 

Ondřej Pelikán

unread,
Jan 14, 2021, 2:15:33 PM1/14/21
to Kivy users support
Thanks for reacting so fast. So I have reduced the code in gist and added the log. It doesn´t really say anything to me :( What do you mean if kivy.core.audio works? On windows the mp3 files played. I have converted it to wav becouse of this:  https://stackoverflow.com/questions/62732454/unable-to-load-mp3-file-using-kivy-on-android
And I also got these while building the app with buildozer:
I/python: [WARNING] [Audio ] Unable to find a loader for </data/data/cz.ondra.bocka/files/app/Radcapes-1.mp3>

Robert Flatt

unread,
Jan 14, 2021, 3:22:10 PM1/14/21
to Kivy users support
OK I really didn't know about mp3 on Android. Sorry for taking your time.

Robert Flatt

unread,
Jan 14, 2021, 3:29:41 PM1/14/21
to Kivy users support
Curious I tried this test case (a small test case is always the way to go) which worked on Android
Default buildozer.spec , except: kivy==2.0.0 and  .wav added to source.include_exts  (just to put the .wav in the apk for easy testing) 
.wav is attached.

from kivy.app import App
from kivy.core.audio import SoundLoader
from kivy.uix.button import Button

class SoundTestApp(App):
    def build(self):
        return Button(text='Play', on_press=self.play)

    def play(self,b):
        sound = SoundLoader.load('StarWars3.wav')  
        sound.play()

SoundTestApp().run()
StarWars3.wav

Ondřej Pelikán

unread,
Jan 14, 2021, 3:44:01 PM1/14/21
to Kivy users support
"kivy==2.0.0" belongs in 
reguirements = python3,kivy==2.0.0
???

Dne čtvrtek 14. ledna 2021 21:29:41 UTC+1 Robert Flatt napsal(a):

planckp...@gmail.com

unread,
Jan 14, 2021, 9:21:19 PM1/14/21
to Kivy users support
yes
and do a
buildozer appclean
before the next build

iron...@gmail.com

unread,
Jan 15, 2021, 3:55:50 PM1/15/21
to Kivy users support
okey so your test app worked for me as well. I tried to do the appclean and added kivy==2.0.0, but nothing has changed :(  I added newest android studio log to my gist

Dne pátek 15. ledna 2021 v 3:21:19 UTC+1 uživatel planckp...@gmail.com napsal:

planckp...@gmail.com

unread,
Jan 15, 2021, 4:10:39 PM1/15/21
to Kivy users support
I did not expect 2.0.0 to change anything, I just happened to use the latest.

We know the component works, so pilot error is a possibility.
Do the usual debug stuff, print statements in the app to see if what you think is happening really is.....
Where are your wav files coming from? Are they really there?
Reply all
Reply to author
Forward
0 new messages