Reputation: 29
I have built an android app using kivy and while I was compiling it to build an apk using buildozer, the following error popped up;
[INFO]: -> directory context /home/himanshu/helplineapp/.buildozer/android/platform/build/build/other_builds/pyjnius-python2-sdl2/armeabi-v7a/pyjnius
[INFO]: -> running python.host -c import sys; print(sys.path)
working: ['', '/home/himanshu/helplineapp/.buildozer/android/platform/build/build/python-instal[INFO]: Trying first build of pyjnius to get cython files: this is expected to fail
[INFO]: -> running python.host setup.py build_ext -v
('cwd is', '/home/himanshu/helplineapp/.buildozer/android/platform/build/build/other_builds/pyjnius-python2-sdl2/armeabi-v7a/pyjnius')
working: #error Do not use this file, it is the result of a failed Cython compilatiException in thread background thread for pid 3379:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/himanshu/.local/lib/python2.7/site-packages/sh.py", line 1540, in wrap
fn(*args, **kwargs)
File "/home/himanshu/.local/lib/python2.7/site-packages/sh.py", line 2455, in background_thread
handle_exit_code(exit_code)
File "/home/himanshu/.local/lib/python2.7/site-packages/sh.py", line 2153, in fn
return self.command.handle_command_exit_code(exit_code)
File "/home/himanshu/.local/lib/python2.7/site-packages/sh.py", line 815, in handle_command_exit_code
raise exc
ErrorReturnCode_1:
RAN: /home/himanshu/helplineapp/.buildozer/android/platform/build/build/python-installs/myapp/bin/python.host setup.py build_ext -v
STDOUT:
/home/himanshu/helplineapp/.buildozer/android/platform/build/build/python-installs/myapp/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
running build_ext
building 'jnius' extension
/usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer -D__ANDROID_API__=19 -I/home/himanshu/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm -isysroot /home/himanshu/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm -I/home/himanshu/helplineapp/.buildozer/android/platform/build/build/python-installs/myapp/include/python2.7 -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -DANDROID -mandroid -fomit-frame-pointer -D__ANDROID_API__=19 -I/home/himanshu/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm -isysroot /home/himanshu/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm -I/home/himanshu/helplineapp/.buildozer/android/platform/build/build/python-installs/myapp/include/python2.7 -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -I/home/himanshu/helplineapp/.buildozer/android/platform/build/build/python-installs/myapp/include/python2.7 -c jnius/jnius.c -o build/temp.linux-x86_64-2.7/jnius/jnius.o
jnius/jnius.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
#error Do not use this file, it is the result of a failed Cython compilation.
^
error: command '/usr/bin/ccache' failed with exit status 1
STDERR:
[INFO]: pyjnius first build failed (as expected)
[INFO]: Running cython where appropriate
[INFO]: Cythonize jnius/jnius.pyx
[INFO]: -> running cython ./jnius/jnius.pyx
()
working: for interface in getattr(value, '__javainterfaces__', []): Exception in thread background thread for pid 3389:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/himanshu/.local/lib/python2.7/site-packages/sh.py", line 1540, in wrap
fn(*args, **kwargs)
File "/home/himanshu/.local/lib/python2.7/site-packages/sh.py", line 2455, in background_thread
handle_exit_code(exit_code)
File "/home/himanshu/.local/lib/python2.7/site-packages/sh.py", line 2153, in fn
return self.command.handle_command_exit_code(exit_code)
File "/home/himanshu/.local/lib/python2.7/site-packages/sh.py", line 815, in handle_command_exit_code
raise exc
ErrorReturnCode_1:
RAN: /usr/local/bin/cython ./jnius/jnius.pyx
STDOUT:
Error compiling Cython file:
------------------------------------------------------------
...
if jcs is not None:
obj = jcs.j_cls
if NULL == obj:
for interface in getattr(value, '__javainterfaces__', []):
obj = j_env[0].FindClass(j_env, str_for_c(interface))
^
------------------------------------------------------------
jnius/jnius_export_class.pxi:133:57: Obtaining 'char *' from temporary Python value
STDERR:
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/himanshu/helplineapp/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 978, in <module>
main()
File "/home/himanshu/helplineapp/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 975, in main
ToolchainCL()
File "/home/himanshu/helplineapp/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 512, in __init__
getattr(self, args.subparser_name.replace('-', '_'))(args)
File "/home/himanshu/helplineapp/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 149, in wrapper_func
build_dist_from_args(ctx, dist, args)
File "/home/himanshu/helplineapp/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 193, in build_dist_from_args
build_recipes(build_order, python_modules, ctx)
File "pythonforandroid/build.py", line 573, in build_recipes
File "pythonforandroid/recipe.py", line 928, in build_arch
File "pythonforandroid/recipe.py", line 963, in build_cython_components
File "pythonforandroid/recipe.py", line 1008, in cythonize_build
File "pythonforandroid/recipe.py", line 999, in cythonize_file
File "pythonforandroid/logger.py", line 175, in shprint
File "/home/himanshu/.local/lib/python2.7/site-packages/sh.py", line 863, in next
self.wait()
File "/home/himanshu/.local/lib/python2.7/site-packages/sh.py", line 792, in wait
self.handle_command_exit_code(exit_code)
File "/home/himanshu/.local/lib/python2.7/site-packages/sh.py", line 815, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:
RAN: /usr/local/bin/cython ./jnius/jnius.pyx
STDOUT:
Error compiling Cython file:
------------------------------------------------------------
...
if jcs is not None:
obj = jcs.j_cls
if NULL == obj:
for interface in getattr(value, '__javainterfaces__', []):
obj = j_env[0].FindClass(j_env, str_for_c(interface))
^
------------------------------------------------------------
jnius/jnius_export_class.pxi:133:57: Obtaining 'char *' from temporary Python value
STDERR:
# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir=/home/himanshu/helplineapp/.buildozer/android/platform/build
#
# 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
I know that there is some issue with latest version of cython and so I downgraded to cython==0.20 but no luck, still the same error. I have already compiled two more programs using buildozer by downgrading cython but now, in this case, I don't know whats happening. Some other answers here say that raising log level 2 in buildozer.spec file will clarify the details of the error but I am new to buildozer. I don't know how to do that.
Also, this process takes too long while it downloads SDK tools and so I am limited with resources. I request humbly to please help me getting rid of this error.
Thanks in advance!
Upvotes: 2
Views: 1983
Reputation: 743
I had something very similar in regards to cython versions. I only ever managed to get my buildozer to work with cython 0.23. It took many hours and many reinstalls to figure that out...
Perhaps give cython 0.23 a try. I can personally confirm that it works with buildozer 0.34.dev0.
Upvotes: 1