Skip to content

Build / Render / OpenGL issues when building Android version (Fork environment) #297

Description

@skulltombstone-hub

Hi!

First of all, thanks for the work on Butterscotch. I’m currently experimenting with the project in a fork to explore compatibility with additional engines and different build configurations (notably Android standalone builds and CI-based builds via GitHub Actions).

This issue is not meant to change the direction of the project, but to document build/rendering problems I encountered in my environment so they can be useful for debugging or future compatibility improvements.

Environment used

Local build (Android Studio):

Android Studio: Panda 2 / Quail (tested on both)

JDK: 17 (Android Studio bundled)

Gradle: Wrapper version from project (./gradlew)

Device target: Physical Android 13 device

I also used GitHub actions with a workflow that I made

Fork setup:

Repository is a fork of Butterscotch with minimal visual modifications and support to games made in other engines planned to be added in the future.

No submodule modifications intended (Butterscotch source kept as-is)

Issues observed

  1. OpenGL / Rendering initialization failures

On Android startup, rendering sometimes fails with GL-related errors or blank screen state.

Observed symptoms:

Black screen after launch (no crash)

GL context not properly initialized on some devices

Occasional logcat errors related to EGL / GL surface creation

Example log pattern (varies by device):

EGL_emulation / EGL_BAD_ALLOC
eglCreateContext failed
Renderer initialization skipped or incomplete

Impact:

App launches but does not render UI/game scene correctly

Sometimes only splash or initial activity is visible

  1. Inconsistent rendering behavior between desktop and Android

Desktop build works normally (no GL issues observed)

Android build shows partial or missing rendering

Some Compose / rendering layers appear not to be drawn consistently

  1. Build fails most of the time but when it works runtime fails silently

If the build fails:
Most of the log is related to "glGenFramebuffersEXT"

If the build don't fail:
Runtime rendering issues only appear after launch

No hard crash logs in most cases (only EGL warnings)

  1. GitHub Actions build environment differences

CI build is reproducible but slightly inconsistent with local behavior:

Gradle build completes successfully on ubuntu-latest

APK generated without errors

Runtime issue persists in emulator/device, same as local builds

Noted differences:

No hardware acceleration in CI environment

Potential differences in EGL/OpenGL backend

Possible missing native GL bindings or device-specific rendering fallback

What was tested

Clean rebuild (./gradlew clean assembleDebug)

Different Gradle caches disabled

Physical device (Android 13)

Debug and release variants

Fresh project sync in Android Studio

Hypothesis (not confirmed)

Based on logs and behavior, possible causes might include:

EGL context creation not fully compatible with some Android environments

Missing or incomplete OpenGL ES initialization path

Engine initialization order differing on Android lifecycle

Possible issue in renderer setup timing (surface created vs engine init)

Device/emulator GPU differences affecting GL fallback path

Purpose of this report

Since this fork is also being used experimentally to explore:

Android compatibility improvements

Alternative engine integration

CI-based APK builds

I’m documenting these issues in case they are useful for:

Identifying Android rendering edge cases

Improving GL initialization robustness

Supporting broader device compatibility

If needed, I can also provide:

Some logs

GitHub Actions workflow file used

Exact device

The only APK I could build successfully

Thanks again for the project and the work and care put on it!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions