May 2024

How to read and write to external storage in latest android API>29 from Kivy python

How to read and write to external storage in latest android API>29 from Kivy python

Latest development in Android needs significant modifications in the way we seek permissions to read and write files in the external storage of android. Old method of seeking android.permission.READ_EXTERNAL_STORAGE and android.permission.WRITE_EXTERNAL_STORAGE will not work any more. Lets see the reason and the possible work around to resolve this in this post. The Python code with […]

How to read and write to external storage in latest android API>29 from Kivy python Read More »

How to solve hunks FAILED -- saving rejects to file

How to solve hunks FAILED — saving rejects to file

During the building of android app from python code you may come across this error RAN: /usr/bin/patch -t -d /home/gk/.local/share/python-for-android/build/other_builds/opencv/arm64-v8a__ndk_target_24/opencv -p1 -i /home/gk/.local/lib/python3.11/site-packages/pythonforandroid/recipes/opencv/patches/p4a_build.patch STDOUT: patching file cmake/OpenCVDetectPython.cmake Hunk #1 FAILED at 175. Hunk #2 FAILED at 244. 2 out of 2 hunks FAILED — saving rejects to file cmake/OpenCVDetectPython.cmake.rej patching file modules/python/CMakeLists.txt What does the

How to solve hunks FAILED — saving rejects to file Read More »

How to solve Running cythonize failed in python for android or buildozer

How to solve Running cythonize failed in python for android or buildozer

The error Running cythonize failed can be a outcome when the numpy version you are building is not suitable for the python interpreter you are packaging. This can happen when you use Python for android and Buildozer. Error output Following is the error output Error compiling Cython file: ———————————————————— … self.rng_state.ctr.v[i] = counter[i] self._reset_state_variables() self._bitgen.state

How to solve Running cythonize failed in python for android or buildozer Read More »

How to solve destination path external jpeg' already exists and is not an empty directory.

How to solve destination path ‘external/jpeg’ already exists and is not an empty directory.

Some times you may get the following error while building an android app from python code RAN: /home/gk/.local/share/python-for-android/build/bootstrap_builds/sdl2/jni/SDL2_image/external/download.sh STDOUT: fatal: destination path ‘external/jpeg’ already exists and is not an empty directory. This can be resolved by cleaning the build in both python for android p4a or buildozer by executing the following commands p4aclean-dists p4aclean_download_cache p4aclean_builds

How to solve destination path ‘external/jpeg’ already exists and is not an empty directory. Read More »

Resolve No module named math during building app in python for android or buildozer

Solve No module named math during building app in python for android or buildozer

While building an Python based android app you may encounter the following error [2m< from random import Random as _Random[0m [2m< File “/home/gk/.local/share/python-for- android/build/other_builds/hostpython3/desktop/hostpython3/Lib/random.py”, line 49, in <module>[0m [2m< from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as _ceil[0m [2m< ModuleNotFoundError: No module named ‘math’[0m[2m[0m This is

Solve No module named math during building app in python for android or buildozer Read More »

KivyMD recipe for python for android and buildozer

KivyMD recipe for python for android and buildozer

Why this kivyMD recipe After the development of the app in Python, Kivy  and  KivyMD, eventually, you would want to convert the python code to an android app. For this step, you need to add kivyMD as a requirements in Python for android or Buildozer. KivyMD has undergone a major change recently. The kivyMD mentioned

KivyMD recipe for python for android and buildozer Read More »

How to convert python code to an android app in 5 steps

Python to android App in 5 steps

Here are the 5 steps to convert your python code to an android apk Write and test your python code in desktop pc Run the following command p4a apk –private [dir location] –package org.techris.kmd –name “Custom name” –version 24.05.10 –bootstrap sdl2 –requirements python3==3.11.2,kivy,kivymd –sdk-dir [SDK installation location] –ndk-dir [ndk installation location] –android-api 34 –ndk-api 24

Python to android App in 5 steps Read More »

How to solve ModuleNotFoundError: No module named 'setuptools'

How to solve ModuleNotFoundError: No module named ‘setuptools’ with p4a and buildozer

As you are dealing with Python packages, some times you may need to use the setup.py script to build certain packages. But some time, you will face the following error STDOUT: Traceback (most recent call last): File “/home/gk/.local/share/python-for-android/build/other_builds/kivymd/armeabi-v7a__ndk_target_24/kivymd/setup.py”, line 8, in <module> from setuptools import find_packages, setup ModuleNotFoundError: No module named ‘setuptools’ For this example,

How to solve ModuleNotFoundError: No module named ‘setuptools’ with p4a and buildozer Read More »

404

Oops. What you are looking for does not exist. You can try the following Search for you need from the search box above Visit the categories and archives given

404 Read More »

Scroll to Top