Closed mboy1011 closed 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
.
@AndreMiras Noted, thanks.
I'm with the same problem...
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
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
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
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!
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
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
[91m[1mBuildozer is running as root![0m
[91mThis is [1mnot[0m [91mrecommended, and may lead to problems later.[0m
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
[91m[1mBuildozer is running as root![0m
[91mThis is [1mnot[0m [91mrecommended, and may lead to problems later.[0m
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
[91m[1mBuildozer is running as root![0m
[91mThis is [1mnot[0m [91mrecommended, and may lead to problems later.[0m
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'
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. :`(
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
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.
@erickvinsan what did you have to add to the file to make it work? thx
I got the same problem, but has not figured out what you meant with complete the requirements. What did you do?
@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.
Me to same error .My first app
@Diwahar00 nothing we can help with if you don't provide any debug info
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.
Just missing out is that buildozer.spec only works on linux (Ubuntu). π₯π₯π₯π₯πππ
I've never played with it, but there's now a Linux shell on Windows. You could give it a try. Good luck :muscle:
@AndreMiras Thanks bro but I will install a virtual machine and play ubuntu on it, thanks for the answer!
@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'
Yes you need to pip install the lastest version of buildozer from github master. This fix is not in the pypi release
@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 ?
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
@AndreMiras Can you send me a link to discord channel ?
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?
Yes you should go to Ubuntu or use the WSL, we don't support Windows anymore
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.
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
Can't help without more info. We need the complete stacktrace, plus buildozer version at minimum
I assume buildozer shouldn't work on other Linux versions like Manjaro?
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.
Some of the dependancies are missing in pamac. Do you think this may cause translate_target not found error?
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.
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.
the cmd shows this
E:\barq apk>buildozer android debug
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
E:\barq apk>
this is my spec file [app]
title = My Application
package.name = barq
package.domain = org.test
source.dir = .
source.include_exts = py,png,jpg,kv,txt,atlas
source.include_patterns = assets/,images/.png
source.exclude_dirs = eel,tests, bin
version = 0.1
requirements = python3,kivy
icon.filename = %(source.dir)s/data/icon.png
orientation = portrait
#
#
#
osx.python_version = 3
osx.kivy_version = 1.9.1
#
#
fullscreen = 0
android.permissions = INTERNET
android.api = 27
android.minapi = 21
android.arch = armeabi-v7a
#
#
#
#
ios.kivy_ios_url = https://github.com/kivy/kivy-ios ios.kivy_ios_branch = master
ios.ios_deploy_url = https://github.com/phonegap/ios-deploy ios.ios_deploy_branch = 1.7.0
[buildozer]
log_level = 1
warn_on_root = 1
#
#
#
#
#
#
#
#
#
#
runnig in windows7 32bit
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
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:
Spec file:
Logs