Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing toga-chart on Android fails - wheels for pygobject #24

Closed
terminator-ger opened this issue Feb 26, 2023 · 5 comments · Fixed by #54
Closed

Installing toga-chart on Android fails - wheels for pygobject #24

terminator-ger opened this issue Feb 26, 2023 · 5 comments · Fixed by #54
Labels
android The issue relates to Android mobile support. bug A crash or error in behavior.

Comments

@terminator-ger
Copy link

Describe the bug

Using either Linux Mint/ Windows building for android fails at building wheels for pygobject

(py-310) PS E:\dev\wrbattlesim> briefcase build android

[...]

Collecting setuptools
  Using cached setuptools-67.4.0-py3-none-any.whl (1.1 MB)
Building wheels for collected packages: pygobject, pycairo
  Building wheel for pygobject (PEP 517): started
  Building wheel for pygobject (PEP 517): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\Michael\AppData\Local\Programs\Python\Python310\python.exe' 'E:\dev\wrbattlesim\android\gradle\WRBattleSim\app\build\generated\python\bp\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\Michael\AppData\Local\Temp\tmpm51vasy_'
       cwd: C:\Users\Michael\AppData\Local\Temp\pip-install-zon9ywuv\pygobject
  Complete output (39 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-cpython-310
  creating build\lib.win-amd64-cpython-310\pygtkcompat
  copying pygtkcompat\generictreemodel.py -> build\lib.win-amd64-cpython-310\pygtkcompat
  copying pygtkcompat\pygtkcompat.py -> build\lib.win-amd64-cpython-310\pygtkcompat
  copying pygtkcompat\__init__.py -> build\lib.win-amd64-cpython-310\pygtkcompat
  creating build\lib.win-amd64-cpython-310\gi
  copying gi\docstring.py -> build\lib.win-amd64-cpython-310\gi
  copying gi\importer.py -> build\lib.win-amd64-cpython-310\gi
  copying gi\module.py -> build\lib.win-amd64-cpython-310\gi
  copying gi\pygtkcompat.py -> build\lib.win-amd64-cpython-310\gi
  copying gi\types.py -> build\lib.win-amd64-cpython-310\gi
  copying gi\_constants.py -> build\lib.win-amd64-cpython-310\gi
  copying gi\_error.py -> build\lib.win-amd64-cpython
[console_out.txt](https://github.com/beeware/briefcase/files/10834000/console_out.txt)
-310\gi
  copying gi\_gtktemplate.py -> build\lib.win-amd64-cpython-310\gi
  copying gi\_option.py -> build\lib.win-amd64-cpython-310\gi
  copying gi\_ossighelper.py -> build\lib.win-amd64-cpython-310\gi
  copying gi\_propertyhelper.py -> build\lib.win-amd64-cpython-310\gi
  copying gi\_signalhelper.py -> build\lib.win-amd64-cpython-310\gi
  copying gi\__init__.py -> build\lib.win-amd64-cpython-310\gi
  creating build\lib.win-amd64-cpython-310\gi\repository
  copying gi\repository\__init__.py -> build\lib.win-amd64-cpython-310\gi\repository
  creating build\lib.win-amd64-cpython-310\gi\overrides
  copying gi\overrides\Gdk.py -> build\lib.win-amd64-cpython-310\gi\overrides
  copying gi\overrides\GdkPixbuf.py -> build\lib.win-amd64-cpython-310\gi\overrides
  copying gi\overrides\GIMarshallingTests.py -> build\lib.win-amd64-cpython-310\gi\overrides
  copying gi\overrides\Gio.py -> build\lib.win-amd64-cpython-310\gi\overrides
  copying gi\overrides\GLib.py -> build\lib.win-amd64-cpython-310\gi\overrides
  copying gi\overrides\GObject.py -> build\lib.win-amd64-cpython-310\gi\overrides
  copying gi\overrides\Gtk.py -> build\lib.win-amd64-cpython-310\gi\overrides
  copying gi\overrides\keysyms.py -> build\lib.win-amd64-cpython-310\gi\overrides
  copying gi\overrides\Pango.py -> build\lib.win-amd64-cpython-310\gi\overrides
  copying gi\overrides\__init__.py -> build\lib.win-amd64-cpython-310\gi\overrides
  running build_ext
  'pkg-config' not found.
  Arguments: ('pkg-config', '--print-errors', '--exists', 'glib-2.0 >= 2.56.0')
  ----------------------------------------
  ERROR: Failed building wheel for pygobject
  Building wheel for pycairo (PEP 517): started
  Building wheel for pycairo (PEP 517): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\Michael\AppData\Local\Programs\Python\Python310\python.exe' 'E:\dev\wrbattlesim\android\gradle\WRBattleSim\app\build\generated\python\bp\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\Michael\AppData\Local\Temp\tmp8vafpeej'
       cwd: C:\Users\Michael\AppData\Local\Temp\pip-install-zon9ywuv\pycairo
  Complete output (12 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-cpython-310
  creating build\lib.win-amd64-cpython-310\cairo
  copying cairo\__init__.py -> build\lib.win-amd64-cpython-310\cairo
  copying cairo\__init__.pyi -> build\lib.win-amd64-cpython-310\cairo
  copying cairo\py.typed -> build\lib.win-amd64-cpython-310\cairo
  running build_ext
  'pkg-config' not found.
  Command ['pkg-config', '--print-errors', '--exists', 'cairo >= 1.15.10']
  ----------------------------------------
  ERROR: Failed building wheel for pycairo
Failed to build pygobject pycairo
ERROR: Could not build wheels for pygobject, pycairo which use PEP 517 and cannot be installed directly
Chaquopy: Exit status 1

console_out.txt

Steps to reproduce

  1. checkout https://github.com/terminator-ger/wrbattlesim
  2. briefcase build android

Expected behavior

Successful build of apk

Screenshots

No response

Environment

  • Operating System: Linux Mint 20.03 / Win 10
  • Python version: 3.10
  • Software versions:
    • Briefcase: 0.3.12
    • Toga: 0.3.0

Logs

briefcase.2023_02_26-16_12_04.build.log

Additional context

No response

@terminator-ger terminator-ger added the bug A crash or error in behavior. label Feb 26, 2023
@mhsmith mhsmith changed the title building android fails - wheels for pygobject Installing toga-chart on Android fails - wheels for pygobject Feb 26, 2023
@mhsmith mhsmith added the android The issue relates to Android mobile support. label Feb 26, 2023
@mhsmith
Copy link
Member

mhsmith commented Feb 26, 2023

It shouldn't be installing pygobject for Android, but it gets brought in by the following chain: pygobject>=3.14.0->toga-gtk==0.3.0; sys_platform == "linux"->toga>=0.3.0.dev22->toga-chart. This is an awkward one, because sys_platform == "linux" is a condition that sometimes should match on Android, and sometimes shouldn't (chaquo/chaquopy#980 (comment)).

In this case, I don't think toga-chart would have worked on Android anyway, because Toga's Canvas implementation is incomplete for Android. Instead, try using matplotlib directly, as shown here.

@mhsmith
Copy link
Member

mhsmith commented Feb 26, 2023

@freakboy3742: This issue should maybe move to the toga-chart project, but I don't have access to do it myself.

@freakboy3742
Copy link
Member

@mhsmith Eventually, I swear we'll get the permissions right on all the repos :-)

I think I've corrected that problem; but since I'm here I'll transfer the this ticket.

@freakboy3742 freakboy3742 transferred this issue from beeware/briefcase Feb 26, 2023
@terminator-ger
Copy link
Author

I got my initial charts working with the approach described in (beeware/briefcase-android-gradle-template#52 (comment)). But it feels very unstable as upon adding a second plot my program segfaults and both examples given in the issue segfault as well.

@mhsmith
Copy link
Member

mhsmith commented Mar 5, 2023

OK, please create a separate issue for that in the Toga project, including the crash logs and the relevant sections of your code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android The issue relates to Android mobile support. bug A crash or error in behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants