Skip to content

SDL2_ttf / Harfbuzz build failure with NDK r26b despite local recipes #3295

Closed as not planned

Description

@ADonayreIA

Hello,
I am trying to build a Kivy app with Buildozer and python‑for‑android using NDK r26b, because Google Play now requires 16k page size support. With NDK r25b the build succeeds, but the generated libraries are rejected by Play Console due to the page size requirement.

When I use NDK r26b, the build fails inside SDL2_ttf’s bundled Harfbuzz with errors like:
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]

I attempted to override the internal recipes by creating local recipes in p4a-recipes/sdl2_ttf and p4a-recipes/pyjnius-sdl2, added them to requirements, and confirmed that --local-recipes /path/to/p4a-recipes is passed to the toolchain. However, the build log never shows my local recipes being used (no print statements, no raise Exception triggers), and the build continues to use the internal SDL2_ttf with the old Harfbuzz sources.

Environment:

  • Buildozer on Linux
  • python‑for‑android master
  • NDK r26b (Play Console requires this for 16k page size)
  • Kivy 2.3.0
  • Requirements include python3,kivy,ffpyplayer,pillow,cryptography,android,kivymd,plyer,pyjnius,sdl2_ttf,SQLite3

Problem:

  • Local recipes are not being recognized/used, even though --local-recipes is passed.
  • As a result, SDL2_ttf always compiles with the bundled Harfbuzz that fails under NDK r26b.

Question:

  • How can I force python‑for‑android to use my local recipes for sdl2_ttf and pyjnius-sdl2 instead of the internal ones?
  • Is there an official fix or recommended approach for building with NDK r26b and satisfying Play Console’s 16k page size requirement?

Thank you for your help!

Activity

  1. T-Dynamos commented on Mar 23, 2026

    @T-Dynamos
    Member

    @ADonayreIA Why not use p4a develop?

  2. ADonayreIA commented on Mar 23, 2026

    @ADonayreIA
    Author

    @ADonayreIA Why not use p4a develop?

    I use Visual Studio Code with Python Kivy and KivyMD, that's how I started building the app that I am uploading to Play Console. I don't know p4a develop.

  3. T-Dynamos commented on Mar 24, 2026

    @T-Dynamos
    Member

    @ADonayreIA Sorry for the ambiguity, I meant that you should use python-for-android develop branch instead of master. develop branch already uses latest ndk.

  4. Novfensec commented on Mar 24, 2026

    @Novfensec
    Contributor

    @ADonayreIA Why not use p4a develop?

    I use Visual Studio Code with Python Kivy and KivyMD, that's how I started building the app that I am uploading to Play Console. I don't know p4a develop.

    p4a.branch=develop
    In buildozer.spec.

  5. ADonayreIA commented on Mar 24, 2026

    @ADonayreIA
    Author

    @ADonayreIA Why not use p4a develop?

    I use Visual Studio Code with Python Kivy and KivyMD, that's how I started building the app that I am uploading to Play Console. I don't know p4a develop.

    p4a.branch=develop In buildozer.spec.

    Thank

    I overcame the problems with SDL2_ttf, but it gives me this error:
    /home/adonayre/avantier/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/ffpyplayer-openssl/arm64-v8a__ndk_target_21/ffpyplayer/ffpyplayer/pic.c:1291:10: fatal error: 'libavcodec/avfft.h' file not found

    with this requirements:
    requirements = python3,kivy,ffpyplayer,pillow,cryptography,android,kivymd,plyer,pyjnius,sdl2_ttf,SQLite3

    Should I try with other versions of ffpyplayer?

    Thank for your help.

  6. Novfensec commented on Mar 24, 2026

    @Novfensec
    Contributor

    @ADonayreIA Why not use p4a develop?

    I use Visual Studio Code with Python Kivy and KivyMD, that's how I started building the app that I am uploading to Play Console. I don't know p4a develop.

    p4a.branch=develop In buildozer.spec.

    Thank

    I overcame the problems with SDL2_ttf, but it gives me this error:
    /home/adonayre/avantier/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/ffpyplayer-openssl/arm64-v8a__ndk_target_21/ffpyplayer/ffpyplayer/pic.c:1291:10: fatal error: 'libavcodec/avfft.h' file not found

    with this requirements:
    requirements = python3,kivy,ffpyplayer,pillow,cryptography,android,kivymd,plyer,pyjnius,sdl2_ttf,SQLite3

    Should I try with other versions of ffpyplayer?

    Thank for your help.

    I hope you know about the requirements for ffmpeg based ffpyplayer. But still

    sudo apt install ffmpeg libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libswresample-dev
    

    You need these libs to compile ffpyplayer.

  7. ADonayreIA commented on Mar 25, 2026

    @ADonayreIA
    Author

    @ADonayreIA Why not use p4a develop?

    I use Visual Studio Code with Python Kivy and KivyMD, that's how I started building the app that I am uploading to Play Console. I don't know p4a develop.

    p4a.branch=develop In buildozer.spec.

    Thank
    I overcame the problems with SDL2_ttf, but it gives me this error:
    /home/adonayre/avantier/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/ffpyplayer-openssl/arm64-v8a__ndk_target_21/ffpyplayer/ffpyplayer/pic.c:1291:10: fatal error: 'libavcodec/avfft.h' file not found
    with this requirements:
    requirements = python3,kivy,ffpyplayer,pillow,cryptography,android,kivymd,plyer,pyjnius,sdl2_ttf,SQLite3
    Should I try with other versions of ffpyplayer?
    Thank for your help.

    I hope you know about the requirements for ffmpeg based ffpyplayer. But still

    sudo apt install ffmpeg libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libswresample-dev
    

    You need these libs to compile ffpyplayer.

    Thank, after install ffmpeg it gives me this error:

    Wno-error
    /home/adonayre/avantier/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/ffpyplayer-openssl/arm64-v8a__ndk_target_21/ffpyplayer/ffpyplayer/pic.c:1291:10: fatal error: 'libavcodec/avfft.h' file not found
    #include "libavcodec/avfft.h"

    I ty to patch with mi own local recipes for ffpyplayer.

    it's well?

    Thank for your help.

  8. Novfensec commented on Mar 28, 2026

    @Novfensec
    Contributor

    @ADonayreIA You have to add ffmpeg in the buildozer.spec requirements before building anything related to it. It means add it in order so that ffmpeg comes first then your other requirements.

  9. ADonayreIA commented on Mar 29, 2026

    @ADonayreIA
    Author

    @ADonayreIA You have to add ffmpeg in the buildozer.spec requirements before building anything related to it. It means add it in order so that ffmpeg comes first then your other requirements.

    Thank you, this is my current requirements:

    requirements = python3,kivy,ffpyplayer,pillow,cryptography,openssl,android,kivymd,plyer,pyjnius,sqlite3

    What should be the order or what should be the correct requirements?

    Thank you for your help.

  10. Novfensec commented on Mar 29, 2026

    @Novfensec
    Contributor

    @ADonayreIA You have to add ffmpeg in the buildozer.spec requirements before building anything related to it. It means add it in order so that ffmpeg comes first then your other requirements.

    Thank you, this is my current requirements:

    requirements = python3,kivy,ffpyplayer,pillow,cryptography,openssl,android,kivymd,plyer,pyjnius,sqlite3

    What should be the order or what should be the correct requirements?

    Thank you for your help.

    requirements = python3, kivy, ffmpeg, ffpyplayer, pillow, cryptography, android, pyjnius, plyer

    I hope you are not using the latest version of kivymd on girthub or else the requirments will change.
    Please continue after this on official kivy discord. https://discord.gg/XmG8pup8w

  11. github-actions commented on Mar 29, 2026

    @github-actions

    👋 @ADonayreIA,
    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.

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