Edmund Witkowski
Edmund Witkowski

Reputation: 41

Buildozer and Python-for-Android

I created a Conda Environment on my Manjaro Linux system. As I develop a Kivy App and run it, it runs fine. Then when I go to compile it into an APK to run on my Android Tablet that's when I run into a strange problem. I can successfully create an APK and install it on my Tablet. But... Python-For-Android downloads packages, that I aleady have installed, when building my APK. Sometimes it downloads versions I'm not using. and Sometimes it can't find a package that I already have installed.

My Question is this: How can I override (maybe in my Buildozer Spec file) P4A downloading packages (I guess it's called recipes) and to JUST USE the packages I already have downloaded and installed in my Conda Environment. (this way my compiled APK will be exactly identical to the Kivy App I'm running on my Linux machine.)

Upvotes: 0

Views: 902

Answers (1)

inclement
inclement

Reputation: 29488

I run into a strange problem. I can successfully create an APK and install it on my Tablet. But... Python-For-Android downloads packages, that I aleady have installed, when building my APK. Sometimes it downloads versions I'm not using

This isn't a strange problem, it's just how python-for-android works. It needs to install packages for the android environment, which isn't necessarily possible using what you have locally, and even if it was it's still a simpler way for python-for-android to operate.

My Question is this: How can I override (maybe in my Buildozer Spec file) P4A downloading packages (I guess it's called recipes) and to JUST USE the packages I already have downloaded and installed in my Conda Environment

You can't. There are options in the buildozer.spec file to specify the source directory for a given recipe, but this needs to be pointed at the source directory of the project (i.e. for a python module the root directory with a setup.py), not the installed package in another python environment.

Depending on how conda caches packages, you might be able to point it at what it's pulled, but this won't work for e.g. wheels.

this way my compiled APK will be exactly identical to the Kivy App I'm running on my Linux machine.

If this is your goal, you can specify versions for things using requirements=package==version, e.g. requirements=colorama==0.4.4. However, for packages installed using recipes not all versions may be supported, it's normally a good idea to use the defaults. For instance, only certain python3 minor versions are supported.

Upvotes: 1

Related Questions