Repository navigation
Closed
Description
Hi!
I am trying to get off the ground with p4a, but I run into an issue with pyjnius. Is this possibly linked to #454, since it's the same error about _io.so? I have Cython 0.23.4.
[INFO]: Building pyjnius for armeabi
('name is', 'jnius', <class 'pythonforandroid.recipes.pyjnius.PyjniusRecipe'>)
[INFO]: jnius apparently isn't already in site-packages
[INFO]: Cythonizing anything necessary in pyjnius
ccache found, will optimize builds
('path is', '/home/cag/android-ndk-r11c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86/bin/:/home/cag/android-ndk-r11c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/:/home/cag/android-ndk-r11c:/home/cag/.buildozer/android/platform/android-sdk-20/tools:/home/cag/.dotfiles/bin:/home/cag/.local/bin:/home/cag/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/bin:/bin:/usr/games')
[INFO]: -> directory context /home/cag/.local/share/python-for-android/build/other_builds/pyjnius-python2-sdl2/armeabi/pyjnius
[INFO]: -> running python.host -c import sys; print(sys.path)
('cwd is', '/home/cag/.local/share/python-for-android/build/other_builds/pyjnius-python2-sdl2/armeabi/pyjnius')
[INFO]: Trying first build of pyjnius to get cython files: this is expected to fail
[INFO]: -> running python.host setup.py build_ext -v
()
[INFO]: pyjnius first build failed (as expected)
[INFO]: Running cython where appropriate
[INFO]: Cythonize jnius/jnius.pyx
[INFO]: -> running cython ./jnius/jnius.pyx
[INFO]: -> running python.host setup.py build_ext -v
[INFO]: STDOUT:
/home/cag/.local/share/python-for-android/build/python-installs/testproject/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
running build_ext
failed to import Cython: /home/cag/.local/share/python-for-android/build/python-installs/testproject/lib/python2.7/lib-dynload/_io.so: wrong ELF class: ELFCLASS32
error: Cython does not appear to be installed
[INFO]: STDERR:
[INFO]: COMMAND:
cd /home/cag/.local/share/python-for-android/build/other_builds/pyjnius-python2-sdl2/armeabi/pyjnius && /home/cag/.local/share/python-for-android/build/python-installs/testproject/bin/python.host setup.py build_ext -v
[WARNING]: ERROR: /home/cag/.local/share/python-for-android/build/python-installs/testproject/bin/python.host failed!
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Metadata
Metadata
Assignees
Labels
No labels
Activity
inclement commentedon May 7, 2016
I'm not sure what's caused this. Can you post the full log, including the original p4a command?
cgcgcg commentedon May 7, 2016
This is what I get if I rerun it. Several components were built correctly..
inclement commentedon May 7, 2016
Thanks for the log, but unfortunately I can't see the problem. The _io.so thing relates to the python built for android trying to access its shared libraries, which doesn't work because they're built for arm32. That's why you can get a similar error in a number of ways, but it shouldn't happen with pyjnius and I can't think of why it would.
FeralBytes commentedon Jan 6, 2017
@cgcgcg let us know if @rafalo1333 's suggestion works. Thanks.
inclement commentedon Jan 15, 2017
I think @rafalo1333's suggestion was correct, and this should be fixed in master now.
KimYar commentedon Nov 3, 2021
Hi everyone,
I am getting the below error msg after running buildozer -v android debug and I couldn't find a solution. Could you please help me with this?
`
kivy is already unpacked, skipping
[INFO]: <- directory context /Users/appleapple/Desktop/CalendarIA/CAI/.buildozer/android/platform/python-for-android
[INFO]: # Prebuilding recipes
[INFO]: Prebuilding hostpython3 for armeabi-v7a
[INFO]: hostpython3 has no prebuild_armeabi_v7a, skipping
[INFO]: Applying patches for hostpython3[armeabi-v7a]
[INFO]: hostpython3 already patched, skipping
[INFO]: Prebuilding libffi for armeabi-v7a
[INFO]: libffi has no prebuild_armeabi_v7a, skipping
[INFO]: Applying patches for libffi[armeabi-v7a]
[INFO]: libffi already patched, skipping
[INFO]: Prebuilding openssl for armeabi-v7a
[INFO]: openssl has no prebuild_armeabi_v7a, skipping
[INFO]: Prebuilding sdl2_image for armeabi-v7a
[INFO]: sdl2_image has no prebuild_armeabi_v7a, skipping
[INFO]: Applying patches for sdl2_image[armeabi-v7a]
[INFO]: sdl2_image already patched, skipping
[INFO]: Prebuilding sdl2_mixer for armeabi-v7a
[INFO]: sdl2_mixer has no prebuild_armeabi_v7a, skipping
[INFO]: Applying patches for sdl2_mixer[armeabi-v7a]
[INFO]: sdl2_mixer already patched, skipping
[INFO]: Prebuilding sdl2_ttf for armeabi-v7a
[INFO]: sdl2_ttf has no prebuild_armeabi_v7a, skipping
[INFO]: Prebuilding sqlite3 for armeabi-v7a
[INFO]: sqlite3 has no prebuild_armeabi_v7a, skipping
[INFO]: Prebuilding python3 for armeabi-v7a
[INFO]: python3 has no prebuild_armeabi_v7a, skipping
[INFO]: Applying patches for python3[armeabi-v7a]
[INFO]: python3 already patched, skipping
[INFO]: Prebuilding sdl2 for armeabi-v7a
[INFO]: sdl2 has no prebuild_armeabi_v7a, skipping
[INFO]: Prebuilding setuptools for armeabi-v7a
[INFO]: setuptools has no prebuild_armeabi_v7a, skipping
[INFO]: Prebuilding six for armeabi-v7a
[INFO]: six has no prebuild_armeabi_v7a, skipping
[INFO]: Prebuilding pyjnius for armeabi-v7a
[INFO]: pyjnius has no prebuild_armeabi_v7a, skipping
[INFO]: Applying patches for pyjnius[armeabi-v7a]
[INFO]: pyjnius already patched, skipping
[INFO]: Prebuilding android for armeabi-v7a
[INFO]: android has no prebuild_armeabi_v7a, skipping
[INFO]: -> directory context /Users/appleapple/Desktop/CalendarIA/CAI/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/android-sdl2/armeabi-v7a__ndk_target_21/android
[INFO]: <- directory context /Users/appleapple/Desktop/CalendarIA/CAI/.buildozer/android/platform/python-for-android
[INFO]: Prebuilding kivy for armeabi-v7a
[INFO]: kivy has no prebuild_armeabi_v7a, skipping
[INFO]: # Building recipes
[INFO]: Building hostpython3 for armeabi-v7a
[INFO]: hostpython3 said it is already built, skipping
[INFO]: Building libffi for armeabi-v7a
[INFO]: libffi said it is already built, skipping
[INFO]: -> running cp /Users/appleapple/Desktop/CalendarIA/CAI/.buildozer/android/platform/build...(and 219 more)
[INFO]: Building openssl for armeabi-v7a
[INFO]: openssl said it is already built, skipping
[INFO]: -> running cp /Users/appleapple/Desktop/CalendarIA/CAI/.buildozer/android/platform/build...(and 391 more)
[INFO]: Building sdl2_image for armeabi-v7a
[INFO]: Building sdl2_mixer for armeabi-v7a
[INFO]: Building sdl2_ttf for armeabi-v7a
[INFO]: Building sqlite3 for armeabi-v7a
[INFO]: sqlite3 said it is already built, skipping
[INFO]: Building python3 for armeabi-v7a
[INFO]: python3 said it is already built, skipping
[INFO]: Building sdl2 for armeabi-v7a
[INFO]: -> directory context /Users/appleapple/Desktop/CalendarIA/CAI/.buildozer/android/platform/build-armeabi-v7a/build/bootstrap_builds/sdl2/jni
[INFO]: -> running ndk-build V=1 NDK_DEBUG=1
[INFO]: <- directory context /Users/appleapple/Desktop/CalendarIA/CAI/.buildozer/android/platform/python-for-android
[INFO]: Building setuptools for armeabi-v7a
[INFO]: Python package already exists in site-packages
[INFO]: setuptools said it is already built, skipping
[INFO]: Building six for armeabi-v7a
[INFO]: Python package already exists in site-packages
[INFO]: six said it is already built, skipping
[INFO]: Building pyjnius for armeabi-v7a
[INFO]: jnius apparently isn't already in site-packages
[INFO]: Cythonizing anything necessary in pyjnius
[INFO]: -> directory context /Users/appleapple/Desktop/CalendarIA/CAI/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/pyjnius-sdl2/armeabi-v7a__ndk_target_21/pyjnius
[INFO]: -> running python3 -c import sys; print(sys.path)
[INFO]: Trying first build of pyjnius to get cython files: this is expected to fail
[INFO]: -> running python3 setup.py build_ext -v
Exception in thread background thread for pid 63092:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/Users/appleapple/Desktop/CalendarIA/venv/lib/python3.7/site-packages/sh.py", line 1683, in wrap
fn(*rgs, **kwargs)
File "/Users/appleapple/Desktop/CalendarIA/venv/lib/python3.7/site-packages/sh.py", line 2662, in background_thread
handle_exit_code(exit_code)
File "/Users/appleapple/Desktop/CalendarIA/venv/lib/python3.7/site-packages/sh.py", line 2349, in fn
return self.command.handle_command_exit_code(exit_code)
File "/Users/appleapple/Desktop/CalendarIA/venv/lib/python3.7/site-packages/sh.py", line 905, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:
RAN: /Users/appleapple/Desktop/CalendarIA/CAI/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 setup.py build_ext -v
STDOUT:
The operation couldn’t be completed. Unable to locate a Java Runtime that supports javac.
Please visit http://www.java.com for information on installing Java.
Traceback (most recent call last):
File "setup.py", line 95, in
compile_native_invocation_handler(*get_possible_homes(PLATFORM))
File "setup.py", line 85, in compile_native_invocation_handler
subprocess.check_call([
File "/Users/appleapple/Desktop/CalendarIA/CAI/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Lib/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/javac', '-target', '1.7', '-source', '1.7', 'jnius/src/org/jnius/NativeInvocationHandler.java']' returned non-zero exit status 1.
STDERR:
[INFO]: pyjnius first build failed (as expected)
[INFO]: Running cython where appropriate
[INFO]: Cythonize jnius/jnius.pyx
[INFO]: -> running python3 -cimport sys; from Cython.Compiler.Main import setuptools_main; sys.exi...(and 39 more)
Exception in thread background thread for pid 63098:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/Users/appleapple/Desktop/CalendarIA/venv/lib/python3.7/site-packages/sh.py", line 1683, in wrap
fn(*rgs, **kwargs)
File "/Users/appleapple/Desktop/CalendarIA/venv/lib/python3.7/site-packages/sh.py", line 2662, in background_thread
handle_exit_code(exit_code)
File "/Users/appleapple/Desktop/CalendarIA/venv/lib/python3.7/site-packages/sh.py", line 2349, in fn
return self.command.handle_command_exit_code(exit_code)
File "/Users/appleapple/Desktop/CalendarIA/venv/lib/python3.7/site-packages/sh.py", line 905, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:
RAN: /Users/appleapple/Desktop/CalendarIA/venv/bin/python3 '-cimport sys; from Cython.Compiler.Main import setuptools_main; sys.exit(setuptools_main());' ./jnius/jnius.pyx
STDOUT:
/Users/appleapple/Desktop/CalendarIA/venv/lib/python3.7/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /Users/appleapple/Desktop/CalendarIA/CAI/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/pyjnius-sdl2/armeabi-v7a__ndk_target_21/pyjnius/jnius/jnius.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
Error compiling Cython file:
...
import sys
import traceback
include "jnius_compat.pxi"
include "jni.pxi"
include "config.pxi"
^
jnius/jnius.pyx💯0: 'config.pxi' not found
Error compiling Cython file:
...
include "jnius_compat.pxi"
include "jni.pxi"
include "config.pxi"
IF JNIUS_PLATFORM == "android":
^
jnius/jnius.pyx:102:3: Compile-time name 'JNIUS_PLATFORM' not defined
Error compiling Cython file:
...
include "jni.pxi"
include "config.pxi"
IF JNIUS_PLATFORM == "android":
include "jnius_jvm_android.pxi"
ELIF JNIUS_PLATFORM == "win32":
^
jnius/jnius.pyx:104:5: Compile-time name 'JNIUS_PLATFORM' not defined
Error compiling Cython file:
...
include "config.pxi"
^
jnius/jnius_jvm_dlopen.pxi:1:0: 'config.pxi' not found
Error compiling Cython file:
...
JAVA_HOME = os.getenv('JAVA_HOME') or find_java_home()
if JAVA_HOME is None or JAVA_HOME == '':
raise SystemError("JAVA_HOME is not set, and unable to guess JAVA_HOME")
cdef str JNIUS_LIB_SUFFIX = get_jnius_lib_location(JNIUS_PLATFORM)
IF JNIUS_PYTHON3:
^
jnius/jnius_jvm_dlopen.pxi:89:7: Compile-time name 'JNIUS_PYTHON3' not defined
Error compiling Cython file:
...
include "jnius_env.pxi"
include "jnius_utils.pxi"
include "jnius_conversion.pxi"
include "jnius_localref.pxi"
IF JNIUS_PYTHON3:
^
jnius/jnius.pyx:113:3: Compile-time name 'JNIUS_PYTHON3' not defined
STDERR:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/appleapple/Desktop/CalendarIA/CAI/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1276, in
main()
File "/Users/appleapple/Desktop/CalendarIA/CAI/.buildozer/android/platform/python-for-android/pythonforandroid/entrypoints.py", line 18, in main
ToolchainCL()
File "/Users/appleapple/Desktop/CalendarIA/CAI/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 725, in init
getattr(self, command)(args)
File "/Users/appleapple/Desktop/CalendarIA/CAI/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 153, in wrapper_func
build_dist_from_args(ctx, dist, args)
File "/Users/appleapple/Desktop/CalendarIA/CAI/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 215, in build_dist_from_args
args, "ignore_setup_py", False
File "/Users/appleapple/Desktop/CalendarIA/CAI/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 580, in build_recipes
recipe.build_arch(arch)
File "/Users/appleapple/Desktop/CalendarIA/CAI/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 1059, in build_arch
self.build_cython_components(arch)
File "/Users/appleapple/Desktop/CalendarIA/CAI/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 1084, in build_cython_components
self.cythonize_build(env=env)
File "/Users/appleapple/Desktop/CalendarIA/CAI/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 1132, in cythonize_build
self.cythonize_file(env, build_dir, join(root, filename))
File "/Users/appleapple/Desktop/CalendarIA/CAI/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 1123, in cythonize_file
filename, *self.cython_args, _env=cyenv)
File "/Users/appleapple/Desktop/CalendarIA/CAI/.buildozer/android/platform/python-for-android/pythonforandroid/logger.py", line 167, in shprint
for line in output:
File "/Users/appleapple/Desktop/CalendarIA/venv/lib/python3.7/site-packages/sh.py", line 953, in next
self.wait()
File "/Users/appleapple/Desktop/CalendarIA/venv/lib/python3.7/site-packages/sh.py", line 879, in wait
self.handle_command_exit_code(exit_code)
File "/Users/appleapple/Desktop/CalendarIA/venv/lib/python3.7/site-packages/sh.py", line 905, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:
RAN: /Users/appleapple/Desktop/CalendarIA/venv/bin/python3 '-cimport sys; from Cython.Compiler.Main import setuptools_main; sys.exit(setuptools_main());' ./jnius/jnius.pyx
STDOUT:
/Users/appleapple/Desktop/CalendarIA/venv/lib/python3.7/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /Users/appleapple/Desktop/CalendarIA/CAI/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/pyjnius-sdl2/armeabi-v7a__ndk_target_21/pyjnius/jnius/jnius.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
Error compiling Cython file:
...
import sys
import traceback
include "jnius_compat.pxi"
include "jni.pxi"
include "config.pxi"
^
jnius/jnius.pyx💯0: 'config.pxi' not found
Error compiling Cython file:
...
include "jnius_compat.pxi"
include "jni.pxi"
include "config.pxi"
IF JNIUS_PLATFORM == "android":
^
jnius/jnius.pyx:102:3: Compile-time name 'JNIUS_PLATFORM' not defined
Error compiling Cython file:
...
include "jni.pxi"
include "config.pxi"
IF JNIUS_PLATFORM == "android":
include "jnius_jvm_android.pxi"
ELIF JNIUS_PLATFORM == "win32":
^
jnius/jnius.pyx:104:5: Compile-time name 'JNIUS_PLATFORM' not defined
Error compiling Cython file:
...
include "config.pxi"
^
jnius/jnius_jvm_dlopen.pxi:1:0: 'config.pxi' not found
Error compiling Cython file:
...
JAVA_HOME = os.getenv('JAVA_HOME') or find_java_home()
if JAVA_HOME is None or JAVA_HOME == '':
raise SystemError("JAVA_HOME is not set, and unable to guess JAVA_HOME")
cdef str JNIUS_LIB_SUFFIX = get_jnius_lib_location(JNIUS_PLATFORM)
IF JNIUS_PYTHON3:
^
jnius/jnius_jvm_dlopen.pxi:89:7: Compile-time name 'JNIUS_PYTHON3' not defined
Error compiling Cython file:
...
include "jnius_env.pxi"
include "jnius_utils.pxi"
include "jnius_conversion.pxi"
include "jnius_localref.pxi"
IF JNIUS_PYTHON3:
^
jnius/jnius.pyx:113:3: Compile-time name 'JNIUS_PYTHON3' not defined
STDERR:
Command failed: /Users/appleapple/Desktop/CalendarIA/venv/bin/python -m pythonforandroid.toolchain create --dist_name=kvcalc --bootstrap=sdl2 --requirements=python3,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir="/Users/appleapple/Desktop/CalendarIA/CAI/.buildozer/android/platform/build-armeabi-v7a" --ndk-api=21
ENVIRONMENT:
TERM = 'xterm-256color'
SHELL = '/bin/bash'
TMPDIR = '/var/folders/38/s153lprs32d5n6sn_c19w8240000gn/T/'
CONDA_SHLVL = '0'
USER = 'appleapple'
COMMAND_MODE = 'unix2003'
CONDA_EXE = '/Users/appleapple/anaconda3/bin/conda'
SSH_AUTH_SOCK = '/private/tmp/com.apple.launchd.PpqkPympBV/Listeners'
__CF_USER_TEXT_ENCODING = '0x1F5:0x0:0x52'
VIRTUAL_ENV = '/Users/appleapple/Desktop/CalendarIA/venv'
_CE_CONDA = ''
PATH = '/Users/appleapple/.buildozer/android/platform/apache-ant-1.9.4/bin:/Users/appleapple/Desktop/CalendarIA/venv/bin:/Users/appleapple/anaconda3/condabin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/local/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Users/appleapple/anaconda3/condabin:/Library/Frameworks/Python.framework/Versions/3.7/bin'
TERMINAL_EMULATOR = 'JetBrains-JediTerm'
__CFBundleIdentifier = 'com.jetbrains.pycharm'
PWD = '/Users/appleapple/Desktop/CalendarIA/CAI'
XPC_FLAGS = '0x0'
PS1 = '(venv) \h:\W \u$ '
_CE_M = ''
XPC_SERVICE_NAME = '0'
SHLVL = '1'
HOME = '/Users/appleapple'
CONDA_PYTHON_EXE = '/Users/appleapple/anaconda3/bin/python'
LOGNAME = 'appleapple'
LC_CTYPE = 'en_CA.UTF-8'
DISPLAY = '/private/tmp/com.apple.launchd.JG7odCqoLs/org.macosforge.xquartz:0'
_ = '/Users/appleapple/Desktop/CalendarIA/venv/bin/buildozer'
OLDPWD = '/Users/appleapple/Desktop/CalendarIA'
PYVENV_LAUNCHER = '/Users/appleapple/Desktop/CalendarIA/venv/bin/python'
PACKAGES_PATH = '/Users/appleapple/.buildozer/android/packages'
ANDROIDSDK = '/Users/appleapple/.buildozer/android/platform/android-sdk'
ANDROIDNDK = '/Users/appleapple/.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
`