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

Buildozer 0.35 with IndexError: list index out of range on Mac OS #737

Closed
zhangy10 opened this issue Oct 30, 2018 · 4 comments
Closed

Buildozer 0.35 with IndexError: list index out of range on Mac OS #737

zhangy10 opened this issue Oct 30, 2018 · 4 comments

Comments

@zhangy10
Copy link

Versions

  • Python: python2.7
  • OS: Mac Mojave 10.14
  • Kivy: v1.10.1
  • Cython: 0.25.2

Description

Hi, this is the first time that I try to use buildozer to compile a simple python project to Android App. And I already set up all required stuff for running buildozer, but got an error after applying the: buildozer android debug, and not quite sure how to solve it. Please anyone help me out. Many thanks.

buildozer.spec

Command:

1. buildozer init
2. buildozer android debug
3. got error output

Spec file:

title = Zac App
package.name = zacapp
package.domain = org.zac
source.dir = .
source.include_exts = py,png,jpg,kv,atlas
version = 0.1

requirements = kivy
orientation = portrait
osx.python_version = 3
osx.kivy_version = 1.10.1

fullscreen = 0
android.api = 27
android.minapi = 21
android.sdk = 27
android.ndk = r18b
android.ndk_path = /Users/zhangyu/Documents/Developing/android-sdk-macosx/ndk-bundle
android.sdk_path = /Users/zhangyu/Documents/Developing/android-sdk-macosx

Logs


# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Search for Git (git)
#  -> found at /usr/bin/git
# Search for Cython (cython)
#  -> found at /Users/zhangyu/anaconda2/bin/cython
# Search for Java compiler (javac)
#  -> found at /System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/javac
# Search for Java keytool (keytool)
#  -> found at /System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/keytool
# Install platform
Traceback (most recent call last):
  File "/Users/zhangyu/anaconda2/bin/buildozer", line 11, in <module>
    sys.exit(main())
  File "/Users/zhangyu/anaconda2/lib/python2.7/site-packages/buildozer/scripts/client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "/Users/zhangyu/anaconda2/lib/python2.7/site-packages/buildozer/__init__.py", line 1059, in run_command
    self.target.run_commands(args)
  File "/Users/zhangyu/anaconda2/lib/python2.7/site-packages/buildozer/target.py", line 92, in run_commands
    func(args)
  File "/Users/zhangyu/anaconda2/lib/python2.7/site-packages/buildozer/target.py", line 102, in cmd_debug
    self.buildozer.prepare_for_build()
  File "/Users/zhangyu/anaconda2/lib/python2.7/site-packages/buildozer/__init__.py", line 176, in prepare_for_build
    self.target.install_platform()
  File "/Users/zhangyu/anaconda2/lib/python2.7/site-packages/buildozer/targets/android.py", line 467, in install_platform
    self._install_p4a()
  File "/Users/zhangyu/anaconda2/lib/python2.7/site-packages/buildozer/targets/android.py", line 524, in _install_p4a
    deps = re.findall("^install_reqs = (\[[^\]]*\])", setup, re.DOTALL | re.MULTILINE)[0]
IndexError: list index out of range

Simple Project Code

import kivy as k

k.require('1.10.1')

from kivy.app import App as ap
from kivy.uix.button import Label as la

class ZacKivy(ap):
def build(self):
return la(text="hi zac it's kivy!!!!!!!!!!!!!!!!");
# custom layout, the name should be the same with this class name and lowercase is ok
# return la()

if name == 'main':
zacapp = ZacKivy()
zacapp.run()

@AndreMiras
Copy link
Member

Dup of #731
Fixed in #736
Simply pip install buildozer master

@zhangy10
Copy link
Author

zhangy10 commented Oct 31, 2018

Dup of #731
Fixed in #736
Simply pip install buildozer master

Hi AndreMiras,

Many thanks for your help and it works, but I got another error, which the log is below:

Log

192-168-1-3:kivy_test zhangyu$ buildozer android release
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Search for Git (git)
#  -> found at /usr/bin/git
# Search for Cython (cython)
#  -> found at /Users/zhangyu/anaconda2/bin/cython
# Search for Java compiler (javac)
#  -> found at /System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/javac
# Search for Java keytool (keytool)
#  -> found at /System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/keytool
# Install platform
# Run "pip install -q --user 'appdirs' 'colorama>=0.3.3' 'jinja2' 'six'"
# Cwd None
# Android ANT is missing, downloading
# Downloading http://archive.apache.org/dist/ant/binaries/apache-ant-1.9.4-bin.tar.gz
# Run 'tar xzf apache-ant-1.9.4-bin.tar.gz'
# Cwd /Users/zhangyu/.buildozer/android/platform
# Apache ANT installation done.
# Android SDK found at /Users/zhangyu/Documents/Developing/android-sdk-macosx
# Android NDK found at /Users/zhangyu/Documents/Developing/android-sdk-macosx/ndk-bundle
# Run '/Users/zhangyu/Documents/Developing/android-sdk-macosx/tools/android list sdk -u -e'
# Cwd /Users/zhangyu/.buildozer/android/platform
*************************************************************************
The "android" command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager
*************************************************************************
"android" SDK commands can be translated to sdkmanager commands on a best-effort basis.
Continue? (This prompt can be suppressed with the --use-sdk-wrapper command-line argument
or by setting the USE_SDK_WRAPPER environment variable) [y/N]: y
/Users/zhangyu/Documents/Developing/android-sdk-macosx/tools/android: line 118: ${trysdkresponse,,}: bad substitution
Invalid or unsupported command "list sdk -u -e"

Supported commands are:
android list target
android list avd
android list device
android create avd
android move avd
android delete avd
android list sdk
android update sdk
# Command failed: /Users/zhangyu/Documents/Developing/android-sdk-macosx/tools/android list sdk -u -e
# 
# 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

And it seems that android sdk commands have been changed in some ways and the "android list sdk -u -e" doesn't work for the sdk 27.

So, could you please help me out? Thanks so much.

Cheers.
Yu

@AndreMiras
Copy link
Member

Have you searched in the issue tracker -> kivy/python-for-android#1070
Also this is not a support platform, but a bug tracker. You can look for help on Discord and if you find a NEW bug please report 😃

@amoh-godwin
Copy link

Versions

* Python: python2.7

* OS: Mac Mojave 10.14

* Kivy: v1.10.1

* Cython: 0.25.2

Description

Hi, this is the first time that I try to use buildozer to compile a simple python project to Android App. And I already set up all required stuff for running buildozer, but got an error after applying the: buildozer android debug, and not quite sure how to solve it. Please anyone help me out. Many thanks.

buildozer.spec

Command:

1. buildozer init
2. buildozer android debug
3. got error output

Spec file:

title = Zac App
package.name = zacapp
package.domain = org.zac
source.dir = .
source.include_exts = py,png,jpg,kv,atlas
version = 0.1

requirements = kivy
orientation = portrait
osx.python_version = 3
osx.kivy_version = 1.10.1

fullscreen = 0
android.api = 27
android.minapi = 21
android.sdk = 27
android.ndk = r18b
android.ndk_path = /Users/zhangyu/Documents/Developing/android-sdk-macosx/ndk-bundle
android.sdk_path = /Users/zhangyu/Documents/Developing/android-sdk-macosx

Logs


# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Search for Git (git)
#  -> found at /usr/bin/git
# Search for Cython (cython)
#  -> found at /Users/zhangyu/anaconda2/bin/cython
# Search for Java compiler (javac)
#  -> found at /System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/javac
# Search for Java keytool (keytool)
#  -> found at /System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/keytool
# Install platform
Traceback (most recent call last):
  File "/Users/zhangyu/anaconda2/bin/buildozer", line 11, in <module>
    sys.exit(main())
  File "/Users/zhangyu/anaconda2/lib/python2.7/site-packages/buildozer/scripts/client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "/Users/zhangyu/anaconda2/lib/python2.7/site-packages/buildozer/__init__.py", line 1059, in run_command
    self.target.run_commands(args)
  File "/Users/zhangyu/anaconda2/lib/python2.7/site-packages/buildozer/target.py", line 92, in run_commands
    func(args)
  File "/Users/zhangyu/anaconda2/lib/python2.7/site-packages/buildozer/target.py", line 102, in cmd_debug
    self.buildozer.prepare_for_build()
  File "/Users/zhangyu/anaconda2/lib/python2.7/site-packages/buildozer/__init__.py", line 176, in prepare_for_build
    self.target.install_platform()
  File "/Users/zhangyu/anaconda2/lib/python2.7/site-packages/buildozer/targets/android.py", line 467, in install_platform
    self._install_p4a()
  File "/Users/zhangyu/anaconda2/lib/python2.7/site-packages/buildozer/targets/android.py", line 524, in _install_p4a
    deps = re.findall("^install_reqs = (\[[^\]]*\])", setup, re.DOTALL | re.MULTILINE)[0]
IndexError: list index out of range

Simple Project Code

import kivy as k

k.require('1.10.1')

from kivy.app import App as ap
from kivy.uix.button import Label as la

class ZacKivy(ap):
def build(self):
return la(text="hi zac it's kivy!!!!!!!!!!!!!!!!");

custom layout, the name should be the same with this class name and lowercase is ok

return la()

if name == 'main':
zacapp = ZacKivy()
zacapp.run()

Please I am getting this same error in Linux-Ubuntu. I got it using the VM machine and now this. Please it hasn't been fixed.

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

3 participants