Skip to content

Unable to create flet app #2963

Closed
Closed
@bambier

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

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