I made an android application using the kivy framework. I noticed that in the buildozer.spec file; There are lines that suggest the possibility of implementing an animation to replace the default loading screen.
The lines I'm talking about are...
# (string) Presplash animation using Lottie format.
# see https://lottiefiles.com/ for examples and https://airbnb.design/lottie/
# for general documentation.
# Lottie files can be created using various tools, like Adobe After Effect or Synfig.
#android.presplash_lottie = "path/to/lottie/file.json"
I want to reference a lottie animation from the buildozer.spec file. In order to replace the default loading screen image with a custom loading animation.
The app is already finished. I am in the compilation phase with buildozer. The method I'm using is...
1. Load the modules and the lottie .json animation into an instance of THIS COLAB NOTEBOOK.
2. Run the cells up to the code cell that contains the !buildozer init
command.
3. Modify the buildozer.spec file to reference my .json extension animation.
The modification I make is specifically on line 89 of the buildozer.spec file:
From...
#android.presplash_lottie = "path/to/lottie/file.json"
To...
android.presplash_lottie = "loading.json"
#Note: Below I show some alternative examples of ways in which I tried to modify the file with similar results.
4. Once this modification is done, I continue with the execution of the following code cell: !buildozer -v android debug
. Once the execution is finished I receive the following error message:
[INFO]: COMMAND:
cd /content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/myapp && /content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/myapp/gradlew assembleDebug
[WARNING]: ERROR: /content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/myapp/gradlew failed!
WARNING: Received a --sdk argument, but this argument is deprecated and does nothing.
No setup.py/pyproject.toml used, copying full private data into .apk.
Applying Java source code patches...
Applying patch: src/patches/SDLActivity.java.patch
# Command failed: /usr/bin/python3 -m pythonforandroid.toolchain apk --bootstrap sdl2 --dist_name myapp --name 'My Application' --version 0.1 --package org.test.myapp --minsdk 21 --ndk-api 21 --private /content/.buildozer/android/app --android-entrypoint org.kivy.android.PythonActivity --android-apptheme @android:style/Theme.NoTitleBar --presplash-lottie /content/"loading.json" --orientation portrait --window --copy-libs --arch arm64-v8a --arch armeabi-v7a --color=always --storage-dir="/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a" --ndk-api=21 --ignore-setup-py --debug
# ENVIRONMENT:
# CUDNN_VERSION = '8.0.5.39'
# PYDEVD_USE_FRAME_EVAL = 'NO'
# LD_LIBRARY_PATH = '/usr/local/nvidia/lib:/usr/local/nvidia/lib64'
# CLOUDSDK_PYTHON = 'python3'
# LANG = 'en_US.UTF-8'
# ENABLE_DIRECTORYPREFETCHER = '1'
# HOSTNAME = '4e5cfbd61f47'
# OLDPWD = '/'
# CLOUDSDK_CONFIG = '/content/.config'
# USE_AUTH_EPHEM = '1'
# NVIDIA_VISIBLE_DEVICES = 'all'
# DATALAB_SETTINGS_OVERRIDES = '{"kernelManagerProxyPort":6000,"kernelManagerProxyHost":"172.28.0.3","jupyterArgs":["--ip=172.28.0.2"],"debugAdapterMultiplexerPath":"/usr/local/bin/dap_multiplexer","enableLsp":true}'
# ENV = '/root/.bashrc'
# PAGER = 'cat'
# NCCL_VERSION = '2.7.8'
# TF_FORCE_GPU_ALLOW_GROWTH = 'true'
# JPY_PARENT_PID = '45'
# NO_GCE_CHECK = 'False'
# PWD = '/content'
# HOME = '/root'
# LAST_FORCED_REBUILD = '20220726'
# CLICOLOR = '1'
# DEBIAN_FRONTEND = 'noninteractive'
# LIBRARY_PATH = '/usr/local/cuda/lib64/stubs'
# GCE_METADATA_TIMEOUT = '3'
# GLIBCPP_FORCE_NEW = '1'
# TBE_CREDS_ADDR = '172.28.0.1:8008'
# TERM = 'xterm-color'
# SHELL = '/bin/bash'
# GCS_READ_CACHE_BLOCK_SIZE_MB = '16'
# PYTHONWARNINGS = 'ignore:::pip._internal.cli.base_command'
# MPLBACKEND = 'module://ipykernel.pylab.backend_inline'
# CUDA_VERSION = '11.1.1'
# NVIDIA_DRIVER_CAPABILITIES = 'compute,utility'
# SHLVL = '1'
# PYTHONPATH = '/env/python'
# NVIDIA_REQUIRE_CUDA = ('cuda>=11.1 brand=tesla,driver>=418,driver<419 '
'brand=tesla,driver>=440,driver<441 brand=tesla,driver>=450,driver<451')
# TBE_EPHEM_CREDS_ADDR = '172.28.0.1:8009'
# COLAB_GPU = '0'
# GLIBCXX_FORCE_NEW = '1'
# 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'
# LD_PRELOAD = '/usr/lib/x86_64-linux-gnu/libtcmalloc.so.4'
# GIT_PAGER = 'cat'
# _ = '/usr/local/bin/buildozer'
# PACKAGES_PATH = '/root/.buildozer/android/packages'
# ANDROIDSDK = '/root/.buildozer/android/platform/android-sdk'
# ANDROIDNDK = '/root/.buildozer/android/platform/android-ndk-r23b'
# ANDROIDAPI = '27'
# 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
I know that the problem lies in the modification that I made in the buildozer.spec file because when I do the same process skipping this step, the apk file is generated correctly.
That's the problem. That said, I proceed to declare information that may be useful to anyone who wants to help me with this.
Hello world in kivy
(So you don't have to write or search one)
main.py
import kivy
from kivy.app import App
from kivy.uix.label import Label
class MyApp(App):
def build(self):
return Label(text='Hello World')
if __name__ == "__main__":
MyApp().run()
Free example .json animation in lottie
List of solutions that I tried but that do not work
-
Replace line 89 of buildozer.spec with
android.presplash_lottie = "path/to/lottie/loading.json"
-
Replace it with
android.presplash_lottie = "loading.json"
-
Replace it with
android.presplash_lottie = "/content/loading.json"
-
Replace it with
android.presplash_lottie = %(source.dir)s/data/loading.json
-
Add json to
source.include_exts = py,png,jpg,kv,atlas
Thanks in advance! Hope it's useful.
from Replace default loading screen image with custom animation
No comments:
Post a Comment