Many errors in Buildozer log - is that why it gets stuck at "Deploy on ..."?

461 views
Skip to first unread message

Henrik R.

unread,
Aug 4, 2020, 4:12:06 PM8/4/20
to Kivy users support

Hi!



I managed to get Buildozer to work about 6 months ago, but now when I try again it gets stuck at "Deploy on ...".

I am using the same Android phone, same USB cable, Developer mode is enabled, USB-debugging is ON, and USB for file transfer is enabled.


Back then, some problems were solved by deleting the '.buildozer' folder in my Python project folder, so I tried that, and ran, in Terminal, the following commands:


$ buildozer -v android debug

$ buildozer android deploy run logcat


But the process is stuck at:


# Compile platform
# Deploy on ZY3224R37X

Then I ran:


$ buildozer -v android debug deploy run logcat > my_log.txt


I have attached the generated 'my_log.txt' file, and the 'buildozer.spec' file from the Python project folder.


The first command '$ buildozer -v android debug' generates a huge output in Terminal. For your convenience, I have tried including the error- and warning-messages hidden in that output here:



First the error messages (some of them include the text 'expected to fail'):


[INFO]:    -> running python3 setup.py build_ext -v
Exception in thread background thread for pid 5367:                                                                                                                   
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/henrik/.local/lib/python3.6/site-packages/sh.py", line 1540, in wrap
    fn(*args, **kwargs)
  File "/home/henrik/.local/lib/python3.6/site-packages/sh.py", line 2459, in background_thread
    handle_exit_code(exit_code)
  File "/home/henrik/.local/lib/python3.6/site-packages/sh.py", line 2157, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/henrik/.local/lib/python3.6/site-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 setup.py build_ext -v

  STDOUT:
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning



clang: error: no such file or directory: 'jnius/jnius.c'
clang: error: no input files
error: command '/home/henrik/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang' failed with exit status 1

  STDERR:

[INFO]:    pyjnius first build failed (as expected)



[INFO]:    Trying first build of android to get cython files: this is expected to fail                                                                                
[INFO]:    -> running python3 setup.py build_ext -v
Exception in thread background thread for pid 9317:                                                                                                                   
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/henrik/.local/lib/python3.6/site-packages/sh.py", line 1540, in wrap
    fn(*args, **kwargs)
  File "/home/henrik/.local/lib/python3.6/site-packages/sh.py", line 2459, in background_thread
    handle_exit_code(exit_code)
  File "/home/henrik/.local/lib/python3.6/site-packages/sh.py", line 2157, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/henrik/.local/lib/python3.6/site-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 setup.py build_ext -v

  STDOUT:
running build_ext
building 'android._android' extension
creating build
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/android



native-build -c android/_android.c -o build/temp.linux-x86_64-3.8/android/_android.o

clang: error: no such file or directory: 'android/_android.c'
clang: error: no input files
error: command '/home/henrik/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang' failed with exit status 1

  STDERR:

[INFO]:    android first build failed (as expected)
[INFO]:    Running cython where appropriate



[INFO]:    Trying first build of kivy to get cython files: this is expected to fail                                                                                   
[INFO]:    -> running python3 setup.py build_ext -v
Exception in thread background thread for pid 11726:                                                                                                                  
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/henrik/.local/lib/python3.6/site-packages/sh.py", line 1540, in wrap
    fn(*args, **kwargs)
  File "/home/henrik/.local/lib/python3.6/site-packages/sh.py", line 2459, in background_thread
    handle_exit_code(exit_code)
  File "/home/henrik/.local/lib/python3.6/site-packages/sh.py", line 2157, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/henrik/.local/lib/python3.6/site-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 setup.py build_ext -v

  STDOUT:
Using setuptools
Environ change use_sdl2 -> True
Not using cython on android
Using this graphics system: OpenGL ES 2
WARNING: A problem occurred while running pkg-config --libs --cflags sdl2 SDL2_ttf SDL2_image SDL2_mixer (code 1)

b"Package SDL2_ttf was not found in the pkg-config search path.\nPerhaps you should add the directory containing `SDL2_ttf.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'SDL2_ttf' found\nPackage SDL2_mixer was not found in the pkg-config search path.\nPerhaps you should add the directory containing `SDL2_mixer.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'SDL2_mixer' found\n"



native-build -c kivy/_event.c -o build/temp.linux-x86_64-3.8/kivy/_event.o

clang: error: no such file or directory: 'kivy/_event.c'
clang: error: no input files
 error: command '/home/henrik/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang' failed with exit status 1

  STDERR:

[INFO]:    kivy first build failed (as expected)


Compiling '/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/lib2to3/tests/data/bom.py'...
***   File "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/lib2to3/tests/data/bom.py", line 2
    print "BOM BOOM!"
          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("BOM BOOM!")?

Compiling '/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/lib2to3/tests/data/crlf.py'...
***   File "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/lib2to3/tests/data/crlf.py", line 1
    print "hi"
          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("hi")?

Compiling '/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/lib2to3/tests/data/different_encoding.py'...
***   File "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/lib2to3/tests/data/different_encoding.py", line 3
    print u'ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ'
          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(u'ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ')?

Compiling '/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/lib2to3/tests/data/false_encoding.py'...
***   File "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/lib2to3/tests/data/false_encoding.py", line 2
    print '#coding=0'
          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('#coding=0')?


Compiling '/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/lib2to3/tests/data/py2_test_grammar.py'...
***   File "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/lib2to3/tests/data/py2_test_grammar.py", line 31
    self.assertEquals(0377, 255)
                         ^
SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers


Compiling '/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/test/bad_coding.py'...
***   File "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/test/bad_coding.py", line 0
SyntaxError: unknown encoding: uft-8

Compiling '/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/test/bad_coding2.py'...
***   File "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/test/bad_coding2.py", line 0
SyntaxError: encoding problem: utf8 with BOM


Compiling '/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/test/badsyntax_3131.py'...
***   File "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/test/badsyntax_3131.py", line 2
    € = 2
    ^
SyntaxError: invalid character in identifier

Compiling '/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/test/badsyntax_future10.py'...
***   File "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/test/badsyntax_future10.py", line 3
    from __future__ import print_function
    ^
SyntaxError: from __future__ imports must occur at the beginning of the file

Compiling '/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/test/badsyntax_future3.py'...
***   File "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/test/badsyntax_future3.py", line 3
    from __future__ import rested_snopes
    ^
SyntaxError: future feature rested_snopes is not defined

Compiling '/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/test/badsyntax_future4.py'...
***   File "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/test/badsyntax_future4.py", line 3
    from __future__ import nested_scopes
    ^
SyntaxError: from __future__ imports must occur at the beginning of the file

Compiling '/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/test/badsyntax_future5.py'...
***   File "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/test/badsyntax_future5.py", line 4
    from __future__ import nested_scopes
    ^
SyntaxError: from __future__ imports must occur at the beginning of the file

Compiling '/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/test/badsyntax_future6.py'...
***   File "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/test/badsyntax_future6.py", line 3
    from __future__ import nested_scopes
    ^
SyntaxError: from __future__ imports must occur at the beginning of the file

Compiling '/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/test/badsyntax_future7.py'...
***   File "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/test/badsyntax_future7.py", line 3
    from __future__ import nested_scopes; import string; from __future__ import \
                                                        ^
SyntaxError: from __future__ imports must occur at the beginning of the file

Compiling '/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/test/badsyntax_future8.py'...
***   File "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/test/badsyntax_future8.py", line 3
    from __future__ import *
    ^
SyntaxError: future feature * is not defined

Compiling '/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/test/badsyntax_future9.py'...
***   File "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/test/badsyntax_future9.py", line 3
    from __future__ import nested_scopes, braces
    ^
SyntaxError: not a chance

Compiling '/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/test/badsyntax_pep3120.py'...
***   File "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/test/badsyntax_pep3120.py", line 1
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xf6 in position 1: invalid start byte


[DEBUG]:        /home/henrik/.buildozer/android/platform/android-ndk-r19c/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-strip:/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a/dists/GeoESPtrainingTEST__arm64-v8a/build/intermediates/transforms/mergeJniLibs/debug/0/lib/arm64-v8a/gdb.setup: File format not recognized
[DEBUG]:        
[DEBUG]:        Unable to strip library '1' due to error 


Now the warning messages:


# Installing/updating SDK platform tools if necessary
# Run '/home/henrik/.buildozer/android/platform/android-sdk/tools/bin/sdkmanager tools platform-tools'
# Cwd /home/henrik/.buildozer/android/platform/android-sdk
Warning: File /home/henrik/.android/repositories.cfg could not be loaded.       
[=======================================] 100% Computing updates...             
# Run '/home/henrik/.buildozer/android/platform/android-sdk/tools/bin/sdkmanager --update'
# Cwd /home/henrik/.buildozer/android/platform/android-sdk
Warning: File /home/henrik/.android/repositories.cfg could not be loaded.       
[=======================================] 100% Computing updates...             
# Updating SDK build tools if necessary
# Run '/home/henrik/.buildozer/android/platform/android-sdk/tools/bin/sdkmanager --list'
# Cwd /home/henrik/.buildozer/android/platform/android-sdk
Warning: File /home/henrik/.android/repositories.cfg could not be loaded.       
Installed packages:=====================] 100% Computing updates...             
[WARNING]: install_libs called with no libraries to install!
[WARNING]: lld not found, linking without it. Consider installing lld if linker errors occur.
[WARNING]: Context's python recipe found, skipping biglink (will this work?)

py3_test_grammar.py:652: SyntaxWarning: "is" with a literal. Did you mean "=="?

  if 1 is 1: pass

py3_test_grammar.py:653: SyntaxWarning: "is not" with a literal. Did you mean "!="?

  if 1 is not 1: pass

py3_test_grammar.py:656: SyntaxWarning: "is" with a literal. Did you mean "=="?

  if 1 < 1 > 1 == 1 >= 1 <= 1 != 1 in 1 not in 1 is 1 is not 1: pass

highlight.py:45: SyntaxWarning: "is not" with a literal. Did you mean "!="?

  if len(sys.argv) is not 4:

focus.py:463: SyntaxWarning: "is" with a literal. Did you mean "=="?

  walk_tree = 'walk' if focus_dir is 'focus_next' else 'walk_reverse'

focus.py:476: SyntaxWarning: "is" with a literal. Did you mean "=="?

  if focus_dir is 'focus_next':

knspace.py:460: SyntaxWarning: "is not" with a literal. Did you mean "!="?

  if parent_knspace is not 0:
WARNING: Received a --sdk argument, but this argument is deprecated and does nothing.
No setup.py/pyproject.toml used, copying full private data into .apk.


PS: In my Firefox browser (on Ubuntu 18.04) this editor window is VERY small. It’s only appropriate for small comments. Very strange limitation!


my_log.txt
buildozer.spec

Robert Flatt

unread,
Aug 4, 2020, 7:34:47 PM8/4/20
to Kivy users support
Is this with buildozer 1.2 ?    (pip3 list)
If no,  delete project/.buildozer and update buildozer.

Some of those warnings are fine, some look strange but not enough to turn on any lights for me.

We can see that the device is attached as you expect:
# Run '/home/henrik/.buildozer/android/platform/android-sdk/platform-tools/adb devices'
# Cwd None
List of devices attached
ZY3224R37X	device

 But I understand it hangs at the install step:
# Run '/home/henrik/.buildozer/android/platform/android-sdk/platform-tools/adb install -r "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/bin/GeoESPtrainingTEST__arm64-v8a-0.1-arm64-v8a-debug.apk"'

Is there an apk in the ./bin directory ?

If yes then try that last step by hand, just copy from between the '        '  above (/home/he......apk")  , expect to see the word "success".
If no apk or no success, 1)  run 'buildozer appclean'   2) set log_level =2 in buildozer.spec, 3) 'buildozer android debug > log.txt' and post (the very large) log.txt here.

Henrik R.

unread,
Aug 5, 2020, 6:49:11 AM8/5/20
to Kivy users support
Hi Robert

Thank you for your reply!

The 'pip3 list' command in Terminal shows:
buildozer             1.0

I just deleted the '.buildozer' folder in my project folder 2 days ago, so I don't think that would help. But there are also 2 buildozer folders in my home folder '~/':

~/buildozer    2.5 MB
~/.buildozer   8.4 GB

Should I delete one of them?

There are also 2 buildozer folders in /usr/local/lib :

/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/
/usr/local/lib/python2.7/dist-packages/buildozer-0.40.dev0-py2.7.egg/

Isn't there some (semi-)automatic updating process?


Henrik

Robert Flatt

unread,
Aug 5, 2020, 12:54:53 PM8/5/20
to Kivy users support
I just deleted the '.buildozer' folder in my project folder 2 days ago, so I don't think that would help.
This is recreated with each build, but after the first run it is a partial recreation.
The reason for deleting is to see the log of a full build, not the log of a partial build (and using log_level=2)
 
But there are also 2 buildozer folders in my home folder '~/':

~/buildozer    2.5 MB
Don't know what this is
~/.buildozer   8.4 GB
This is buildozer created - contains the files shared between projects are here, NDK and SDK. Buildozer should manage these so they are probably OK.
Delete if you like, first build will take a while.

There are also 2 buildozer folders in /usr/local/lib :
These are internal pip and pip3 files
It looks like there is a Python2 version of buildozer, which is obsolete.
If you want to remove it you have to uninstall both (one with pip , one with pip3) then install buildozer with pip3.
(because the file returned by 'which buildozer' is shared between them, so you always execute the last one installed. Uninstalling one removes the file, disabling the other)

Isn't there some (semi-)automatic updating process?
Yes, a current buildozer works the the updated components, but it is not necessarily true that a historical buildozer works with the updated components.  :(  One less variable.
The install dependencies change over time too, for example if one of those things buildozer depends on (there are a lot) changes in a significant way. 

Henrik R.

unread,
Aug 6, 2020, 7:37:18 AM8/6/20
to Kivy users support
Hi Robert

I can see that I oversaw a few things in your first post. Sorry for that!

So now I deleted the '.buildozer' folder in my project folder again, and I found the following update command on https://buildozer.readthedocs.io/en/latest/installation.html - which succesfully updated Buildozer from 1.0 to 1.2:

$ pip3 install --user --upgrade buildozer

Then I did this:

henrik@Henrik-L570:~$ buildozer appclean
# Deleting /home/henrik/.buildozer

Then I changed log level = 2 in 'buildozer.spec', and ran:

$ buildozer android debug > log.txt

That turned out to be a bad idea. Because when you do an initial install some user input is needed, but you never see the questions when you use '>log.txt' ... And you get a huge amount of lines like these:

- Download 0.00%
- Download 0.15%
- Download 0.29%
- Download 0.44%
- Download 0.59%
- Download 0.74%
- Download 0.88%
- Download 1.03%
- Download 1.18%

So I started over again, like this (still with log_level = 2 in Buildozer.spec):


$ buildozer appclean


$ buildozer android debug


(Here I connected the Android device via USB, 'USB for file transfer' and 'USB debugging enabled'.)


$ buildozer android deploy run logcat


The Terminal output of the last command is below. I have attached the output of the other commands, both as .ODT and as .RTF (about 209 A4 pages).


But still nothing happens on the Android device...?


Please help!


If this doesn't work, I will have to learn at least one new programming language (suitable for smart phone apps) and convert my whole project into that language... Suicide seems more pleasant than that...


I can add that the bin folder in my project folder contains this:


henrik@Henrik-L570:/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/bin$ ls -l
total 43976
-rwxrwxrwx 1 root root 16151763 aug  5 23:50 GeoESPtrainingTEST__arm64-v8a-0.1-arm64-v8a-debug.apk
-rwxrwxrwx 1 root root 14468129 mar  2 13:34 GeoESPtrainingTEST__arm64-v8a-0.1-arm64-v8a-release.apk
-rwxrwxrwx 1 root root 14404679 mar  2 11:43 GeoESPtrainingTEST__armeabi-v7a-0.1-armeabi-v7a-release.apk
henrik@Henrik-L570:/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/bin$ 


(The 2 'release' versions are from a succesfull Google Play 'Internal Test'.)



henrik@Henrik-L570:~$ buildozer android deploy run logcat
# Ensure build layout
No buildozer.spec found in the current directory. Abandon.
henrik@Henrik-L570:~$ cd "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/"
henrik@Henrik-L570:/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer$ buildozer android deploy run logcat
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Run &apos;dpkg --version&apos;
# Cwd None
Debian &apos;dpkg&apos; package management program version 1.19.0.5 (amd64).
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.
# Search for Git (git)
#  -> found at /usr/bin/git
# Search for Cython (cython)
#  -> found at /home/henrik/.local/bin/cython
# Search for Java compiler (javac)
#  -> found at /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
# Search for Java keytool (keytool)
#  -> found at /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/keytool
# Install platform
# Run &apos;git config --get remote.origin.url&apos;
# Cwd /mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/python-for-android
https://github.com/kivy/python-for-android.git
# Run &apos;git branch -vv&apos;
# Cwd /mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/python-for-android
* master 1b3b0e3f [origin/master] Merge pull request #2225 from kivy/release-2020.06.02
# Run &apos;/usr/bin/python3 -m pip install -q --user \&apos;appdirs\&apos; \&apos;colorama>=0.3.3\&apos; \&apos;jinja2\&apos; \&apos;six\&apos; \&apos;enum34; python_version<"3.4"\&apos; \&apos;sh>=1.10; sys_platform!="nt"\&apos; \&apos;pep517<0.7.0"\&apos; \&apos;toml\&apos;&apos;
# Cwd None
# Apache ANT found at /home/henrik/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/henrik/.buildozer/android/platform/android-sdk
# Recommended android&apos;s NDK version by p4a is: 19c
# Android NDK found at /home/henrik/.buildozer/android/platform/android-ndk-r19c
# Check application requirements
# Check garden requirements
# Compile platform
# Run &apos;/usr/bin/python3 -m pythonforandroid.toolchain create --dist_name=GeoESPtrainingTEST --bootstrap=sdl2 --requirements=python3,kivy,pil,sqlite3,pygments,docutils --arch arm64-v8a --copy-libs --color=always --storage-dir="/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/build-arm64-v8a" --ndk-api=21&apos;
# Cwd /mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/.buildozer/android/platform/python-for-android
[INFO]:    Will compile for the following archs: arm64-v8a
[INFO]:    Found Android API target in $ANDROIDAPI: 28
[INFO]:    Available Android APIs are (28)
[INFO]:    Requested API target 28 is available, continuing.
[INFO]:    Found NDK dir in $ANDROIDNDK: /home/henrik/.buildozer/android/platform/android-ndk-r19c
[INFO]:    Found NDK version 19c
[INFO]:    Getting NDK API version (i.e. minimum supported API) from user argument
[INFO]:    ccache is missing, the build will not be optimized in the future.
[INFO]:    Found the following toolchain versions: [&apos;4.9&apos;]
[INFO]:    Picking the latest gcc toolchain, here 4.9
[INFO]:    Of the existing distributions, the following meet the given requirements:
[INFO]:         GeoESPtrainingTEST: min API 21, includes recipes (freetype, hostpython3, jpeg, libffi, openssl, png, sdl2_image, sdl2_mixer, sdl2_ttf, sqlite3, python3, sdl2, setuptools, pil, six, pyjnius, android, kivy, docutils, pygments, certifi), built for archs (arm64-v8a)
[INFO]:    GeoESPtrainingTEST has compatible recipes, using this one
# Run &apos;/home/henrik/.buildozer/android/platform/android-sdk/platform-tools/adb devices&apos;
# Cwd None
List of devices attached
ZY3224R37X      device

# Deploy on ZY3224R37X
# Run &apos;/home/henrik/.buildozer/android/platform/android-sdk/platform-tools/adb install -r "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/bin/GeoESPtrainingTEST__arm64-v8a-0.1-arm64-v8a-debug.apk"&apos;
# Cwd /home/henrik/.buildozer/android/platform

^CTraceback (most recent call last):
  File "/usr/local/bin/buildozer", line 11, in <module>
    load_entry_point(&apos;buildozer==0.40.dev0&apos;, &apos;console_scripts&apos;, &apos;buildozer&apos;)()
  File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/scripts/client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/__init__.py", line 1071, in run_command
    self.target.run_commands(args)
  File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/target.py", line 92, in run_commands
    func(args)
  File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/targets/android.py", line 1319, in cmd_deploy
    cwd=self.buildozer.global_platform_dir)
  File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/__init__.py", line 311, in cmd
    readx = select.select([fd_stdout, fd_stderr], [], [])[0]
KeyboardInterrupt
henrik@Henrik-L570:/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer$ 



The whole log file from new install of Buildozer.odt
The whole log file from new install of Buildozer.rtf

Robert Flatt

unread,
Aug 6, 2020, 12:52:50 PM8/6/20
to Kivy users support
Well that looks OK. Three things are unusual : sdk 28 ( usually 27 or 29) , OneDrive in the path, and those &apos
I can't say that any are 'wrong'. Except the last one is strange in the context of the 'os.linespec' issue we saw earlier, there might be some bigger issue.

What happens in you run this line at a prompt ?  (it is one line, though the display may be wrapping it)  In a good world you will see "success" and the app icon on the phone.

/home/henrik/.buildozer/android/platform/android-sdk/platform-tools/adb install -r "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/bin/GeoESPtrainingTEST__arm64-v8a-0.1-arm64-v8a-debug.apk"

Henrik R.

unread,
Aug 6, 2020, 1:13:41 PM8/6/20
to Kivy users support
Well... Nothing happens on the connected phone.

This is a copy from my Terminal. I pressed <enter> a few times, then Ctrl-C:

henrik@Henrik-L570:/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/bin$ /home/henrik/.buildozer/android/platform/android-sdk/platform-tools/adb install -r "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/bin/GeoESPtrainingTEST__arm64-v8a-0.1-arm64-v8a-debug.apk"
Performing Streamed Install


^C
henrik@Henrik-L570:/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/bin$ 

The problems with 'os.linespec' got solved when I deleted the 8 months old backup of the Ubuntu partition and restored a backup I made just before restoring the 8 months old backup...

The reason that OneDrive is in the path is because /mnt/4AF15A0435E762B4/ is actually a NTFS partition originally created by Windows 10. At that time I was planning to use OneDrive for data backups. Therefore most of my important things are inside the 'OneDrive' folder.

Robert Flatt

unread,
Aug 6, 2020, 3:25:05 PM8/6/20
to Kivy users support
OK so adb is failing with no error message. So try it with one of the older .apk


FYI I expected this output (done on Windows, but Linux is the same):

C:\Users\Bobf\Documents\kivy>adb install -r myapp-0.2-arm64-v8a-debug.apk
Performing Streamed Install
Success

Or failure message:

C:\Users\Bobf\Documents\kivy>adb install -r myapp-0.2-arm64-v8a-debug.apk
Performing Push Install
adb: error: failed to get feature set: no devices/emulators found

Henrik R.

unread,
Aug 6, 2020, 4:15:52 PM8/6/20
to Kivy users support
OK!
I tried this... with same result:

henrik@Henrik-L570:/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer$ /home/henrik/.buildozer/android/platform/android-sdk/platform-tools/adb install -r "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/bin/GeoESPtrainingTEST__arm64-v8a-0.1-arm64-v8a-release.apk"
Performing Streamed Install


^C
henrik@Henrik-L570:/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer$ 

Thank you for trying to help me!
I feel a bit 'clueless' when it comes to Buildozer...

Robert Flatt

unread,
Aug 6, 2020, 5:57:39 PM8/6/20
to Kivy users support
Buildozer is a compilation of many kinds of magic, not always clear what is happening. Figuring it out can be a challenge, not always a one person task.

So as I understand it adb fails silently with old and newly built APK. I understand the old one previously worked, so from that I conclude the issue is not the APK build process.

Adb is Android Debug Bridge a Google supplied tool. A black box to us.

Let's try one more thing, install your APK using the phone's file manager app.
I use "File Manager +", but most will allow you to read remote disks. There is an install step and a run step. Does the install step work? If run fails, then we need adb, so this is only a partial work around.

Caveat, as we drill down into the issue, I'm having a harder time imagining what the issue and work around could be. ☹️ We are getting more information, but is it actionable? I don't know.

Henrik R.

unread,
Aug 7, 2020, 12:21:48 PM8/7/20
to Kivy users support
Great idea. And it makes us a little bit wiser.

I copied the APK files (both the new and the old) to the Android phone (MOTO G5 with Android 8.1.0. They stopped updating it in February 2019...) using Files (Nautilus) on Ubuntu and the USB cable. Then I tried to install them by opening them. The Android package installation app asks if I want to install it, but a second after saying 'yes', I get the message "Application not installed". Even with the old 'release' APK from March.
Then I borrowed a newer phone - MOTO G6 - but with the same result. It would not installed any of the 2 APKs.
So it's almost as if Android has recently decided that Buildozer-generated packages cannot be installed any-more...?

At the moment I don't know what to try.

Robert Flatt

unread,
Aug 7, 2020, 7:47:21 PM8/7/20
to Kivy users support
I have not seen anybody else report this so I suspect Android's targeting may be narrower than just Buildozer ;)


In hello.zip is an instance of Hello World contatining: "main.py, buildozer.spec, and bin/HWtest-0.1-arm64-v8a-debug.apk"
I built the .apk using the other two files and Buildozer 1.2 on Ubuntu 20.04; installed and ran here on a Pixel3 running Android 10.

Two questions
1) First unzip the file, can you install and run the .apk it contains?   (OK some trust required here).
2) Next 'buildozer android debug' in the unziped directory (don't change anything), can you install and run the newly created .apk ? 
   (it will be version 0.2, I bumped the version in the .spec to prevent overwrite)

Henrik R.

unread,
Aug 8, 2020, 8:20:42 AM8/8/20
to Kivy users support
Thank you very much for creating this test!

But: 2 times bad news...:

1. Simply copying the APK-file to the Android 8.1.0 MOTO G5 device and clicking on it there in a file manager gave "Application not installed"...

2. The 'buildozer android debug' in Terminal created 'HWtest__arm64-v8a-0.2-arm64-v8a-debug.apk' in 'bin'. I copied it to the Android device, but again "Application not installed"...

(First the build failed. No space characters are allowed in the path to the project folder...)

Robert Flatt

unread,
Aug 8, 2020, 5:30:55 PM8/8/20
to Kivy users support
Well if (1) installs on my phone and not on yours, and nobody else is reporting an issue.
Then the place to look is the settings on your phone, yes I know you tried another phone.

The obvious thing to check is:
But since adb also fails perhaps it is some global setting, but I don't know where to look except in the system settings....


(First the build failed. No space characters are allowed in the path to the project folder...)
That is about where the folder was unzipped, right?

Henrik R.

unread,
Aug 11, 2020, 7:11:46 PM8/11/20
to Kivy users support
A short update:

I looked carefully at the settings on the phone, but that didn't solve it.

I am waiting for Motorola to - hopefully - explain why Moto G5 (and G6) suddenly can't install my 'home made' apps.

Yes. At first, I unzipped your test app in a path containing space characters...

Henrik R.

unread,
Aug 12, 2020, 2:21:09 PM8/12/20
to Kivy users support
PS: In some of the messages in this thread I mention the error "application not installed". This is MY translation of the Danish error. Based on a few Google searches it seems the English version of the error-text is "app not installed"... :-)

Henrik R.

unread,
Aug 14, 2020, 5:06:45 PM8/14/20
to Kivy users support
Finally I found a solution!

The problem was kind of basic... I was compiling 64bit code!
In the 'buildozer.spec':
android.arch = arm64-v8a
I simply had to change it (back) to:
android.arch = armeabi-v7a
Because the 'stock' Android OS 8.1.0 on my Moto G5 phone is 32bit code...

Now I vaguely remember changing buildozer.spec to the 62bit architecture in March, in order to create and upload TWO signed APK-files to Google Play Store for an 'Internal Test'...

It was developers of alternative Android OS versions that helped me here:


Henrik

Robert Flatt

unread,
Aug 14, 2020, 6:06:59 PM8/14/20
to Kivy users support
Thanks for the follow up.
I never would have thought....... ;)

Henrik R.

unread,
Aug 15, 2020, 6:08:58 AM8/15/20
to Kivy users support
Am I kind of demanding?
I mean - it would have been VERY nice if either ADB (Android Debug Bridge) or the Package Installation App on my Moto G5 phone had given some kind of error message like for instance:
"ERROR: 64bit code found. Only 32bit code allowed."
That would have saved me a huge amount of time!

Robert Flatt

unread,
Aug 15, 2020, 1:15:08 PM8/15/20
to Kivy users support
That would seem reasonable.
If I ruled the world, things would be different too ;)
Reply all
Reply to author
Forward
0 new messages