kivy / buildozer

Generic Python packager for Android and iOS
https://buildozer.readthedocs.io
MIT License
1.65k stars 484 forks source link

[Buildozer 0.40.dev0, Buildozer 0.39] AttributeError: 'Buildozer' object has no attribute 'translate_target' #812

Closed mboy1011 closed 5 years ago

mboy1011 commented 5 years ago

Versions

Description

I couldn't build my first app and even update orother commands due to an error: AttributeError: 'Buildozer' object has no attribute 'translate_target'.

Thanks in advanced. πŸ‘

buildozer.spec

Command:

buildozer android debug deploy run
buildozer android debug
buildozer build
buildozer android build

Spec file:

[app]

# (str) Title of your application
title = My Application

# (str) Package name
package.name = myapp

# (str) Package domain (needed for android/ios packaging)
package.domain = org.test

# (str) Source code where the main.py live
source.dir = .

# (list) Source files to include (let empty to include all the files)
source.include_exts = py,png,jpg,kv,atlas

# (list) List of inclusions using pattern matching
#source.include_patterns = assets/*,images/*.png

# (list) Source files to exclude (let empty to not exclude anything)
#source.exclude_exts = spec

# (list) List of directory to exclude (let empty to not exclude anything)
#source.exclude_dirs = tests, bin

# (list) List of exclusions using pattern matching
#source.exclude_patterns = license,images/*/*.jpg

# (str) Application versioning (method 1)
version = 0.1

# (str) Application versioning (method 2)
# version.regex = __version__ = ['"](.*)['"]
# version.filename = %(source.dir)s/main.py

# (list) Application requirements
# comma separated e.g. requirements = sqlite3,kivy
requirements = python3,kivy

# (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes
# requirements.source.kivy = ../../kivy

# (list) Garden requirements
#garden_requirements =

# (str) Presplash of the application
#presplash.filename = %(source.dir)s/data/presplash.png

# (str) Icon of the application
#icon.filename = %(source.dir)s/data/icon.png

# (str) Supported orientation (one of landscape, sensorLandscape, portrait or all)
orientation = portrait

# (list) List of service to declare
#services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PY

#
# OSX Specific
#

#
# author = Β© Copyright Info

# change the major version of python used by the app
osx.python_version = 3

# Kivy version to use
osx.kivy_version = 1.9.1

#
# Android specific
#

# (bool) Indicate if the application should be fullscreen or not
fullscreen = 0

# (string) Presplash background color (for new android toolchain)
# Supported formats are: #RRGGBB #AARRGGBB or one of the following names:
# red, blue, green, black, white, gray, cyan, magenta, yellow, lightgray,
# darkgray, grey, lightgrey, darkgrey, aqua, fuchsia, lime, maroon, navy,
# olive, purple, silver, teal.
#android.presplash_color = #FFFFFF

# (list) Permissions
#android.permissions = INTERNET

# (int) Target Android API, should be as high as possible.
#android.api = 27

# (int) Minimum API your APK will support.
#android.minapi = 21

# (int) Android SDK version to use
#android.sdk = 20

# (str) Android NDK version to use
#android.ndk = 17c

# (int) Android NDK API to use. This is the minimum API your app will support, it should usually match android.minapi.
#android.ndk_api = 21

# (bool) Use --private data storage (True) or --dir public storage (False)
#android.private_storage = True

# (str) Android NDK directory (if empty, it will be automatically downloaded.)
#android.ndk_path =

# (str) Android SDK directory (if empty, it will be automatically downloaded.)
#android.sdk_path =

# (str) ANT directory (if empty, it will be automatically downloaded.)
#android.ant_path =

# (bool) If True, then skip trying to update the Android sdk
# This can be useful to avoid excess Internet downloads or save time
# when an update is due and you just want to test/build your package
# android.skip_update = False

# (bool) If True, then automatically accept SDK license
# agreements. This is intended for automation only. If set to False,
# the default, you will be shown the license when first running
# buildozer.
# android.accept_sdk_license = False

# (str) Android entry point, default is ok for Kivy-based app
#android.entrypoint = org.renpy.android.PythonActivity

# (list) Pattern to whitelist for the whole project
#android.whitelist =

# (str) Path to a custom whitelist file
#android.whitelist_src =

# (str) Path to a custom blacklist file
#android.blacklist_src =

# (list) List of Java .jar files to add to the libs so that pyjnius can access
# their classes. Don't add jars that you do not need, since extra jars can slow
# down the build process. Allows wildcards matching, for example:
# OUYA-ODK/libs/*.jar
#android.add_jars = foo.jar,bar.jar,path/to/more/*.jar

# (list) List of Java files to add to the android project (can be java or a
# directory containing the files)
#android.add_src =

# (list) Android AAR archives to add (currently works only with sdl2_gradle
# bootstrap)
#android.add_aars =

# (list) Gradle dependencies to add (currently works only with sdl2_gradle
# bootstrap)
#android.gradle_dependencies =

# (list) Java classes to add as activities to the manifest.
#android.add_activites = com.example.ExampleActivity

# (str) python-for-android branch to use, defaults to master
#p4a.branch = master

# (str) OUYA Console category. Should be one of GAME or APP
# If you leave this blank, OUYA support will not be enabled
#android.ouya.category = GAME

# (str) Filename of OUYA Console icon. It must be a 732x412 png image.
#android.ouya.icon.filename = %(source.dir)s/data/ouya_icon.png

# (str) XML file to include as an intent filters in <activity> tag
#android.manifest.intent_filters =

# (str) launchMode to set for the main activity
#android.manifest.launch_mode = standard

# (list) Android additional libraries to copy into libs/armeabi
#android.add_libs_armeabi = libs/android/*.so
#android.add_libs_armeabi_v7a = libs/android-v7/*.so
#android.add_libs_x86 = libs/android-x86/*.so
#android.add_libs_mips = libs/android-mips/*.so

# (bool) Indicate whether the screen should stay on
# Don't forget to add the WAKE_LOCK permission if you set this to True
#android.wakelock = False

# (list) Android application meta-data to set (key=value format)
#android.meta_data =

# (list) Android library project to add (will be added in the
# project.properties automatically.)
#android.library_references =

# (str) Android logcat filters to use
#android.logcat_filters = *:S python:D

# (bool) Copy library instead of making a libpymodules.so
#android.copy_libs = 1

# (str) The Android arch to build for, choices: armeabi-v7a, arm64-v8a, x86
android.arch = armeabi-v7a

#
# Python for android (p4a) specific
#

# (str) python-for-android git clone directory (if empty, it will be automatically cloned from github)
#p4a.source_dir =

# (str) The directory in which python-for-android should look for your own build recipes (if any)
#p4a.local_recipes =

# (str) Filename to the hook for p4a
#p4a.hook =

# (str) Bootstrap to use for android builds
# p4a.bootstrap = sdl2

# (int) port number to specify an explicit --port= p4a argument (eg for bootstrap flask)
#p4a.port =

#
# iOS specific
#

# (str) Path to a custom kivy-ios folder
#ios.kivy_ios_dir = ../kivy-ios
# Alternately, specify the URL and branch of a git checkout:
ios.kivy_ios_url = https://github.com/kivy/kivy-ios
ios.kivy_ios_branch = master

# Another platform dependency: ios-deploy
# Uncomment to use a custom checkout
#ios.ios_deploy_dir = ../ios_deploy
# Or specify URL and branch
ios.ios_deploy_url = https://github.com/phonegap/ios-deploy
ios.ios_deploy_branch = 1.7.0

# (str) Name of the certificate to use for signing the debug version
# Get a list of available identities: buildozer ios list_identities
#ios.codesign.debug = "iPhone Developer: <lastname> <firstname> (<hexstring>)"

# (str) Name of the certificate to use for signing the release version
#ios.codesign.release = %(ios.codesign.debug)s

[buildozer]

# (int) Log level (0 = error only, 1 = info, 2 = debug (with command output))
log_level = 1

# (int) Display warning if buildozer is run as root (0 = False, 1 = True)
warn_on_root = 1

# (str) Path to build artifact storage, absolute or relative to spec file
# build_dir = ./.buildozer

# (str) Path to build output (i.e. .apk, .ipa) storage
# bin_dir = ./bin

#    -----------------------------------------------------------------------------
#    List as sections
#
#    You can define all the "list" as [section:key].
#    Each line will be considered as a option to the list.
#    Let's take [app] / source.exclude_patterns.
#    Instead of doing:
#
#[app]
#source.exclude_patterns = license,data/audio/*.wav,data/images/original/*
#
#    This can be translated into:
#
#[app:source.exclude_patterns]
#license
#data/audio/*.wav
#data/images/original/*
#

#    -----------------------------------------------------------------------------
#    Profiles
#
#    You can extend section / key with a profile
#    For example, you want to deploy a demo version of your application without
#    HD content. You could first change the title to add "(demo)" in the name
#    and extend the excluded directories to remove the HD content.
#
#[app@demo]
#title = My Application (demo)
#
#[app:source.exclude_patterns@demo]
#images/hd/*
#
#    Then, invoke the command line with the "demo" profile:
#
#buildozer --profile demo android debug

Logs

Traceback (most recent call last):
  File "C:\Users\mboy1011\scoop\apps\python\current\scripts\buildozer-script.py", line 11, in <module>
    load_entry_point('buildozer', 'console_scripts', 'buildozer')()
  File "c:\users\mboy1011\github\buildozer\buildozer\scripts\client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "c:\users\mboy1011\github\buildozer\buildozer\__init__.py", line 1040, in run_command
    print('Unknown command/target {}'.format(self.translate_target(command, inverse=True)))
AttributeError: 'Buildozer' object has no attribute 'translate_target'
AndreMiras commented 5 years ago

Thank you for the bug report, looks like a bug we've introduced in https://github.com/kivy/buildozer/pull/806 Edit: So it's a minor bug since it only appears when we use invalid target parameters, but still we should have a clear message rather than this bug. Basically it appears because you used buildozer build and the build target doesn't exist. Second parameter must be the target such as android.

mboy1011 commented 5 years ago

@AndreMiras Noted, thanks.

erickvinsan commented 5 years ago

I'm with the same problem...

AndreMiras commented 5 years ago

This should be fixed in master via https://github.com/kivy/buildozer/pull/821 Try updating to master:

pip install --upgrade https://github.com/kivy/buildozer/archive/afebba5.zip
erickvinsan commented 5 years ago

I ran this code:

pip install --upgrade https://github.com/kivy/buildozer/archive/afebba5.zip

But, ununfortunately, it keeps showing this message:

Traceback (most recent call last): File "c:\programdata\anaconda3\envs\android\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "c:\programdata\anaconda3\envs\android\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\ProgramData\Anaconda3\envs\android\Scripts\buildozer.exe__main__.py", line 9, in File "c:\programdata\anaconda3\envs\android\lib\site-packages\buildozer\scripts\client.py", line 13, in main Buildozer().run_command(sys.argv[1:]) File "c:\programdata\anaconda3\envs\android\lib\site-packages\buildozer__init__.py", line 1040, in run_command print('Unknown command/target {}'.format(self.translate_target(command, inverse=True))) AttributeError: 'Buildozer' object has no attribute 'translate_target'

AndreMiras commented 5 years ago

Yes true story, let me reopen. But in reality you have two other problem First problem is you're using buildozer wrong. Can you show which command you used? Second problem you're running on Windows and I'm not sure this is really supported

erickvinsan commented 5 years ago

I'm using the demo code of kivy installation. From that folder I execute this:

"buildozer init"

And then:

"buildozer android debug deploy run"

And yes I think that the main problem is that I'm trying to run buildozer on windows 10. Do you think that run in a virtual machine with buildozer is going to fix it?

Thank you in advance!

AndreMiras commented 5 years ago

OK could you share the full log including the command line you're typing please? These commands should not fail like this actually. And yes a VM even Docker would help for sure

erickvinsan commented 5 years ago

Of Course!

(android) C:\ProgramData\Anaconda3\envs\android\share\kivy-examples\demo\showcase>pip install --upgrade https://github.com/kivy/buildozer/archive/afebba5.zip
Collecting https://github.com/kivy/buildozer/archive/afebba5.zip
  Downloading https://github.com/kivy/buildozer/archive/afebba5.zip
     | 890kB 17.5MB/s
Requirement already satisfied, skipping upgrade: pexpect in c:\programdata\anaconda3\envs\android\lib\site-packages (from buildozer==0.40.dev0) (4.6.0)
Requirement already satisfied, skipping upgrade: virtualenv in c:\programdata\anaconda3\envs\android\lib\site-packages (from buildozer==0.40.dev0) (16.4.0)
Requirement already satisfied, skipping upgrade: sh in c:\programdata\anaconda3\envs\android\lib\site-packages (from buildozer==0.40.dev0) (1.12.14)
Requirement already satisfied, skipping upgrade: ptyprocess>=0.5 in c:\programdata\anaconda3\envs\android\lib\site-packages (from pexpect->buildozer==0.40.dev0) (0.6.0)
Building wheels for collected packages: buildozer
  Building wheel for buildozer (setup.py) ... done
  Stored in directory: C:\Users\erick\AppData\Local\Temp\pip-ephem-wheel-cache-ltkw8vzt\wheels\c0\87\f5\0008b3981f3909da2994754d6999dd385241aed6ff55f4dafd
Successfully built buildozer
Installing collected packages: buildozer
  Found existing installation: buildozer 0.33
    Uninstalling buildozer-0.33:
      Successfully uninstalled buildozer-0.33
Successfully installed buildozer-0.40.dev0

(android) C:\ProgramData\Anaconda3\envs\android\share\kivy-examples\demo\showcase>buildozer init
I 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
ERROR: You already have a buildozer.spec file.

(android) C:\ProgramData\Anaconda3\envs\android\share\kivy-examples\demo\showcase>buildozer init
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
File buildozer.spec created, ready to customize!

(android) C:\ProgramData\Anaconda3\envs\android\share\kivy-examples\demo\showcase>buildozer android debug deploy run
I 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
Traceback (most recent call last):
  File "c:\programdata\anaconda3\envs\android\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\programdata\anaconda3\envs\android\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\ProgramData\Anaconda3\envs\android\Scripts\buildozer.exe\__main__.py", line 9, in <module>
  File "c:\programdata\anaconda3\envs\android\lib\site-packages\buildozer\scripts\client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "c:\programdata\anaconda3\envs\android\lib\site-packages\buildozer\__init__.py", line 1040, in run_command
    print('Unknown command/target {}'.format(self.translate_target(command, inverse=True)))
AttributeError: 'Buildozer' object has no attribute 'translate_target'
erickvinsan commented 5 years ago

AndreMiras, Unfortunately, the same error occur in VM Buildozer/Kivy...

root@kivyvm:/home/kivy/Desktop/showcase#` sudo pip install -U buildozer
Collecting buildozer
  Downloading https://files.pythonhosted.org/packages/49/07/62f479998ea5e8680ad33f0fbafdc96f721cbad69ff90cc957988b8cd252/buildozer-0.39.tar.gz (108kB)
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 112kB 1.2MB/s 
Collecting pexpect (from buildozer)
  Downloading https://files.pythonhosted.org/packages/89/e6/b5a1de8b0cc4e07ca1b305a4fcc3f9806025c1b651ea302646341222f88b/pexpect-4.6.0-py2.py3-none-any.whl (57kB)
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 61kB 1.7MB/s 
Collecting virtualenv (from buildozer)
  Downloading https://files.pythonhosted.org/packages/7e/1b/6c00d57127608793e16e8b7f813e64d58a1938505c42fe190d1386ab41e1/virtualenv-16.4.0-py2.py3-none-any.whl (2.0MB)
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 2.0MB 440kB/s 
Collecting sh (from buildozer)
  Downloading https://files.pythonhosted.org/packages/4a/22/17b22ef5b049f12080f5815c41bf94de3c229217609e469001a8f80c1b3d/sh-1.12.14-py2.py3-none-any.whl
Collecting ptyprocess>=0.5 (from pexpect->buildozer)
  Downloading https://files.pythonhosted.org/packages/d1/29/605c2cc68a9992d18dada28206eeada56ea4bd07a239669da41674648b6f/ptyprocess-0.6.0-py2.py3-none-any.whl
Building wheels for collected packages: buildozer
  Running setup.py bdist_wheel for buildozer ... done
  Stored in directory: /root/.cache/pip/wheels/9f/a9/69/1823cf5dea120ddaaa7f3ab202565357852f2668270e526359
Successfully built buildozer
Installing collected packages: ptyprocess, pexpect, virtualenv, sh, buildozer
  Found existing installation: ptyprocess 0.5.1
    Uninstalling ptyprocess-0.5.1:
      Successfully uninstalled ptyprocess-0.5.1
  Found existing installation: pexpect 4.2.1
    Uninstalling pexpect-4.2.1:
      Successfully uninstalled pexpect-4.2.1
  Found existing installation: virtualenv 15.1.0
    Uninstalling virtualenv-15.1.0:
      Successfully uninstalled virtualenv-15.1.0
  Found existing installation: sh 1.12.4
    Uninstalling sh-1.12.4:
      Successfully uninstalled sh-1.12.4
  Found existing installation: buildozer 0.32
    Uninstalling buildozer-0.32:
      Successfully uninstalled buildozer-0.32
Successfully installed buildozer-0.39 pexpect-4.6.0 ptyprocess-0.6.0 sh-1.12.14 virtualenv-16.4.0
You are using pip version 9.0.1, however version 19.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
root@kivyvm:/home/kivy/Desktop/showcase# buildozer android_new 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
Traceback (most recent call last):
  File "/usr/local/bin/buildozer", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/buildozer/scripts/client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "/usr/local/lib/python2.7/dist-packages/buildozer/__init__.py", line 1040, in run_command
    print('Unknown command/target {}'.format(self.translate_target(command, inverse=True)))
AttributeError: 'Buildozer' object has no attribute 'translate_target'
root@kivyvm:/home/kivy/Desktop/showcase# buildozer android_new debug deploy run logcat
# 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
Traceback (most recent call last):
  File "/usr/local/bin/buildozer", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/buildozer/scripts/client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "/usr/local/lib/python2.7/dist-packages/buildozer/__init__.py", line 1040, in run_command
    print('Unknown command/target {}'.format(self.translate_target(command, inverse=True)))
AttributeError: 'Buildozer' object has no attribute 'translate_target'
root@kivyvm:/home/kivy/Desktop/showcase# pip install python3.5
Collecting python3.5
  Could not find a version that satisfies the requirement python3.5 (from versions: )
No matching distribution found for python3.5
You are using pip version 9.0.1, however version 19.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
root@kivyvm:/home/kivy/Desktop/showcase# pip install python
Requirement already satisfied: python in /usr/lib/python2.7/lib-dynload
You are using pip version 9.0.1, however version 19.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
root@kivyvm:/home/kivy/Desktop/showcase# sudo pip install -U buildozer
Requirement already up-to-date: buildozer in /usr/local/lib/python2.7/dist-packages
Requirement already up-to-date: virtualenv in /usr/local/lib/python2.7/dist-packages (from buildozer)
Requirement already up-to-date: pexpect in /usr/local/lib/python2.7/dist-packages (from buildozer)
Requirement already up-to-date: sh in /usr/local/lib/python2.7/dist-packages (from buildozer)
Requirement already up-to-date: ptyprocess>=0.5 in /usr/local/lib/python2.7/dist-packages (from pexpect->buildozer)
You are using pip version 9.0.1, however version 19.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
root@kivyvm:/home/kivy/Desktop/showcase# rm -rf ~/.buildozer/android/packages
root@kivyvm:/home/kivy/Desktop/showcase# sudo pip install -U buildozer
Requirement already up-to-date: buildozer in /usr/local/lib/python2.7/dist-packages
Requirement already up-to-date: virtualenv in /usr/local/lib/python2.7/dist-packages (from buildozer)
Requirement already up-to-date: pexpect in /usr/local/lib/python2.7/dist-packages (from buildozer)
Requirement already up-to-date: sh in /usr/local/lib/python2.7/dist-packages (from buildozer)
Requirement already up-to-date: ptyprocess>=0.5 in /usr/local/lib/python2.7/dist-packages (from pexpect->buildozer)
You are using pip version 9.0.1, however version 19.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
root@kivyvm:/home/kivy/Desktop/showcase# buildozer android_new release
# 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
Traceback (most recent call last):
  File "/usr/local/bin/buildozer", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/buildozer/scripts/client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "/usr/local/lib/python2.7/dist-packages/buildozer/__init__.py", line 1040, in run_command
    print('Unknown command/target {}'.format(self.translate_target(command, inverse=True)))
AttributeError: 'Buildozer' object has no attribute 'translate_target'
root@kivyvm:/home/kivy/Desktop/showcase# buildozer android_new 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
Traceback (most recent call last):
  File "/usr/local/bin/buildozer", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/buildozer/scripts/client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "/usr/local/lib/python2.7/dist-packages/buildozer/__init__.py", line 1040, in run_command
    print('Unknown command/target {}'.format(self.translate_target(command, inverse=True)))
AttributeError: 'Buildozer' object has no attribute 'translate_target' 

I really appreciate the solution for this problem. :`(

AndreMiras commented 5 years ago

Yes last release had that bug. Give it a try on master instead pip install --upgrade https://github.com/kivy/buildozer/archive/3b023a2.zip By the way using pip with sudo is strongly discouraged. Also I think android_new target was dropped in master so simply use: buildozer android debug for instance

erickvinsan commented 5 years ago

I'm so sorry for the late in reporting the current situation on that problem.

As you said, we have to use the command: "buildozer android debug". And the main problem was that when we use the command "buildozer init" the file created has not the complete requirements filled correctly. So, when I was build the Showcase project it didn't work properly in the Android.

The solution was to fill the field 'requirements' with the dependencies that were lacking.

As a sugestion I would say to you to update the tutorials because that would finish with the doubts in general of the community.

OlivierGagnon commented 5 years ago

@erickvinsan what did you have to add to the file to make it work? thx

capathida commented 5 years ago

I got the same problem, but has not figured out what you meant with complete the requirements. What did you do?

AndreMiras commented 5 years ago

@powercat and @capathida can you show the output of your pip freeze And also share the complete log of your run of buildozer android debug or whatever command that's failing for you.

Diwahar00 commented 5 years ago

Me to same error .My first app

AndreMiras commented 5 years ago

@Diwahar00 nothing we can help with if you don't provide any debug info

AndreMiras commented 5 years ago

Should be fixed in master with recent commit.

pip install --upgrade https://github.com/kivy/buildozer/archive/4c2152b.zip

If you have a similar error, please make a bug report with full debug log, including the proof that you're running on master.

dudu9999 commented 5 years ago

Just missing out is that buildozer.spec only works on linux (Ubuntu). πŸ˜₯πŸ˜₯πŸ˜₯πŸ˜₯πŸ‘ŽπŸ‘ŽπŸ‘Ž

AndreMiras commented 5 years ago

I've never played with it, but there's now a Linux shell on Windows. You could give it a try. Good luck :muscle:

dudu9999 commented 5 years ago

@AndreMiras Thanks bro but I will install a virtual machine and play ubuntu on it, thanks for the answer!

The-White-Fang commented 5 years ago

@AndreMiras I ran into somewhat similar problem, I used 'buildozer init' edited the spec file and ran 'buildozer android debug' and this error followed line 1040, in run_command print('Unknown command/target {}'.format(self.translate_target(command, inverse=True))) AttributeError: 'Buildozer' object has no attribute 'translate_target'

AndreMiras commented 5 years ago

Yes you need to pip install the lastest version of buildozer from github master. This fix is not in the pypi release

The-White-Fang commented 5 years ago

@AndreMiras so I installed the version you asked for and now I'm getting "Unknown command/target android". Is there something that I'm doing wrong ?

AndreMiras commented 5 years ago

Without you sharing the command you ran it's not really easy to help. Please share full command and output. But please do on the Discord chat since we're hijacking this ticket with something unrelated

The-White-Fang commented 5 years ago

@AndreMiras Can you send me a link to discord channel ?

AndreMiras commented 5 years ago

https://github.com/kivy/buildozer#support https://chat.kivy.org

talhaanwarch commented 5 years ago

I am facing the same problem. 'Buildozer' object has no attribute 'translate_target' Then i updated it using pip install --upgrade https://github.com/kivy/buildozer/archive/3b023a2.zip and do buildozer android debug now i am getting this error I Check configuration tokens Unknown command/target android. I am using windows 10, should i go for ubunto or there is any fix?

AndreMiras commented 5 years ago

Yes you should go to Ubuntu or use the WSL, we don't support Windows anymore

ZJSWDYHM2018 commented 4 years ago

i had the same problem, but had resolved. the command 'buildozen android_new debug' is work at first. after i upgrade the 'pip' and 'buildozen', it become unwork and display the error message"'Buildozer' object has no attribute 'translate_target' ". so i use another command 'buildozer android debug ', it become work again.

ghost commented 4 years ago

hey guys i am with same prob plz help me..!! error is: print('Unknown command/target {}'.format(self.translate_target(command, inverse=True))) AttributeError: 'Buildozer' object has no attribute 'translate_target'

note that i use ubuntu 18.04

AndreMiras commented 4 years ago

Can't help without more info. We need the complete stacktrace, plus buildozer version at minimum

sabuhikhalili commented 4 years ago

I assume buildozer shouldn't work on other Linux versions like Manjaro?

tshirtman commented 4 years ago

No, it should, but we can't try and maintain every distribution, even all the popular ones, mostly ubuntu and arch linux are used by the developpers, so it should work on them, but you are welcome to contribute fixes if it doesn't work on a distribution you use.

sabuhikhalili commented 4 years ago

Some of the dependancies are missing in pamac. Do you think this may cause translate_target not found error?

AndreMiras commented 4 years ago

Please create a dedicated issue with full stacktrace so we can help. The issue you're hijacking was about Windows which we don't support anymore. But like tshirtman said, even though non of the dev nor CI have Manjaro, it should still work on most of the Linux distributions. So please create an issue with stack trace as this one is different.

sabuhikhalili commented 4 years ago

Sure. I didn't notice the issue was closed. I just switched to Linux ubuntu and at this level I don't have the same issue anymore.

BMarquiz commented 4 years ago

the cmd shows this

E:\barq apk>buildozer android debug

Check configuration tokens

Traceback (most recent call last): File "c:\users\broo\appdata\local\programs\python\python37-32\lib\runpy.py", l ine 193, in _run_module_as_main "main", mod_spec) File "c:\users\broo\appdata\local\programs\python\python37-32\lib\runpy.py", l ine 85, in _run_code exec(code, run_globals) File "C:\Users\Broo\AppData\Local\Programs\Python\Python37-32\Scripts\buildoze r.exe__main__.py", line 7, in File "c:\users\broo\appdata\local\programs\python\python37-32\lib\site-package s\buildozer\scripts\client.py", line 13, in main Buildozer().run_command(sys.argv[1:]) File "c:\users\broo\appdata\local\programs\python\python37-32\lib\site-package s\buildozer__init__.py", line 1040, in run_command print('Unknown command/target {}'.format(self.translate_target(command, inve rse=True))) AttributeError: 'Buildozer' object has no attribute 'translate_target'

E:\barq apk>

this is my spec file [app]

(str) Title of your application

title = My Application

(str) Package name

package.name = barq

(str) Package domain (needed for android/ios packaging)

package.domain = org.test

(str) Source code where the main.py live

source.dir = .

(list) Source files to include (let empty to include all the files)

source.include_exts = py,png,jpg,kv,txt,atlas

(list) List of inclusions using pattern matching

source.include_patterns = assets/,images/.png

(list) Source files to exclude (let empty to not exclude anything)

source.exclude_exts = spec

(list) List of directory to exclude (let empty to not exclude anything)

source.exclude_dirs = eel,tests, bin

(list) List of exclusions using pattern matching

source.exclude_patterns = license,images//.jpg

(str) Application versioning (method 1)

version = 0.1

(str) Application versioning (method 2)

version.regex = version = '"['"]

version.filename = %(source.dir)s/main.py

(list) Application requirements

comma separated e.g. requirements = sqlite3,kivy

requirements = python3,kivy

(str) Custom source folders for requirements

Sets custom source for any requirements with recipes

requirements.source.kivy = ../../kivy

(list) Garden requirements

garden_requirements =

(str) Presplash of the application

presplash.filename = %(source.dir)s/data/presplash.png

(str) Icon of the application

icon.filename = %(source.dir)s/data/icon.png

(str) Supported orientation (one of landscape, sensorLandscape, portrait or all)

orientation = portrait

(list) List of service to declare

services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PY

#

OSX Specific

#

#

author = © Copyright Info

change the major version of python used by the app

osx.python_version = 3

Kivy version to use

osx.kivy_version = 1.9.1

#

Android specific

#

(bool) Indicate if the application should be fullscreen or not

fullscreen = 0

(string) Presplash background color (for new android toolchain)

Supported formats are: #RRGGBB #AARRGGBB or one of the following names:

red, blue, green, black, white, gray, cyan, magenta, yellow, lightgray,

darkgray, grey, lightgrey, darkgrey, aqua, fuchsia, lime, maroon, navy,

olive, purple, silver, teal.

android.presplash_color = #FFFFFF

(list) Permissions

android.permissions = INTERNET

(int) Target Android API, should be as high as possible.

android.api = 27

(int) Minimum API your APK will support.

android.minapi = 21

(int) Android SDK version to use

android.sdk = 20

(str) Android NDK version to use

android.ndk = 17c

(int) Android NDK API to use. This is the minimum API your app will support, it should usually match android.minapi.

android.ndk_api = 21

(bool) Use --private data storage (True) or --dir public storage (False)

android.private_storage = True

(str) Android NDK directory (if empty, it will be automatically downloaded.)

android.ndk_path =

(str) Android SDK directory (if empty, it will be automatically downloaded.)

android.sdk_path =

(str) ANT directory (if empty, it will be automatically downloaded.)

android.ant_path =

(bool) If True, then skip trying to update the Android sdk

This can be useful to avoid excess Internet downloads or save time

when an update is due and you just want to test/build your package

android.skip_update = False

(bool) If True, then automatically accept SDK license

agreements. This is intended for automation only. If set to False,

the default, you will be shown the license when first running

buildozer.

android.accept_sdk_license = False

(str) Android entry point, default is ok for Kivy-based app

android.entrypoint = org.renpy.android.PythonActivity

(list) Pattern to whitelist for the whole project

android.whitelist =

(str) Path to a custom whitelist file

android.whitelist_src =

(str) Path to a custom blacklist file

android.blacklist_src =

(list) List of Java .jar files to add to the libs so that pyjnius can access

their classes. Don't add jars that you do not need, since extra jars can slow

down the build process. Allows wildcards matching, for example:

OUYA-ODK/libs/*.jar

android.add_jars = foo.jar,bar.jar,path/to/more/*.jar

(list) List of Java files to add to the android project (can be java or a

directory containing the files)

android.add_src =

(list) Android AAR archives to add (currently works only with sdl2_gradle

bootstrap)

android.add_aars =

(list) Gradle dependencies to add (currently works only with sdl2_gradle

bootstrap)

android.gradle_dependencies =

(list) Java classes to add as activities to the manifest.

android.add_activites = com.example.ExampleActivity

(str) python-for-android branch to use, defaults to master

p4a.branch = master

(str) OUYA Console category. Should be one of GAME or APP

If you leave this blank, OUYA support will not be enabled

android.ouya.category = GAME

(str) Filename of OUYA Console icon. It must be a 732x412 png image.

android.ouya.icon.filename = %(source.dir)s/data/ouya_icon.png

(str) XML file to include as an intent filters in tag

android.manifest.intent_filters =

(str) launchMode to set for the main activity

android.manifest.launch_mode = standard

(list) Android additional libraries to copy into libs/armeabi

android.add_libs_armeabi = libs/android/*.so

android.add_libs_armeabi_v7a = libs/android-v7/*.so

android.add_libs_x86 = libs/android-x86/*.so

android.add_libs_mips = libs/android-mips/*.so

(bool) Indicate whether the screen should stay on

Don't forget to add the WAKE_LOCK permission if you set this to True

android.wakelock = False

(list) Android application meta-data to set (key=value format)

android.meta_data =

(list) Android library project to add (will be added in the

project.properties automatically.)

android.library_references =

(str) Android logcat filters to use

android.logcat_filters = *:S python:D

(bool) Copy library instead of making a libpymodules.so

android.copy_libs = 1

(str) The Android arch to build for, choices: armeabi-v7a, arm64-v8a, x86

android.arch = armeabi-v7a

#

Python for android (p4a) specific

#

(str) python-for-android git clone directory (if empty, it will be automatically cloned from github)

p4a.source_dir =

(str) The directory in which python-for-android should look for your own build recipes (if any)

p4a.local_recipes =

(str) Filename to the hook for p4a

p4a.hook =

(str) Bootstrap to use for android builds

p4a.bootstrap = sdl2

(int) port number to specify an explicit --port= p4a argument (eg for bootstrap flask)

p4a.port =

#

iOS specific

#

(str) Path to a custom kivy-ios folder

ios.kivy_ios_dir = ../kivy-ios

Alternately, specify the URL and branch of a git checkout:

ios.kivy_ios_url = https://github.com/kivy/kivy-ios ios.kivy_ios_branch = master

Another platform dependency: ios-deploy

Uncomment to use a custom checkout

ios.ios_deploy_dir = ../ios_deploy

Or specify URL and branch

ios.ios_deploy_url = https://github.com/phonegap/ios-deploy ios.ios_deploy_branch = 1.7.0

(str) Name of the certificate to use for signing the debug version

Get a list of available identities: buildozer ios list_identities

ios.codesign.debug = "iPhone Developer: ()"

(str) Name of the certificate to use for signing the release version

ios.codesign.release = %(ios.codesign.debug)s

[buildozer]

(int) Log level (0 = error only, 1 = info, 2 = debug (with command output))

log_level = 1

(int) Display warning if buildozer is run as root (0 = False, 1 = True)

warn_on_root = 1

(str) Path to build artifact storage, absolute or relative to spec file

build_dir = ./.buildozer

(str) Path to build output (i.e. .apk, .ipa) storage

bin_dir = ./bin

-----------------------------------------------------------------------------

List as sections

#

You can define all the "list" as [section:key].

Each line will be considered as a option to the list.

Let's take [app] / source.exclude_patterns.

Instead of doing:

#

[app]

source.exclude_patterns = license,data/audio/.wav,data/images/original/

#

This can be translated into:

#

[app:source.exclude_patterns]

license

data/audio/*.wav

data/images/original/*

#

-----------------------------------------------------------------------------

Profiles

#

You can extend section / key with a profile

For example, you want to deploy a demo version of your application without

HD content. You could first change the title to add "(demo)" in the name

and extend the excluded directories to remove the HD content.

#

[app@demo]

title = My Application (demo)

#

[app:source.exclude_patterns@demo]

images/hd/*

#

Then, invoke the command line with the "demo" profile:

#

buildozer --profile demo android debug

runnig in windows7 32bit

Manav1918 commented 4 years ago

I am running buildozer on windows 10 I have successfully installed buildozor init creating space file but On typing command : buildozer - v android debug (running on windows cmd) Showing error that, Unknown command/target android

How to resolve this. Plz help