Automated android builds on headless server: "error: No available video device"

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Lent1
Newbie
Posts: 1
Joined: Wed Mar 13, 2019 5:43 pm
Contact:

Automated android builds on headless server: "error: No available video device"

#1 Post by Lent1 »

Hi,
I'm trying to set a continuous delivery pipeline for a renpy game.
I'm using gitlab and gitlab-runner (docker) on an ubuntu 18.04 server.
The pipeline is pretty straight forward: tag version, build in docker, push on server, publish with apache.

Every time i launch the pipeline, i've got the following error.

Code: Select all

$ cd /renpy && ./renpy.sh launcher android_build ${CI_PROJECT_DIR} assembleRelease
Scanning project files...
Scanning Ren'Py files...

Writing the android directory package. - 1 of 1198
Writing the android directory package. - 2 of 1198
...
Writing the android directory package. - 1197 of 1198
Writing the android directory package. - 1198 of 1198

Updating project.


Creating assets directory.


Packaging internal data.


Full traceback:
  File "/renpy/renpy/bootstrap.py", line 313, in bootstrap
    renpy.main.main()
  File "/renpy/renpy/main.py", line 520, in main
    run(restart)
  File "/renpy/renpy/main.py", line 102, in run
    if not renpy.arguments.post_init():
  File "/renpy/renpy/arguments.py", line 287, in post_init
    return commands[command]()
  File "game/android.rpy", line 524, in android_build_command
    android_build(args.gradle_commands, p=p, gui=False, launch=args.launch, destination=args.destination)
  File "game/android.rpy", line 269, in android_build
    rapt.build.build(rapt_interface, dist, command, launch=launch, finished=finished)
  File "/renpy/rapt/buildlib/rapt/build.py", line 565, in build
    iconmaker.IconMaker(directory, config)
  File "/renpy/rapt/buildlib/rapt/iconmaker.py", line 14, in __init__
    pygame_sdl2.display.init()
  File "src/pygame_sdl2/display.pyx", line 96, in pygame_sdl2.display.init
error: No available video device

After initialization, but before game start.
  File "game/android.rpy", line 524, in android_build_command
    android_build(args.gradle_commands, p=p, gui=False, launch=args.launch, destination=args.destination)
  File "game/android.rpy", line 269, in android_build
    rapt.build.build(rapt_interface, dist, command, launch=launch, finished=finished)
error: No available video device

ERROR: Job failed: exit code 1
I tried many things.
I'm using https://github.com/coodeneko/RenpyInDocker image as base docker image.
Then dl/install jdk8, rapt, android sdk and android tools (the last two part were largely inspired by thyrlian/android-sdk work).

I removed
SDL_VIDEODRIVER="dummy"
from RenpyInDocker image and tried different settings from pygame documentation.
I ended up installing xserver on the docker host server and mounting /tmp/.X11 volume on an lxde docker image.

But still

Code: Select all

error: No available video device
I installed pygame almost every time (as i understand, pygame and pygame_sdl2 works the same during init) and check init, and guess what...:

Code: Select all

In [1]: import pygame
pygame 1.9.4
Hello from the pygame community. https://www.pygame.org/contribute.html

In [2]: pygame.init()
Out[2]: (5, 1)

In [3]: pygame.display.get_driver()
---------------------------------------------------------------------------
error                                     Traceback (most recent call last)
<ipython-input-3-280ad9cbc10f> in <module>()
----> 1 pygame.display.get_driver()

error: video system not initialized
I'm stuck and have no more idea.
Maybe someone does.

Thanks for any clue, lead, hint, something...

Lent1

Post Reply

Who is online

Users browsing this forum: Google [Bot]