In this tutorial , we will see in detail about the common issues faced during the deployment of mobile applications using Kivy framework.Below are the pre requisites are required for running a mobile application.
Pre Requisties |
1 – Python Intrepreter |
2 – Kivy Framework |
3 – Buildozer |
1 – Python Interpreter
Python Interpreter helps to run the python programs.
1.1 Python version
To identify the version type python or python3 in the terminal window. Here we have python 3.8 version installed in the system.
1.2 Python Interpreter path
Below are the commands to be run on the terminal window to identify the directory path of python.exe
>>> import os
>>> import sys
>>> os.path.dirname(sys.executable)
1.3 Installing modules in Pycharm
Below are the steps to install module/package in pycharm.
i) Go to Preferences and select “+” to install the package.
ii) Search the package/module to be installed and choose Install package option to complete installation.
1.4 Setting Python environment Variables
Go to Control Panel -> System -> Advanced and select “System Variables”
Select Environment Variables and find path and click on it
Click Edit and add the python.exe location path to set the python path.
This can also be done using SET PYTHONPATH=%PYTHONPATH%’path location of python.exe’
2 – Kivy Framework
Kivy is an application framework to develop mobile applications using python.
This can be added as a module into Pycharm using install package option under Preferences.
2.1 Identify Kivy version installed to fix compatibility issues
3 – Buildozer :- Building Android mobile applications
After developing an application program using Kivy framework, to deploy the same into a mobile environment a build software is required. Buildozer helps in deploying the application program into .apk and run in Android OS.
3.1 Installing buildozer
Run the command pip install buildozer.
3.2 Creating Buildozer.spec file for building your application
Run the command buildozer init
3.3 Building application program to .apk file
Run the command buildozer -v android debug
Configuration Issues faced while building an application using BUILDOZER
Below are the issues faced in buildozer -v android debug
S.No | Issues | Mitigation Steps |
1 | Errors in accessing local SSL certificate | 1) Go to the python installed path and select Install Certificates.command file. 2) Double click and run the file. |
2 | Android NDK installation | Verify if the Android NDK successfully installed inside you buildozer path |
3 | Android SDK Installation | Verify if the Android SDK successfully installed inside you buildozer path |
4 | Android SDK not installed | a) Follow below steps to install android SDK cd ~/.buildozer/android/platform/android-sdk && \curl -L -O -C – https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip |
5 | Issues in identifying the path of Android SDK | b) copy and paste pwd output to buildozer.spec line (no quotes needed): android.sdk_path = PWD_OUTPUT |
6 | If the build is not successful still due to compatibility issues | Re-install the buildozer pip install –user buildozer # latest dev version # if you use a virtual environment, don’t use the `–user` option pip install –user https://github.com/kivy/buildozer/archive/master.zip # git clone, for working on buildozer git clone https://github.com/kivy/buildozer cd buildozer python setup.py build pip install -e. |