Skip to content

Correctly reference binaries on Windows#494

Open
kisabaka wants to merge 1 commit intobazelbuild:mainfrom
kisabaka:windows-support
Open

Correctly reference binaries on Windows#494
kisabaka wants to merge 1 commit intobazelbuild:mainfrom
kisabaka:windows-support

Conversation

@kisabaka
Copy link
Copy Markdown

@kisabaka kisabaka commented May 6, 2026

bazel build fails to find the right zipalign binary on Windows because the select in android_sdk is always falling back to the default branch. Apply the same fix that was applied to aapt2 in #235

Also reduce the initial JVM heap size as it causes a page size error on Windows (trying to allocate too much memory initially).

Comment thread rules/java.bzl
# Set reasonable max heap default. Required to prevent runaway memory usage.
# Can still be overridden by callers of this method.
jvm_flags = ["-Xms3G", "-Xmx3G", "-XX:+ExitOnOutOfMemoryError"] + jvm_flags
jvm_flags = ["-Xms512M", "-Xmx3G", "-XX:+ExitOnOutOfMemoryError"] + jvm_flags
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a select for this if it's a specific Windows limitation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, are you sure this is a problem for all Windows Android Java actions? We do have Windows Android builds running in BazelCI and I haven't seen any memory-related errors yet. Are you sure this isn't something wrong with your specific dev environment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants