P
P
poka_nikto2018-02-16 16:04:00
linux
poka_nikto, 2018-02-16 16:04:00

How to resolve python-for-android error?

I'm on windows. You need to write in python/kivy for Android, but there were certain problems with building python code into apk. I did not find programs for Windows, only for Linux, so I downloaded and launched their virtual machine from the kivy site, in which there was Buildozer. Nothing happened with him, I started installing python-for-android. When you enter this command in the terminal:

p4a apk --requirements=python3,kivy --private $HOME/Documents/myapp.py --package=net.example.myapp --name="myapp" --version=0.5 --bootstrap=sdl2

Gives an error message
[INFO]: This python-for-android revamp is an experimental alpha release!
[INFO]: It should work (mostly), but you may experience missing features or bugs.
[INFO]: Will compile for the following archs: armeabi
[INFO]: Found Android API target in $ANDROIDAPI
Traceback (most recent call last):
File "/usr/local/bin/p4a", line 11, in
load_entry_point(' python-for-android==0.4', 'console_scripts', 'p4a')()
File "/usr/local/lib/python2.7/dist-packages/pythonforandroid/toolchain.py", line 754, in main
ToolchainCL ()
File "/usr/local/lib/python2.7/dist-packages/pythonforandroid/toolchain.py", line 343, in init
getattr(self, command_method_name)(unknown)
File "/usr/local/lib/python2.7/dist-packages/pythonforandroid/toolchain.py", line 87, in wrapper_func
user_ndk_ver=self.ndk_version)
File "/usr/local/lib/python2.7/dist- packages/pythonforandroid/build.py", line 227, in prepare_build_environment
targets = android('list').stdout.decode('utf-8').split('\n')
File "/usr/local/lib/ python2.7/dist-packages/sh.py", line 1245, in call
return RunningCommand(cmd, call_args, stdin, stdout, stderr)
File "/usr/local/lib/python2.7/dist-packages/sh. py", line 633, in init
self.wait()
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 651, in wait
self.handle_command_exit_code(exit_code)
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 672, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_2:
RAN: /home/kivy/Documents/android-sdk-21/tools/ android list
STDOUT:
********************************************** *************************
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
*********************************** *************************************
Invalid or unsupported command "list"
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
STDERR:

What can be done about it? (If anything, you can advise me some other program for these purposes :))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2018-02-16
@dimonchik2013

Python versions are exactly what you need? 2 and 3?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question