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

Compiling Kivy app to apk fails with a pip error #631

Closed
ghost opened this issue Feb 27, 2018 · 2 comments
Closed

Compiling Kivy app to apk fails with a pip error #631

ghost opened this issue Feb 27, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Feb 27, 2018

When trying to compile a simple "Hello World" app using kivy, buildozer quits with the following output:

l-@eOS:~/Sample App$ buildozer android debug
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Install platform
# Command failed: pip install -q --user "appdirs" "colorama>=0.3.3" "sh>=1.10,<1.12.5" "jinja2" "six"
# 
# Buildozer failed to execute the last command
# If the error is not obvious, please raise the log_level to 2
# and retry the latest command.
# In case of a bug report, please add a full log with log_level = 2

When I run the command separately, it finishes without any output, when I check each package independently using pip, each package is already satisfied.
Have anyone else seen this error and/or know any fixes?

@ghost
Copy link
Author

ghost commented Feb 27, 2018

update: when Buildozer is run as root, a different error is thrown:

l-@eOS:~/Sample App$ sudo buildozer -v android debug
# Check configuration tokens
Buildozer is running as root!
This is not recommended, and may lead to problems later.
Are you sure you want to continue [y/n]? y
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Run 'dpkg --version'
# Cwd None
Debian `dpkg' package management program version 1.17.5 (amd64).
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.
# Search for Git (git)
#  -> found at /usr/bin/git
# Search for Cython (cython)
#  -> found at /usr/local/bin/cython
# Search for Java compiler (javac)
#  -> found at /usr/lib/jvm/java-7-openjdk-amd64/bin/javac
# Search for Java keytool (keytool)
#  -> found at /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/keytool
# Install platform
# Run 'pip install -q --user "appdirs" "colorama>=0.3.3" "sh>=1.10,<1.12.5" "jinja2" "six"'
# Cwd None
# Apache ANT found at /home/l-/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/l-/.buildozer/android/platform/android-sdk-20
# Android NDK found at /home/l-/.buildozer/android/platform/android-ndk-r9c
# Check application requirements
# Check garden requirements
# Compile platform
# Run '/usr/bin/python -m pythonforandroid.toolchain create --dist_name=helloworld --bootstrap=sdl2 --requirements=kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir=/home/l-/Sample App/.buildozer/android/platform/build'
# Cwd /home/l-/Sample App/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]:    Will compile for the following archs: armeabi-v7a
[INFO]:    Found Android API target in $ANDROIDAPI
[INFO]:    Available Android APIs are (19)
[INFO]:    Requested API target 19 is available, continuing.
[INFO]:    Found NDK dir in $ANDROIDNDK
[INFO]:    Got NDK version from $ANDROIDNDKVER
[INFO]:    Using Google NDK r9c
[INFO]:    Found virtualenv at /usr/local/bin/virtualenv
[INFO]:    Found the following toolchain versions: ['4.6', '4.8', 'clang3.3']
[INFO]:    Picking the latest gcc toolchain, here 4.8
[INFO]:    No existing dists meet the given requirements!
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, 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/l-/Sample App/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 978, in <module>
    main()
  File "/home/l-/Sample App/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 975, in main
    ToolchainCL()
  File "/home/l-/Sample App/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 512, in __init__
    getattr(self, args.subparser_name.replace('-', '_'))(args)
  File "/home/l-/Sample App/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 147, in wrapper_func
    info_notify('No dist exists that meets your requirements, '
  File "pythonforandroid/logger.py", line 101, in info_notify
    info('{}{}{}{}'.format(Err_Style.BRIGHT, Err_Fore.LIGHTBLUE_EX, s,
  File "pythonforandroid/logger.py", line 70, in __getattr__
    return getattr(self._real, key) if self._enabled else self._dict[key]
AttributeError: 'AnsiCodes' object has no attribute 'LIGHTBLUE_EX'
# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=helloworld --bootstrap=sdl2 --requirements=kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir=/home/l-/Sample App/.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

@sanezek
Copy link

sanezek commented Mar 3, 2018

install the colorama version > 0.3

pip install colorama --updrage

if that didn't work, install the applications from the sources

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