I have a Kivy application that integrates with zmq and msgpack. I can successfully run the application in a Linux environment. When I build the same application with buildozer and install on Android, the application crashes before displaying to the screen. I looked a the logcat files, and not being very knowledgeable about Android, do not see any obvious reasons for the crash.
To help simplify things and to prove to myself I can configure the buildozer.spec file with a p4a recipe, I simply imported umsgack into my application, called some methods to encode and decode a string and use that to create the text for a button label.
Here is a snippet of what I changed in the spec file to get this to work:
# (list) Application requirements
# comma seperated e.g. requirements = sqlite3,kivy
requirements = kivy,umsgpack,zmq
# (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes
# requirements.source.kivy = ../../kivy
requirment.source.umsgpack = /usr/local/lib/python3.5/dist-packages/pythonforandroid/recipes/msgpack-python
I tried something similar with zeromq. I am only importing the file and not using any methods in zeromq to simplify things.
I added the following to buildozer.spec:
requirment.source.zmq = /usr/local/lib/python3.5/dist-packages/pythonforandroid/recipes/pyzmq
Here is my python main.py file:
__version__ ="1.0"
from kivy.app import App
from kivy.uix.button import Button
import umsgpack
import zmq
class TestApp(App):
def build(self):
s = umsgpack.packb('bye bye')
q = umsgpack.unpackb(s)
print(q)
return Button(text=q)
TestApp().run()
If I comment out the import zmq line, then the program can be loaded and run on the anrdoid device.
I also tried adding the following permissions to the .spec:
android.permissions = INTERNET,ACCESS_WIFI_STATE,ACCESS_NETWORK_STATE
Nothing changed by doing so. Any suggestions of what I am doing wrong would be appreciated.