Build APK with Crystax on VM - sh.CommandNotFound: ndk_build

120 views
Skip to first unread message

Глеб Самойлов

unread,
Jun 19, 2018, 12:56:35 PM6/19/18
to Kivy users support
I downloaded a virtual machine with a Bulldozer. Has removed the Bulldozer. Download Android-SDK and Crysrax-NDK. I run the APK package assembly on a virtual machine, getting error:

[INFO]:    # Prebuilding recipes
[INFO]:    Prebuilding hostpython3crystax for armeabi-v7a
[INFO]:    hostpython3crystax has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding sdl2_image for armeabi-v7a
[INFO]:    sdl2_image has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for sdl2_image[armeabi-v7a]
[INFO]:    sdl2_image already patched, skipping
[INFO]:    Prebuilding sdl2_mixer for armeabi-v7a
[INFO]:    sdl2_mixer has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for sdl2_mixer[armeabi-v7a]
[INFO]:    sdl2_mixer already patched, skipping
[INFO]:    Prebuilding sdl2_ttf for armeabi-v7a
[INFO]:    sdl2_ttf has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding python3crystax for armeabi-v7a
[INFO]:    python3crystax has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding sdl2 for armeabi-v7a
[INFO]:    sdl2 has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for sdl2[armeabi-v7a]
[INFO]:    sdl2 already patched, skipping
[INFO]:    Prebuilding six for armeabi-v7a
[INFO]:    six has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding pyjnius for armeabi-v7a
[INFO]:    pyjnius has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for pyjnius[armeabi-v7a]
[INFO]:    pyjnius already patched, skipping
[INFO]:    Prebuilding kivy for armeabi-v7a
[INFO]:    kivy has no prebuild_armeabi_v7a, skipping
[INFO]:    # Building recipes
[INFO]:    Building hostpython3crystax for armeabi-v7a
[INFO]:    Building sdl2_image for armeabi-v7a
[INFO]:    Building sdl2_mixer for armeabi-v7a
[INFO]:    Building sdl2_ttf for armeabi-v7a
[INFO]:    Building python3crystax for armeabi-v7a
[INFO]:    Building sdl2 for armeabi-v7a
[INFO]:    -> directory context /home/kivy/.local/share/python-for-android/build/bootstrap_builds/sdl2_gradle-python3crystax/jni

Traceback (most recent call last):
 
File "setup.py", line 77, in <module>
   
'quotessaints/libs/applibs/requests/packages/idna': ['*.py'],
 
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
    dist
.run_commands()
 
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
   
self.run_command(cmd)
 
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj
.run()
 
File "/usr/local/lib/python2.7/dist-packages/pythonforandroid/bdistapk.py", line 83, in run
    main
()
 
File "/usr/local/lib/python2.7/dist-packages/pythonforandroid/toolchain.py", line 975, in main
   
ToolchainCL()
 
File "/usr/local/lib/python2.7/dist-packages/pythonforandroid/toolchain.py", line 512, in __init__
   
getattr(self, args.subparser_name.replace('-', '_'))(args)
 
File "/usr/local/lib/python2.7/dist-packages/pythonforandroid/toolchain.py", line 149, in wrapper_func
    build_dist_from_args
(ctx, dist, args)
 
File "/usr/local/lib/python2.7/dist-packages/pythonforandroid/toolchain.py", line 193, in build_dist_from_args
    build_recipes
(build_order, python_modules, ctx)
 
File "/usr/local/lib/python2.7/dist-packages/pythonforandroid/build.py", line 573, in build_recipes
    recipe
.build_arch(arch)
 
File "/usr/local/lib/python2.7/dist-packages/pythonforandroid/recipes/sdl2/__init__.py", line 32, in build_arch
    shprint
(sh.ndk_build, "V=1", _env=env)
 
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 3054, in __getattr__
   
return self.__env[name]
 
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 2931, in __getitem__
   
raise CommandNotFound(k)
sh
.CommandNotFound: ndk_build```

Version sh module
- 1.12.4


My setup.py:

from setuptools import setup, find_packages
from distutils.extension import Extension
from Cython.Distutils import build_ext

from os.path import join, dirname

packages = find_packages()

with open(join(dirname(__file__), 'version.txt'), 'r') as fileh:
   version = fileh.read().strip()

options = {'apk':
              {'window': None,
               'requirements': 'sdl2, kivy, python3crystax',
               'android-api': 19,
               'ndk-dir': '/home/zavulon/Opt/crystax-ndk-10.3.2',
               'sdk-dir': '/home/zavulon/Opt/android-sdk-linux',
               'dist-name': 'quotessaints',
               'ndk-version': '10.3.2',
               'package': 'com.heattheatr.quotessaints',
               'permission': 'INTERNET',
               'arch': 'armeabi-v7a',
               'presplash-color': '#1d3b3e',
               'icon': 'quotessaints/data/images/icon.png',
               'presplash': 'quotessaints/data/images/presplash.png',
               'release': True,
               }
          }
setup(
   name='Quotes Saints',
   version=version,
   description='Mobile site client https://svyatye.com',
   author='HeaTTheatR',
   author_email='kivydev...@gmail.com',
   packages=packages,
   options=options,
   package_data={'quotessaints': ['*.py'], ...}
)



What is it and how to fix it?

ZenCODE

unread,
Jun 21, 2018, 9:55:49 AM6/21/18
to Kivy users support
As far as I know, you need buildozer to build an apk. How exactly are you trying to build this? What is the command you are issuing?

Глеб Самойлов

unread,
Jun 21, 2018, 10:10:42 AM6/21/18
to Kivy users support
I used python-for-android and command - 'python setup.py apk'

четверг, 21 июня 2018 г., 16:55:49 UTC+3 пользователь ZenCODE написал:

ZenCODE

unread,
Jun 22, 2018, 9:15:02 AM6/22/18
to kivy-...@googlegroups.com
setup.py uses distutils, which does not support android apk's. That is only done using python-for-android. i.e. you command above will not work. Try using buildozer?

Глеб Самойлов

unread,
Jun 22, 2018, 9:42:36 AM6/22/18
to Kivy users support
I installed Ubuntu 14.04, Python 3.5, python-for-android, downloaded AndroidSDK, CrystaxNDK and other dependencies. The Bulldozer did not install. I compile the APK file with a command - 

python setup.py apk

Everything turns out.
But in the virtual machine, the same manipulations lead to an error:

sh.CommandNotFound: ndk_build

The same error occurs if I compile a APK file with Python3 using Bulldozer.

пятница, 22 июня 2018 г., 16:15:02 UTC+3 пользователь ZenCODE написал:

Sergey Cheparev

unread,
Jun 26, 2018, 6:48:30 PM6/26/18
to kivy-...@googlegroups.com
Looks like in the last version of crystax the ndk-* scripts are not marked as executables.
After chmoding them i get an error, that build/core/bla bla is not existing, which means buildozer expects you to check out unbuilt crystax (https://github.com/crystax/android-platform-ndk) and not download the 700mb big already precompiled one (as its stated in readme, it could be found here https://www.crystax.net/en/download), because those paths exist only there.

When I replace built crystax with unbuilt one (no idea whats the difference and if those are correct names :D), I get couple of missing deps.
Stuck on:
[WARNING]: ndk_platform doesn't exist: /home/sergey/crystax/platforms/android-19/arch-arm
[

probably crystax must have built them, but didn't of course, its just checked out.


пятница, 22 июня 2018 г., 15:42:36 UTC+2 пользователь Глеб Самойлов написал:
Reply all
Reply to author
Forward
0 new messages