Python Forum
Kivy Flask Buildozer compile apk
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Kivy Flask Buildozer compile apk
#3
I tried compile many apps without any issues. But if I add:
from flask import Flask
For example
from kivy.app import App
from kivy.uix.button import Button
from flask import Flask

class MyApp(App):

    def build(self):
        flask_installed = self.check_flask_import()
        if flask_installed:
            return Button(text='Flask is installed!')
        else:
            return Button(text='Flask is not installed!')

    def check_flask_import(self):
        try:
            import flask
            return True
        except ImportError:
            return False

if __name__ == '__main__':
    MyApp().run()
I can start python code on Pydroid, Linux OK. After compile app did not start. If I remove Flask import, it works OK.

Buildozer.spec (part)
[app]

# (str) Title of your application
title = VGServis

# (str) Package name
package.name = VGServis

# (str) Package domain (needed for android/ios packaging)
package.domain = vibroguard.cz

# (str) Source code where the main.py live
source.dir = .

# (list) Source files to include (let empty to include all the files)
source.include_exts = py,png,jpg,kv,atlas

# (list) List of inclusions using pattern matching
#source.include_patterns = assets/*,images/*.png

# (list) Source files to exclude (let empty to not exclude anything)
#source.exclude_exts = spec

# (list) List of directory to exclude (let empty to not exclude anything)
#source.exclude_dirs = tests, bin, venv

# (list) List of exclusions using pattern matching
# Do not prefix with './'
#source.exclude_patterns = license,images/*/*.jpg

# (str) Application versioning (method 1)
version = 0.1

# (str) Application versioning (method 2)
# version.regex = __version__ = ['"](.*)['"]
# version.filename = %(source.dir)s/main.py

# (list) Application requirements
# comma separated e.g. requirements = sqlite3,kivy
requirements = python3,kivy,numpy,serial,pyserial,usb4a,usbserial4a,flask,flask_cors

# (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes
# requirements.source.kivy = ../../kivy

# (str) Presplash of the application
#presplash.filename = %(source.dir)s/data/presplash.png

# (str) Icon of the application
#icon.filename = %(source.dir)s/data/icon.png

# (list) Supported orientations
# Valid options are: landscape, portrait, portrait-reverse or landscape-reverse
orientation = portrait,landscape

# (list) List of service to declare
#services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PY

#
# OSX Specific
#

#
# author = © Copyright Info

# change the major version of python used by the app
osx.python_version = 3

# Kivy version to use
osx.kivy_version = 1.9.1

#
# Android specific
#

# (bool) Indicate if the application should be fullscreen or not
fullscreen = 0

# (string) Presplash background color (for android toolchain)
# Supported formats are: #RRGGBB #AARRGGBB or one of the following names:
# red, blue, green, black, white, gray, cyan, magenta, yellow, lightgray,
# darkgray, grey, lightgrey, darkgrey, aqua, fuchsia, lime, maroon, navy,
# olive, purple, silver, teal.
#android.presplash_color = #FFFFFF

# (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"

# (str) Adaptive icon of the application (used if Android API level is 26+ at runtime)
#icon.adaptive_foreground.filename = %(source.dir)s/data/icon_fg.png
#icon.adaptive_background.filename = %(source.dir)s/data/icon_bg.png

# (list) Permissions
# (See https://python-for-android.readthedocs.io/en/latest/buildoptions/#build-options-1 for all the supported syntaxes and properties)
android.permissions = android.permission.INTERNET,ACCESS_NETWORK_STATE (name=android.permission.WRITE_EXTERNAL_STORAGE;maxSdkVersion=18)
Any suggestion?
Thanks
Reply


Messages In This Thread
Kivy Flask Buildozer compile apk - by frohr - Oct-03-2023, 07:11 PM
RE: Kivy Flask Buildozer compile apk - by Larz60+ - Oct-03-2023, 10:22 PM
RE: Kivy Flask Buildozer compile apk - by frohr - Oct-06-2023, 03:12 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Buildozer fails building Kivy app for android Kolterdyx 0 4,503 Apr-30-2020, 06:31 PM
Last Post: Kolterdyx

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020