python-for-android icon indicating copy to clipboard operation
python-for-android copied to clipboard

cannot find local recipe

Open Fak3 opened this issue 6 years ago • 3 comments

p4a version: git master os: opensuse tumbleweed

i have created ./recipes dir with __init__.py and kivy_async.py:

from pythonforandroid.recipes.kivy import KivyRecipe
class KivyAsyncRecipe(KivyRecipe):
    version = '1.11.0'
    url = 'https://github.com/matham/kivy/archive/async-support.zip'
    name = 'kivy_async'
recipe = KivyAsyncRecipe()

I tried to build apk with this custom recipe: p4a apk --private /home/z/pproj/paradox_ssh/ --version=1.7 --bootstrap=sdl2 --local-recipes="./recipes" --requirements=python3,kivy_async,openssl,sqlite3,pillow,requests,sdl2,plyer --whitelist=./whitelist.txt --permission=CALL_PHONE --permission=INTERNET --orientation=portrait --package=org.spbelect.paradox2 --name="paradox2" --release

Got an error:

No matching distribution found for kivy_async (from -r requirements.txt (line 1))

full p4a log: https://gist.github.com/Fak3/8a86d95421bc0694be23dfbc02e9923d

I tried to add debugger statements to my ./recipes/__init__.py but it looks like it never gets executed (imported) import ipdb; ipdb.sset_trace()

Fak3 avatar Jun 11 '19 11:06 Fak3

I think the directory structure should be more like:

recipes/
├── kivy_async
│   ├── __init__.py

Edit: su basically your recipe code should be in recipes/kivy_async/__init__.py

AndreMiras avatar Jun 11 '19 12:06 AndreMiras

Ah, thank you, it helped! This is a bit of unclear in the documentation and could be improved. The https://python-for-android.readthedocs.io/en/latest/recipes/ page only talks about the Recipe class and its methods, without mentioning that it has to be a directory. (note aside - i wonder why it can't be just a python module instead....)

Fak3 avatar Jun 11 '19 14:06 Fak3

Noting as documentation request on recipe production.

Julian-O avatar Nov 19 '23 02:11 Julian-O