Skip to content

[CRITICAL] Master branch broken for Android/Windows due to MaterialShapes (Cairo) dependency #1842

@messenger3

Description

@messenger3

The recent integration of MaterialShapes has introduced a hidden, non-Pythonic dependency chain that breaks KivyMD’s cross-platform compatibility—specifically for Android and Windows.

MaterialShapes now depends on pycairo, which requires the Cairo graphics library (a binary C-extension) to be installed on the host system.

The Issue for KivyMD

  1. Android (Blocking): There is no python-for-android (p4a) recipe for cairo. Consequently, buildozer fails to package the APK because it cannot cross-compile the Cairo C-headers for ARM. This makes the current Master branch unusable for mobile development.
  2. Windows/macOS: Standard pip install fails unless the user manually installs the Cairo binary and configures system environment variables. This violates KivyMD's "well-behaved package" standard.
  3. Architectural Regression: KivyMD has traditionally avoided system-level dependencies that aren't bundled in wheels or handled by p4a recipes. This change introduces a "Linux-only" constraint to the core library.

Evidence

When building for Android or installing on a clean Windows environment, the process crashes during the pycairo setup:
Error: pkg-config --exists 'cairo >= 1.15.10' returned non-zero exit status 1

Suggested Action

  • Revert/Modify MaterialShapes: Request that the MaterialShapes maintainer remove the Cairo dependency in favor of a Pure-Python solution (like Pillow) or Kivy’s native Canvas instructions.
  • Dependency Shielding: If MaterialShapes cannot be fixed, it should be treated as an optional extra or replaced to ensure the KivyMD core remains installable via pip on all platforms.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions