avionmission / comments_on_our_blog

1 stars 0 forks source link

blog/convert-py-to-apk-using-python-and-buildozer/ #1

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

How to Convert Python Code into an Android .apk [that doesn’t crash!] Kivymd, Buildozer Tutorial | Avinash Prasad

You created an android app with python using Kivy or Kivymd, but it is still in .py format. How do you convert it into an installable .apk file that dose’nt crash for reasons you can’t figure out and do it as quickly as possible? Don’t worry, I got you covered. Read on.

https://avionmission.github.io/blog/convert-py-to-apk-using-python-and-buildozer/

fanatic-uv commented 2 years ago

its not working can u help pls

Ayush-kuk commented 2 years ago

Ohh my god , finally At the right page. My App worked . I followed the same steps that you told and it worked. Thank you .

hermes13002 commented 2 years ago

Thank you very much, it worked.

fun-zonez commented 2 years ago

Thank you very much, this time my app didn't crashed

bezcoded commented 2 years ago

my worked for my calculator app, so i tried a web browser, and its not working it only opens and closes

JH-SoloDev commented 2 years ago

Hey, hopefully you see this comment. I am using your Google colab method but upon running "!buildozer init" it gives a prompt warning about buildozer running in root. It says to input y/n if I want to continue. I add y to the given field. But then it doesn't do anything from there. Hitting enter doesn't do anything either.

gasper101 commented 1 year ago

@bazecoded did you add your new requirements to the .spec file?

Nickmcoleman commented 1 year ago

Hi, this is an extremely good way for someone like me (recent move to python and android) to get going. I have written a very simple programme to test (2 lines, 1 to print and 1 to press enter to proceed). I've used this to test the packaging. I manage to get all the way and install successfully on my A50, however, when I run it I only get a LOADING screen and then it disappears. I have tried it multiple times (and with other test programmes) but the same happens. I have checked the .spec file and made the recommended changes (inc pillow). The only difference is I have been using PyCharm as the editor. Are you able to help please (pretty sure I've made a very basic mistake somewhere!). Thannks, Nick

arisoda commented 1 year ago

no .APK was created. I noticed that you changed your GitHub "Rock Paper Scissors" files. Especially the buildozer.spec file. You changed/added the requirements kivy=2.0.0rc4 and sdl2_ttf==2.0.15.

I get the error "Buildozer failed to execute the last command", both when trying the exact buildozer.spec on your GitHub and the one in this guide.

I'm on Linux (manjaro) but that shouldn't be a problem since it's all in the browser (firefox).

harry95730 commented 1 year ago

Bro can you help me for using excel sheet into python code and turn it into apk I have the complete code but my app is crashing

Marko32112 commented 1 year ago

https://towardsdatascience.com/3-ways-to-convert-python-app-into-apk-77f4c9cd55af

mindmadetechnologies commented 1 year ago

Nice Blog. The step by step explanation is really nice. Thanks for this wonderful post.

Makuuuu21 commented 1 year ago

My app requires permission for camera please can u help me update the buildozer.spec file

Scott20060118 commented 1 year ago

Should I add some codes in 'buildozer.spec' if I use opencv???

orangecampfire commented 11 months ago

I get this error when I try to run it:

Command failed: ['/usr/bin/python3', '-m', 'pythonforandroid.toolchain', 'create', '--dist_name=light_feet', '--bootstrap=sdl2', '--requirements=python3,kivy==2.0.0,kivymd,pillow', '--arch=arm64-v8a', '--arch=armeabi-v7a', '--copy-libs', '--color=always', '--storage-dir=/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a', '--ndk-api=21', '--ignore-setup-py', '--debug']

ENVIRONMENT:

SHELL = '/bin/bash'

NV_LIBCUBLAS_VERSION = '11.11.3.6-1'

NVIDIA_VISIBLE_DEVICES = 'all'

COLAB_JUPYTER_TRANSPORT = 'ipc'

NV_NVML_DEV_VERSION = '11.8.86-1'

NV_CUDNN_PACKAGE_NAME = 'libcudnn8'

CGROUP_MEMORY_EVENTS = '/sys/fs/cgroup/memory.events /var/colab/cgroup/jupyter-children/memory.events'

NV_LIBNCCL_DEV_PACKAGE = 'libnccl-dev=2.15.5-1+cuda11.8'

NV_LIBNCCL_DEV_PACKAGE_VERSION = '2.15.5-1'

VM_GCE_METADATA_HOST = '169.254.169.253'

HOSTNAME = 'd427495848f8'

LANGUAGE = 'en_US'

TBE_RUNTIME_ADDR = '172.28.0.1:8011'

GCE_METADATA_TIMEOUT = '3'

NVIDIA_REQUIRE_CUDA = ('cuda>=11.8 brand=tesla,driver>=450,driver<451 '

'brand=tesla,driver>=470,driver<471 brand=unknown,driver>=470,driver<471 ' 'brand=nvidia,driver>=470,driver<471 brand=nvidiartx,driver>=470,driver<471 ' 'brand=geforce,driver>=470,driver<471 brand=geforcertx,driver>=470,driver<471 ' 'brand=quadro,driver>=470,driver<471 brand=quadrortx,driver>=470,driver<471 ' 'brand=titan,driver>=470,driver<471 brand=titanrtx,driver>=470,driver<471 ' 'brand=tesla,driver>=510,driver<511 brand=unknown,driver>=510,driver<511 ' 'brand=nvidia,driver>=510,driver<511 brand=nvidiartx,driver>=510,driver<511 ' 'brand=geforce,driver>=510,driver<511 brand=geforcertx,driver>=510,driver<511 ' 'brand=quadro,driver>=510,driver<511 brand=quadrortx,driver>=510,driver<511 ' 'brand=titan,driver>=510,driver<511 brand=titanrtx,driver>=510,driver<511 ' 'brand=tesla,driver>=515,driver<516 brand=unknown,driver>=515,driver<516 ' 'brand=nvidia,driver>=515,driver<516 brand=nvidiartx,driver>=515,driver<516 ' 'brand=geforce,driver>=515,driver<516 brand=geforcertx,driver>=515,driver<516 ' 'brand=quadro,driver>=515,driver<516 brand=quadrortx,driver>=515,driver<516 ' 'brand=titan,driver>=515,driver<516 brand=titanrtx,driver>=515,driver<516')

NV_LIBCUBLAS_DEV_PACKAGE = 'libcublas-dev-11-8=11.11.3.6-1'

NV_NVTX_VERSION = '11.8.86-1'

COLAB_JUPYTER_IP = '172.28.0.12'

NV_CUDA_CUDART_DEV_VERSION = '11.8.89-1'

NV_LIBCUSPARSE_VERSION = '11.7.5.86-1'

COLAB_LANGUAGE_SERVER_PROXY_ROOT_URL = 'http://172.28.0.1:8013/'

NV_LIBNPP_VERSION = '11.8.0.86-1'

NCCL_VERSION = '2.15.5-1'

KMP_LISTEN_PORT = '6000'

TF_FORCE_GPU_ALLOW_GROWTH = 'true'

ENV = '/root/.bashrc'

PWD = '/content'

TBE_EPHEM_CREDS_ADDR = '172.28.0.1:8009'

COLAB_LANGUAGE_SERVER_PROXY_REQUEST_TIMEOUT = '30s'

TBE_CREDS_ADDR = '172.28.0.1:8008'

NV_CUDNN_PACKAGE = 'libcudnn8=8.9.0.131-1+cuda11.8'

NVIDIA_DRIVER_CAPABILITIES = 'compute,utility'

COLAB_JUPYTER_TOKEN = ''

LAST_FORCED_REBUILD = '20231004'

NV_NVPROF_DEV_PACKAGE = 'cuda-nvprof-11-8=11.8.87-1'

NV_LIBNPP_PACKAGE = 'libnpp-11-8=11.8.0.86-1'

NV_LIBNCCL_DEV_PACKAGE_NAME = 'libnccl-dev'

TCLLIBPATH = '/usr/share/tcltk/tcllib1.20'

NV_LIBCUBLAS_DEV_VERSION = '11.11.3.6-1'

COLAB_KERNEL_MANAGER_PROXY_HOST = '172.28.0.12'

NVIDIA_PRODUCT_NAME = 'CUDA'

NV_LIBCUBLAS_DEV_PACKAGE_NAME = 'libcublas-dev-11-8'

USE_AUTH_EPHEM = '1'

NV_CUDA_CUDART_VERSION = '11.8.89-1'

COLAB_WARMUP_DEFAULTS = '1'

HOME = '/root'

LANG = 'en_US.UTF-8'

COLUMNS = '100'

CUDA_VERSION = '11.8.0'

CLOUDSDK_CONFIG = '/content/.config'

NV_LIBCUBLAS_PACKAGE = 'libcublas-11-8=11.11.3.6-1'

NV_CUDA_NSIGHT_COMPUTE_DEV_PACKAGE = 'cuda-nsight-compute-11-8=11.8.0-1'

COLAB_RELEASE_TAG = 'release-colab_20231017-060125_RC00'

PYDEVD_USE_FRAME_EVAL = 'NO'

KMP_TARGET_PORT = '9000'

CLICOLOR = '1'

KMP_EXTRA_ARGS = ('--logtostderr --listen_host=172.28.0.12 --target_host=172.28.0.12 '

'--tunnel_background_save_url=https://colab.research.google.com/tun/m/cc48301118ce562b961b3c22d803539adc1e0c19/m-s-fxj6ulpsv7wc ' '--tunnel_background_save_delay=10s ' '--tunnel_periodic_background_save_frequency=30m0s ' '--enable_output_coalescing=true --output_coalescing_required=true')

NV_LIBNPP_DEV_PACKAGE = 'libnpp-dev-11-8=11.8.0.86-1'

COLAB_LANGUAGE_SERVER_PROXY_LSP_DIRS = '/datalab/web/pyright/typeshed-fallback/stdlib,/usr/local/lib/python3.10/dist-packages'

NV_LIBCUBLAS_PACKAGE_NAME = 'libcublas-11-8'

COLAB_KERNEL_MANAGER_PROXY_PORT = '6000'

CLOUDSDK_PYTHON = 'python3'

NV_LIBNPP_DEV_VERSION = '11.8.0.86-1'

ENABLE_DIRECTORYPREFETCHER = '1'

NO_GCE_CHECK = 'False'

JPY_PARENT_PID = '80'

PYTHONPATH = '/env/python'

TERM = 'xterm-color'

NV_LIBCUSPARSE_DEV_VERSION = '11.7.5.86-1'

GIT_PAGER = 'cat'

LIBRARY_PATH = '/usr/local/cuda/lib64/stubs'

NV_CUDNN_VERSION = '8.9.0.131'

SHLVL = '0'

PAGER = 'cat'

COLAB_LANGUAGE_SERVER_PROXY = '/usr/colab/bin/language_service'

NV_CUDA_LIB_VERSION = '11.8.0-1'

NVARCH = 'x86_64'

NV_CUDNN_PACKAGE_DEV = 'libcudnn8-dev=8.9.0.131-1+cuda11.8'

NV_CUDA_COMPAT_PACKAGE = 'cuda-compat-11-8'

MPLBACKEND = 'module://ipykernel.pylab.backend_inline'

NV_LIBNCCL_PACKAGE = 'libnccl2=2.15.5-1+cuda11.8'

LD_LIBRARY_PATH = '/usr/local/nvidia/lib:/usr/local/nvidia/lib64'

COLAB_GPU = ''

GCS_READ_CACHE_BLOCK_SIZE_MB = '16'

NV_CUDA_NSIGHT_COMPUTE_VERSION = '11.8.0-1'

NV_NVPROF_VERSION = '11.8.87-1'

LC_ALL = 'en_US.UTF-8'

COLAB_FILE_HANDLER_ADDR = 'localhost:3453'

PATH = '/root/.buildozer/android/platform/apache-ant-1.9.4/bin:/opt/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/tools/node/bin:/tools/google-cloud-sdk/bin'

NV_LIBNCCL_PACKAGE_NAME = 'libnccl2'

COLAB_DEBUG_ADAPTER_MUX_PATH = '/usr/local/bin/dap_multiplexer'

NV_LIBNCCL_PACKAGE_VERSION = '2.15.5-1'

PYTHONWARNINGS = 'ignore:::pip._internal.cli.base_command'

DEBIAN_FRONTEND = 'noninteractive'

COLAB_BACKEND_VERSION = 'next'

OLDPWD = '/'

_ = '/usr/local/bin/buildozer'

PACKAGES_PATH = '/root/.buildozer/android/packages'

ANDROIDSDK = '/root/.buildozer/android/platform/android-sdk'

ANDROIDNDK = '/root/.buildozer/android/platform/android-ndk-r25b'

ANDROIDAPI = '31'

ANDROIDMINAPI = '21'

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

Boopathy1998 commented 7 months ago

Please Help me anyone friends i am a Beginner how to rectify this error.help me please

CLICOLOR = '1'

KMP_EXTRA_ARGS = ('--logtostderr --listen_host=172.28.0.12 --target_host=172.28.0.12 '

'--tunnel_background_save_url=https://colab.research.google.com/tun/m/cc48301118ce562b961b3c22d803539adc1e0c19/m-s-1k1bf8enztlvp ' '--tunnel_background_save_delay=10s ' '--tunnel_periodic_background_save_frequency=30m0s ' '--enable_output_coalescing=true --output_coalescing_required=true')

NV_LIBNPP_DEV_PACKAGE = 'libnpp-dev-12-2=12.2.1.4-1'

COLAB_LANGUAGE_SERVER_PROXY_LSP_DIRS = '/datalab/web/pyright/typeshed-fallback/stdlib,/usr/local/lib/python3.10/dist-packages'

NV_LIBCUBLAS_PACKAGE_NAME = 'libcublas-12-2'

COLAB_KERNEL_MANAGER_PROXY_PORT = '6000'

CLOUDSDK_PYTHON = 'python3'

NV_LIBNPP_DEV_VERSION = '12.2.1.4-1'

ENABLE_DIRECTORYPREFETCHER = '1'

NO_GCE_CHECK = 'False'

JPY_PARENT_PID = '80'

PYTHONPATH = '/env/python'

TERM = 'xterm-color'

NV_LIBCUSPARSE_DEV_VERSION = '12.1.2.141-1'

GIT_PAGER = 'cat'

LIBRARY_PATH = '/usr/local/cuda/lib64/stubs'

NV_CUDNN_VERSION = '8.9.6.50'

SHLVL = '0'

PAGER = 'cat'

COLAB_LANGUAGE_SERVER_PROXY = '/usr/colab/bin/language_service'

NV_CUDA_LIB_VERSION = '12.2.2-1'

NVARCH = 'x86_64'

NV_CUDNN_PACKAGE_DEV = 'libcudnn8-dev=8.9.6.50-1+cuda12.2'

NV_CUDA_COMPAT_PACKAGE = 'cuda-compat-12-2'

MPLBACKEND = 'module://ipykernel.pylab.backend_inline'

NV_LIBNCCL_PACKAGE = 'libnccl2=2.19.3-1+cuda12.2'

LD_LIBRARY_PATH = '/usr/local/nvidia/lib:/usr/local/nvidia/lib64'

COLAB_GPU = ''

GCS_READ_CACHE_BLOCK_SIZE_MB = '16'

NV_CUDA_NSIGHT_COMPUTE_VERSION = '12.2.2-1'

NV_NVPROF_VERSION = '12.2.142-1'

LC_ALL = 'en_US.UTF-8'

COLAB_FILE_HANDLER_ADDR = 'localhost:3453'

PATH = '/root/.buildozer/android/platform/apache-ant-1.9.4/bin:/opt/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/tools/node/bin:/tools/google-cloud-sdk/bin'

NV_LIBNCCL_PACKAGE_NAME = 'libnccl2'

COLAB_DEBUG_ADAPTER_MUX_PATH = '/usr/local/bin/dap_multiplexer'

NV_LIBNCCL_PACKAGE_VERSION = '2.19.3-1'

PYTHONWARNINGS = 'ignore:::pip._internal.cli.base_command'

DEBIAN_FRONTEND = 'noninteractive'

COLAB_BACKEND_VERSION = 'next'

OLDPWD = '/'

_ = '/usr/local/bin/buildozer'

PACKAGES_PATH = '/root/.buildozer/android/packages'

ANDROIDSDK = '/root/.buildozer/android/platform/android-sdk'

ANDROIDNDK = '/root/.buildozer/android/platform/android-ndk-r25b'

ANDROIDAPI = '31'

ANDROIDMINAPI = '21'

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