title: Compiling Kivy with Buildozer using Python 3 and Cython 0.25-2
body: <p>I'm not able to compile using buildozer or p4a. The most near I get was using buildozer. </p>
  
  <ul>
  <li>I'm using kivy 1.10.1;</li>
  <li>Cython 0.25.2</li>
  <li>Tried with android-ndk-16b and crystax-10.3.2.</li>
  <li>Tried also put hostpython3 in requirements but not worked too. </li>
  </ul>
  
  <p>Part of my buildozer.spec:</p>
  
  <pre><code># (list) Application requirements
  # comma seperated e.g. requirements = sqlite3,kivy
  requirements = sqlite3,python3crystax,kivy,datetime,plyer,ecdsa,paramiko,pyjnius
  
  # (int) Android API to use
  android.api = 19
  
  # (int) Minimum API required
  android.minapi = 13
  
  # (int) Android SDK version to use
  android.sdk = 20
  
  # (str) Android NDK version to use
  android.ndk = 10.3.2
  
  # (bool) Use --private data storage (True) or --dir public storage (False)
  android.private_storage = False
  
  # (str) Android NDK directory (if empty, it will be automatically downloaded.)
  android.ndk_path = /home/awulll/python-for-android/crystax-ndk-10.3.2/
  
  # (str) Android SDK directory (if empty, it will be automatically downloaded.)
  android.sdk_path = /home/awulll/Android/Sdk/
  </code></pre>
  
  <p>The error I got:</p>
  
  <pre><code>[INFO]:    Will compile for the following archs: armeabi-v7a
  [INFO]:    Getting Android API version from user argument
  [INFO]:    Available Android APIs are (19, 28)
  [INFO]:    Requested API target 19 is available, continuing.
  [INFO]:    Found NDK dir in $ANDROIDNDK
  [INFO]:    Got NDK version from $ANDROIDNDKVER
  [WARNING]: NDK version was set as r10.3.2, but checking the NDK dir claims it is 10.3.2.
  [WARNING]: The build will try to continue, but it may fail and you should check that your setting is correct.
  [WARNING]: If the NDK dir result is correct, you don't need to manually set the NDK ver.
  [INFO]:    Using Crystax NDK r10.3.2
  [INFO]:    Found virtualenv at /usr/local/bin/virtualenv
  [INFO]:    Found the following toolchain versions: ['4.9', '5', 'clang3.6', 'clang3.7']
  [INFO]:    Picking the latest gcc toolchain, here 5
  [INFO]:    Of the existing distributions, the following meet the given requirements:
  [INFO]:     DAP_new: includes recipes (hostpython3crystax, sdl2_image, sdl2_mixer, sdl2_ttf, sqlite3, python3crystax, sdl2, six, pyjnius, kivy, ecdsa, paramiko, plyer, datetime), built for archs (armeabi-v7a)
  [INFO]:    DAP_new has compatible recipes, using this one
  [INFO]:    Of the existing distributions, the following meet the given requirements:
  [INFO]:     DAP_new: includes recipes (hostpython3crystax, sdl2_image, sdl2_mixer, sdl2_ttf, sqlite3, python3crystax, sdl2, six, pyjnius, kivy, ecdsa, paramiko, plyer, datetime), built for archs (armeabi-v7a)
  [INFO]:    DAP_new has compatible recipes, using this one
  [INFO]:    -&gt; directory context /home/awulll/dapapp_new/.buildozer/android/platform/build/dists/DAP_new
  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: --dir /home/awulll/dapapp_new/.buildozer/android/app
  b'Could not find hostpython, will not compile to .pyo (this is normal with python3)\n'# Command failed: /usr/bin/python3 -m pythonforandroid.toolchain apk --debug --bootstrap=sdl2 --dist_name DAP_new --name DAP_new --version 0.1 --package com.doatlanticoaopacifico.dap_new --android_api 19 --minsdk 13 --dir /home/awulll/dapapp_new/.buildozer/android/app --permission INTERNET --permission ACCESS_NETWORK_STATE --permission CAMERA --presplash /home/awulll/dapapp_new/./data/figura.png --icon /home/awulll/dapapp_new/./data/logo.png --orientation portrait --window --copy-libs --arch armeabi-v7a --color=always --storage-dir="/home/awulll/dapapp_new/.buildozer/android/platform/build"
  # 
  # Buildozer failed to execute the last command
  # The error might be hidden in the log above this error
  # Please read the full log, and search for it before
  # raising an issue with buildozer itself.
  # In case of a bug report, please add a full log with log_level = 2
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>EDITION 1:</p>
  
  <p>I used now: "android.private_storage = True" (was False before) and the code was compiled, but now crases on my android.</p>
  
  <p>At the end of compilation I got this message:</p>
  
  <pre><code>[DEBUG]:    BUILD SUCCESSFUL
  [DEBUG]:    
  [DEBUG]:    Total time: 3 mins 46.325 secs
  [DEBUG]:    
  [INFO]:    &lt;- directory context /home/awulll/dapapp_new/.buildozer/android/platform/python-for-android-new-toolchain
  [INFO]:    # Copying APK to current directory
  [INFO]:    # APK filename not found in build output, trying to guess
  [INFO]:    # Found APK file: /home/awulll/dapapp_new/.buildozer/android/platform/build/dists/DAP_new/build/outputs/apk/DAP_new-debug.apk
  [INFO]:    # Add version number to APK
  [INFO]:    # APK renamed to DAP_new-0.1-debug.apk
  [DEBUG]:   -&gt; running cp /home/awulll/dapapp_new/.buildozer/android/platform/build/dists/DAP_new/build/outputs/apk/DAP_new-debug.apk DAP_new-0.1-debug.apk
  b'Could not find hostpython, will not compile to .pyo (this is normal with python3)\nNo compiled python is present to zip, skipping.\nthis should only be the case if you are using the CrystaX python\n'# Android packaging done!
  # APK DAP_new-0.1-debug.apk available in the bin directory
  # Run '/home/awulll/Android/Sdk/platform-tools/adb devices'
  # Cwd None
  * daemon not running; starting now at tcp:5037
  * daemon started successfully
  b'List of devices attached\n\n'# Application pushed.
  # Application started.
  </code></pre>
  
  <p>EDITION 2:</p>
  
  <p>In my logcat I found an error with cryptography, but when I put this as a requirement, I can't compile.
  Logcat:</p>
  
  <pre><code>10-15 18:09:58.498 25389 25406 I python  :  Traceback (most recent call last):
  10-15 18:09:58.499 25389 25406 I python  :    File "main.py", line 12, in &lt;module&gt;
  10-15 18:09:58.500 25389 25406 I python  :      import rotinas
  10-15 18:09:58.501 25389 25406 I python  :    File "./rotinas.py", line 11, in &lt;module&gt;
  10-15 18:09:58.503 25389 25406 I python  :      import paramiko
  10-15 18:09:58.504 25389 25406 I python  :    File "/data/user/0/com.doatlanticoaopacifico.dap_new/files/app/crystax_python/site-packages/paramiko/__init__.py", line 22, in &lt;module&gt;
  10-15 18:09:58.506 25389 25406 I python  :      from paramiko.transport import SecurityOptions, Transport
  10-15 18:09:58.507 25389 25406 I python  :    File "/data/user/0/com.doatlanticoaopacifico.dap_new/files/app/crystax_python/site-packages/paramiko/transport.py", line 33, in &lt;module&gt;
  10-15 18:09:58.511 25389 25406 I python  :      from cryptography.hazmat.backends import default_backend
  10-15 18:09:58.512 25389 25406 I python  :  ImportError: No module named 'cryptography'
  10-15 18:09:58.657 25389 25406 I python  : Python for android ended.
  </code></pre>
  
  <p>New error found when try using cryptography as a requirement:</p>
  
  <pre><code>[INFO]:    No dist exists that meets your requirements, so one will be built.
  [ERROR]:   Didn't find any valid dependency graphs.
  [ERROR]:   This means that some of your requirements pull in conflicting dependencies.
  [ERROR]:   Exiting.
  # Command failed: /usr/bin/python3 -m pythonforandroid.toolchain create --dist_name=DAP_new --bootstrap=sdl2 --requirements=sqlite3,python3crystax,kivy,datetime,plyer,ecdsa,paramiko,cryptography,pyjnius --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/awulll/dapapp_new/.buildozer/android/platform/build"
  # 
  </code></pre>