Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cffi's recipe problem in aab generation #2501

Closed
5 tasks done
buybuyxyz opened this issue Oct 11, 2021 · 2 comments
Closed
5 tasks done

cffi's recipe problem in aab generation #2501

buybuyxyz opened this issue Oct 11, 2021 · 2 comments

Comments

@buybuyxyz
Copy link

buybuyxyz commented Oct 11, 2021

Checklist

  • the issue is indeed a bug and not a support request
  • issue doesn't already exist: https://github.com/kivy/python-for-android/issues
  • I have a short, runnable example that reproduces the issue
  • I reproduced the problem with the latest development version (p4a.branch = develop)
  • I used the grave accent (aka backticks) to format code or logs when appropriated

Versions

  • Python:3.8.10
  • OS:Ubuntu 20.04
  • Kivy:2.0.0
  • Cython:0.29.24
  • OpenJDK:11.0.11

Description

// REPLACE ME: What are you trying to get done, what has happened, what went wrong, and what did you expect?

buildozer.spec

Command:

// REPLACE ME: buildozer command ran? e.g. buildozer android debug
buildozer android release
// Keep the triple grave accent (aka backquote/backtick) to have the code formatted

Spec file:

// REPLACE ME: Paste your buildozer.spec file here
changed following lines

package.domain = org.test1
requirements = python3,kivy,cffi
android.archs = arm64-v8a
p4a.branch = develop


### Logs

// REPLACE ME: Paste the build output containing the error
// Keep the triple grave accent (a.k.a. backquote/backtick) to have the code formatted

.............
[INFO]: <- directory context /home/youtube/kivy_buildozer_aab/app/helloworld_aab/.buildozer/android/platform/python-for-android
[INFO]: Building cffi for arm64-v8a
[INFO]: cffi apparently isn't already in site-packages
[INFO]: Building compiled components in cffi
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/youtube/kivy_buildozer_aab/app/helloworld_aab/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1294, in
main()
File "/home/youtube/kivy_buildozer_aab/app/helloworld_aab/.buildozer/android/platform/python-for-android/pythonforandroid/entrypoints.py", line 18, in main
ToolchainCL()
File "/home/youtube/kivy_buildozer_aab/app/helloworld_aab/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 728, in init
getattr(self, command)(args)
File "/home/youtube/kivy_buildozer_aab/app/helloworld_aab/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 151, in wrapper_func
build_dist_from_args(ctx, dist, args)
File "/home/youtube/kivy_buildozer_aab/app/helloworld_aab/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 210, in build_dist_from_args
build_recipes(build_order, python_modules, ctx,
File "/home/youtube/kivy_buildozer_aab/app/helloworld_aab/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 596, in build_recipes
recipe.build_arch(arch)
File "/home/youtube/kivy_buildozer_aab/app/helloworld_aab/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 1011, in build_arch
self.build_compiled_components(arch)
File "/home/youtube/kivy_buildozer_aab/app/helloworld_aab/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 1017, in build_compiled_components
env = self.get_recipe_env(arch)
File "/home/youtube/kivy_buildozer_aab/app/helloworld_aab/.buildozer/android/platform/python-for-android/pythonforandroid/recipes/cffi/init.py", line 40, in get_recipe_env
self.ctx.get_site_packages_dir(),
TypeError: get_site_packages_dir() missing 1 required positional argument: 'arch'

Command failed: /home/youtube/kivy_buildozer_aab/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=python3,kivy,cffi --arch arm64-v8a --copy-libs --color=always --storage-dir="/home/youtube/kivy_buildozer_aab/app/helloworld_aab/.buildozer/android/platform/build-arm64-v8a" --ndk-api=21 --ignore-setup-py --debug

ENVIRONMENT:

SHELL = '/bin/bash'

PWD = '/home/youtube/kivy_buildozer_aab/app/helloworld_aab'

LOGNAME = 'youtube'

HOME = '/home/youtube'

LANG = 'ja_JP.UTF-8'

VIRTUAL_ENV = '/home/youtube/kivy_buildozer_aab'

TERM = 'xterm-256color'

LIBVIRT_DEFAULT_URI = 'qemu:///system'

USER = 'youtube'

SHLVL = '0'

PS1 = '(kivy_buildozer_aab) ${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '

XDG_DATA_DIRS = '/usr/local/share:/usr/share:/var/lib/snapd/desktop'

PATH = '/home/youtube/.buildozer/android/platform/apache-ant-1.9.4/bin:/home/youtube/kivy_buildozer_aab/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin'

MAIL = '/var/mail/youtube'

OLDPWD = '/home/youtube/kivy_buildozer_aab/app'

_ = '/home/youtube/kivy_buildozer_aab/bin/buildozer'

PACKAGES_PATH = '/home/youtube/.buildozer/android/packages'

ANDROIDSDK = '/home/youtube/.buildozer/android/platform/android-sdk'

ANDROIDNDK = '/home/youtube/.buildozer/android/platform/android-ndk-r19c'

ANDROIDAPI = '27'

ANDROIDMINAPI = '21'

Buildozer failed to execute the last command

The error might be hidden in the log above this error

Please read the full log, and search for it before

raising an issue with buildozer itself.

In case of a bug report, please add a full log with log_level = 2

@buybuyxyz
Copy link
Author

buybuyxyz commented Oct 12, 2021

I found a way to avoid the error

pythonforandroid/recipes/cffi/__init__.py

self.ctx.get_site_packages_dir() => self.ctx.get_site_packages_dir(arch),

The same bug is found below files.
pythonforandroid/recipes/matplotlib/__init__.py
pythonforandroid/recipes/opencv/__init__.py
pythonforandroid/recipes/protobuf_cpp/__init__.py
pythonforandroid/recipes/twisted/__init__.py
pythonforandroid/recipes/xeddsa/__init__.py

@misl6
Copy link
Member

misl6 commented Oct 13, 2021

Fixed via #2503

@misl6 misl6 closed this as completed Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants