Skip to content

Unable to create flet app #2963

Closed
Closed

Description

@bambier

Checklist

  • the issue is indeed a bug and not a support request
  • issue doesn't already exist: https://github.com/kivy/python-for-android/issues
  • I have a short, runnable example that reproduces the issue
  • I reproduced the problem with the latest development version (p4a.branch = develop)
  • I used the grave accent (aka backticks) to format code or logs when appropriated

Versions

  • Python: 3.11
  • OS: Ubuntu 23.10
  • Flet 0.19.0
  • Cython: All three 3.0.8 and/or 0.29.33 and/or 0.29.36
  • OpenJDK: Both 17 and/or 22
  • ndk: android-ndk-r26b and/or 26.1.10909125
  • sdk: latest

Description

I tried to create android application with p4a but after running create app I got this error which points to problem in harfbuzz .

I had cleared cache with p4a clean_all but nothing changes.

PS: I had created same issue in harfbuzz repo

Short runable code

# pip install flet
import flet as ft

def main(page: ft.Page):
    pass

ft.app(target=main)

p4a direct command

p4a create apk --name My Application --version 1.0.0 --package com.example --orientation portrait --icon assets/icon.png --presplash-color "#8A83FC" --enable-androidx --add-resource assets/ --sdk-dir /home/nima/Android/Sdk/cmdline-tools/ --ndk-dir /home/nima/Android/Sdk/ndk/android-ndk-r26b/ --android-api 34 --ndk-api 27 --debug --arch arm64-v8a --arch x86_64 --arch armeabi-v7a --bootstrap sdl2 --requirements fletplyer --private /home/nima/Desktop/python-projects/ffdroid/src --blacklist-requirements sqlite3openssllibffikivy 

Logs

[arm64-v8a] Compile++      : harfbuzz <= hb-ft.cc
rm -f /home/nima/.local/share/python-for-android/build/bootstrap_builds/sdl2/obj/local/arm64-v8a/objs-debug/harfbuzz/src/hb-ft.o
/usr/bin/ccache /home/nima/Android/Sdk/ndk/android-ndk-r26b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -MMD -MP -MF /home/nima/.local/share/python-for-android/build/bootstrap_builds/sdl2/obj/local/arm64-v8a/objs-debug/harfbuzz/src/hb-ft.o.d -target aarch64-none-linux-android27 -fdata-sections -ffunction-sections -fstack-protector-strong -funwind-tables -no-canonical-prefixes  --sysroot /home/nima/Android/Sdk/ndk/android-ndk-r26b/toolchains/llvm/prebuilt/linux-x86_64/sysroot -g -Wno-invalid-command-line-argument -Wno-unused-command-line-argument  -D_FORTIFY_SOURCE=2 -fno-exceptions -fno-rtti -fpic -O0 -UNDEBUG -fno-limit-debug-info  -I/home/nima/.local/share/python-for-android/build/bootstrap_builds/sdl2/jni/SDL2_ttf/external/harfbuzz/ -I/home/nima/.local/share/python-for-android/build/bootstrap_builds/sdl2/jni/SDL2_ttf/external/harfbuzz/src/ -I/home/nima/.local/share/python-for-android/build/bootstrap_builds/sdl2/jni/SDL2_ttf/external/harfbuzz/../freetype/include/ -I/home/nima/.local/share/python-for-android/build/bootstrap_builds/sdl2/jni/SDL2_ttf/external/harfbuzz    -DANDROID -DHAVE_CONFIG_H -fPIC -Wformat -Werror=format-security   -c  /home/nima/.local/share/python-for-android/build/bootstrap_builds/sdl2/jni/SDL2_ttf/external/harfbuzz/src/hb-ft.cc -o /home/nima/.local/share/python-for-android/build/bootstrap_builds/sdl2/obj/local/arm64-v8a/objs-debug/harfbuzz/src/hb-ft.o
/home/nima/.local/share/python-for-android/build/bootstrap_builds/sdl2/jni/SDL2_ttf/external/harfbuzz/src/hb-ft.cc:759:73: error: cast from 'void (*)(FT_Face)' (aka 'void (*)(FT_FaceRec_ *)') to 'FT_Generic_Finalizer' (aka 'void (*)(void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
  if (unlikely (!ft_face->generic.data || ft_face->generic.finalizer != (FT_Generic_Finalizer) hb_ft_face_finalize))
                                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/nima/.local/share/python-for-android/build/bootstrap_builds/sdl2/jni/SDL2_ttf/external/harfbuzz/src/hb.hh:263:25: note: expanded from macro 'unlikely'
#define unlikely(expr) (expr)
                        ^~~~
/home/nima/.local/share/python-for-android/build/bootstrap_builds/sdl2/jni/SDL2_ttf/external/harfbuzz/src/hb-ft.cc:765:34: error: cast from 'void (*)(FT_Face)' (aka 'void (*)(FT_FaceRec_ *)') to 'FT_Generic_Finalizer' (aka 'void (*)(void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    ft_face->generic.finalizer = (FT_Generic_Finalizer) hb_ft_face_finalize;
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/nima/.local/share/python-for-android/build/bootstrap_builds/sdl2/jni/SDL2_ttf/external/harfbuzz/src/hb-ft.cc:1035:32: error: cast from 'void (*)(FT_Face)' (aka 'void (*)(FT_FaceRec_ *)') to 'FT_Generic_Finalizer' (aka 'void (*)(void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
  ft_face->generic.finalizer = (FT_Generic_Finalizer) _release_blob;
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 errors generated.
make: *** [/home/nima/Android/Sdk/ndk/android-ndk-r26b/build/core/build-binary.mk:415: /home/nima/.local/share/python-for-android/build/bootstrap_builds/sdl2/obj/local/arm64-v8a/objs-debug/harfbuzz/src/hb-ft.o] Error 1

### Tasks

Activity

  1. github-actions commented on Jan 28, 2024

    @github-actions

    👋 @bambier,
    Sorry to hear you are having difficulties with Kivy's python-for-android; Kivy unites a number of different technologies, so building apps can be temperamental.
    We try to use GitHub issues only to track work for developers to do to fix bugs and add new features to python-for-android.
    However, this issue appears to be a support request. Please use our support channels to get help with the project.
    If you're having trouble installing python-for-android, please see our quickstart guide.
    If you're having trouble using python-for-android, please see our troubleshooting guide and FAQ.
    Let us know if this comment was made in error, and we'll be happy to reopen the issue.

  2. bambier commented on Jan 28, 2024

    @bambier
    Author

    It's not support request! Its BUG! BUUUUUUUUUG!
    You use outdated version of HarfBazz (2.6.4) while latest version is 8.3.0

    I ran into same error with kivy too!

  3. Julian-O commented on Jan 29, 2024

    @Julian-O
    Contributor

    You've raised a bug report about Flet.
    You've raised a bug report against HarfBazz?
    You say the problem occurs in Kivy too?
    You know the existing recipe only works with one version of HarfBuzz but you are using another?

    Please for assistance in the support channels on how to focus this bug report into something clear and actionable.

    If you think a recipe needs updating, please consider updating it and submitting a PR. See PR #2069 for inspiration.

  4. added 2 commits that reference this issue on Dec 14, 2024
    69d4705
    10e2ba9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions