For a long time I am unable to cross-compile Kivy application to

49 views
Skip to first unread message

Robert

unread,
Oct 14, 2023, 8:36:14 PM10/14/23
to Kivy users support
Moved from  to...@cedro.info's post in another conversation

For a long time I am unable to cross-compile Kivy application to
Android and iOS too. I get APK but it crashes on launch.

https://github.com/kivy/python-for-android/issues/2773

The python bundle is there in the APK. I hoped after last release of
P4A things will get better. But I am unable to run even simple
examples applications!! Now I get some Java crashes tracebacks.

I have tried on Debian 11. Even bought new MacStudio to speed things
up. No change.

There is no solid solution that would make things work (i.e. vm
image). I am wondering how many people are converting their
applications to a mobile with success. Do they use Buildozer (I do) or
their own custom P4A scripts.

This does not look good. Technology change light is shining yellow and
towards red soon.


Robert

unread,
Oct 14, 2023, 9:35:23 PM10/14/23
to Kivy users support
I looked at your post on GitHub.
The issue seems to be related to the combination of the emulator and the app.
Normally I would suggest using a physical device instead, but there are other issues.

For a sanity check I suggest you build and run Hello World, exactly like this:
https://github.com/Android-for-Python/Android-for-Python-Users#try-hello-world
I hope you will find that it builds and runs just fine.

The example you showed uses a deprecated api. The clue is in the last paragraph here
https://github.com/Android-for-Python/Android-for-Python-Users#basic-pyjnius-usage
If you follow that advice you'll get a message that says the class does not exist.

I took a quick look at the deprecated code you referenced, the first issue I saw was
https://github.com/kivy/python-for-android/blob/develop/pythonforandroid/bootstraps/common/build/src/main/java/org/renpy/android/Hardware.java#L136
And a quick look at the Android docs shows:
https://developer.android.com/reference/android/hardware/Sensor#TYPE_ORIENTATION
Android 15 !!!! Deprecated along time ago.

How an emulator (with no motion sensor hardware) reacts to a long deprecated motion sensor api is hard to say, but it would be surprising if the result were good. The exact failure mechanism I would not choose to guess at.

A little searching and I found the source of the example
https://github.com/kivy/kivy/tree/master/examples/android
The other example uses a deprecated android api too. :(

I filed an issue https://github.com/kivy/kivy/issues/8407

There are some Android examples here (though not a compass)  https://github.com/Android-for-Python/INDEX-of-Examples
Reply all
Reply to author
Forward
0 new messages