I am referring this issue on behalf of another user from StackOverflow, complete information from this link (https://stackoverflow.com/questions/54208752/buildozer-problem-i-try-to-make-apk-file-for-android-but-i-cant).
User installed buildozer==0.38.dev0 on a linux machine running Python2.7. the latest commit (https://github.com/kivy/buildozer/commit/46cc8f715b7b5355b820744b787e8a470448596e#diff-a7a8fbdcb0c6b890e68f17892e805f1b) is causing Traceback error below.
Command:
buildozer android debug
Spec file:
unknown
r@DESKTOP-SMKQONQ:~/Suka$ ls
buildozer.spec main.py
artur@DESKTOP-SMKQONQ:~/Suka$ buildozer android debug
Traceback (most recent call last):
File "/usr/local/bin/buildozer", line 10, 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 122, in __init__
self.config.read(filename, "utf-8")
TypeError: read() takes exactly 2 arguments (3 given)
Thanks for the comprehensive bug report, there's a fix attempt here https://github.com/kivy/buildozer/pull/791
Still ongoing in Buildozer 0.38.
I also have the problem in 0.38.dev0
I installed the 0.38 because I hope it solved my bug "buildozer android NDK not downloading Ubuntu" from stackoverflow
Yes we would like to write the regression test before/with the fix. Pull requests are welcome, the regression test should be written in tests/test_buildozer.py and it should be fairly easy.
For record here's what the regression test could look like https://github.com/kivy/buildozer/pull/799
And the fix https://github.com/kivy/buildozer/pull/791 was merged
Please reopen. After the fix I get:
usage: toolchain.py [-h] [--private PRIVATE] --package PACKAGE --name NAME
[--numeric-version NUMERIC_VERSION] --version VERSION
[--orientation ORIENTATION] [--launcher] [--icon ICON]
[--permission PERMISSIONS [PERMISSIONS ...]]
[--meta-data META_DATA] [--presplash PRESPLASH]
[--presplash-color PRESPLASH_COLOR] [--wakelock]
[--window] [--blacklist BLACKLIST] [--whitelist WHITELIST]
[--add-jar ADD_JAR] [--add-aar ADD_AAR] [--depend DEPENDS]
[--sdk SDK_VERSION] [--minsdk MIN_SDK_VERSION]
[--intent-filters INTENT_FILTERS] [--service SERVICES]
[--add-source EXTRA_SOURCE_DIRS]
[--try-system-python-compile] [--no-compile-pyo] [--sign]
toolchain.py: error: unrecognized arguments: --ndk-api 9
Adding the reported line:
Command failed: /usr/bin/python -m pythonforandroid.toolchain apk --debug --bootstrap=sdl2 --dist_name oscservice --name 'Kivy service OSC demo' --version 0.1 --package org.kivy.oscservice --android_api 19 --minsdk 9 --ndk-api 9 --private /home/joachim/PycharmProjects/kivy_service_osc/.buildozer/android/app --permission INTERNET --orientation sensor --window --copy-libs --arch armeabi-v7a --color=always --storage-dir="/home/joachim/PycharmProjects/kivy_service_osc/.buildozer/android/platform/build"
It's not the same issue. And I think your p4a is outdated, make sure to be on master and clean installation. There's already a ticket on p4a with what you described
The error is still there after installing
sudo pip install --upgrade git+https://github.com/kivy/python-for-android.git
Collecting git+https://github.com/kivy/python-for-android.git
Cloning https://github.com/kivy/python-for-android.git to /tmp/pip-req-build-6bnvzR
Requirement already satisfied, skipping upgrade: appdirs in /usr/local/lib/python2.7/dist-packages (from python-for-android==0.6.0) (1.4.3)
Requirement already satisfied, skipping upgrade: colorama>=0.3.3 in /usr/local/lib/python2.7/dist-packages (from python-for-android==0.6.0) (0.4.1)
Requirement already satisfied, skipping upgrade: jinja2 in /usr/local/lib/python2.7/dist-packages (from python-for-android==0.6.0) (2.10)
Requirement already satisfied, skipping upgrade: six in /usr/lib/python2.7/dist-packages (from python-for-android==0.6.0) (1.10.0)
Requirement already satisfied, skipping upgrade: enum34 in /usr/lib/python2.7/dist-packages (from python-for-android==0.6.0) (1.1.2)
Requirement already satisfied, skipping upgrade: sh>=1.10 in /usr/local/lib/python2.7/dist-packages (from python-for-android==0.6.0) (1.12.4)
Requirement already satisfied, skipping upgrade: MarkupSafe>=0.23 in /usr/lib/python2.7/dist-packages (from jinja2->python-for-android==0.6.0) (0.23)
Installing collected packages: python-for-android
Found existing installation: python-for-android 0.6.0
Uninstalling python-for-android-0.6.0:
Successfully uninstalled python-for-android-0.6.0
Running setup.py install for python-for-android ... done
Successfully installed python-for-android-0.6.0
I saw now that when I specify
p4a.branch = master
the error above does not appear.
But now I get
I have in my buildozer.spec
requirements = python2, kivy
android.minapi = 17
Why is a python2 recipe selected?
I mean, why is a python 3 recipe selected?