# Compiling Erlang for Android 16KB

**URL:** <https://erlangforums.com/t/compiling-erlang-for-android-16kb/4791>\
**Category:** Questions / Help\
**Tags:** community, erlang\
**Created:** [May 28, 2025, 9:55am UTC](https://erlangforums.com/t/compiling-erlang-for-android-16kb/4791 "2025-05-28T09:55:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![michi](https://erlangforums.com/letter_avatar_proxy/v4/letter/m/c37758/32.png) [@michi](https://erlangforums.com/u/michi)\
**Post date:** [May 28, 2025, 9:55am UTC](https://erlangforums.com/t/compiling-erlang-for-android-16kb/4791/1 "2025-05-28T09:55:04Z")

</div>

Hello together,

does anybody compiled Erlang OTP 26 or higher for Android which is compatible for the new page size 16KB - like mentioned in [Support 16&nbsp;KB page sizes &nbsp;|&nbsp; Compatibility &nbsp;|&nbsp; Android Developers](https://developer.android.com/guide/practices/page-sizes)  
and any hints on that to compile it?

---

<div class="post-metadata">

**Author:** ![mikpe](https://erlangforums.com/letter_avatar_proxy/v4/letter/m/b487fb/32.png) [@mikpe](https://erlangforums.com/u/mikpe)\
**Post date:** [May 28, 2025, 12:02pm UTC](https://erlangforums.com/t/compiling-erlang-for-android-16kb/4791/2 "2025-05-28T12:02:03Z")

</div>

I don’t know if Android changes this (hacked up kernel and different libc), but all recent OTP versions (at least from 23 up to 27) build and work out of the box on my M1 running Fedora 41, and that one has a 16KB page size.

---

<div class="post-metadata">

**Author:** ![michi](https://erlangforums.com/letter_avatar_proxy/v4/letter/m/c37758/32.png) [@michi](https://erlangforums.com/u/michi)\
**Post date:** [May 28, 2025, 12:38pm UTC](https://erlangforums.com/t/compiling-erlang-for-android-16kb/4791/3 "2025-05-28T12:38:47Z")

</div>

Okay thanks. I got it compiled on my Ubuntu System, but I added some LDFLAGS to the compiler.

export LDFLAGS=“-Wl,-z,max-page-size=16384”

this is also mentioned in the Android Developer - NDK 27 .

After that the ELF check says its aligned to be 16 kb page size compatible.

---

<div class="post-metadata">

**Author:** ![michi](https://erlangforums.com/letter_avatar_proxy/v4/letter/m/c37758/32.png) [@michi](https://erlangforums.com/u/michi)\
**Post date:** [May 28, 2025, 3:28pm UTC](https://erlangforums.com/t/compiling-erlang-for-android-16kb/4791/4 "2025-05-28T15:28:28Z")

</div>

only e.g crypto.so is aligned for 16 kb page size but not for the files beam.smp for erlang. Any hints?

---

<div class="post-metadata">

**Author:** ![JeromeDeBretagne](https://erlangforums.com/user_avatar/erlangforums.com/jeromedebretagne/32/2100_2.png) [@JeromeDeBretagne](https://erlangforums.com/u/JeromeDeBretagne)\
**Post date:** [February 16, 2026, 10:12pm UTC](https://erlangforums.com/t/compiling-erlang-for-android-16kb/4791/5 "2026-02-16T22:12:12Z")

</div>

Hello michi,

I’m quite late to answer your question but it may still be useful for other people looking to support recent Android requirements.

I’ve updated my project providing pre-built releases of Erlang/OTP, using version 28.3.1, and it seems compatible with the recent 16KB page size support. Here is the link to the project:

> **[GitHub - JeromeDeBretagne/erlang-otp-releases-for-android](https://github.com/JeromeDeBretagne/erlang-otp-releases-for-android)**
>
> Contribute to JeromeDeBretagne/erlang-otp-releases-for-android development by creating an account on GitHub.

The build instructions are described, I didn’t have to pass or edit specific compiler flags, I’ve simply used a quite recent version of the Android NDK toolchain, r29 in this case.

I’ve tested and updated this sample project integrating Erlang/OTP within an Android application:

> **[GitHub - JeromeDeBretagne/erlanglauncher: Example of Android/Erlang communication with...](https://github.com/JeromeDeBretagne/erlanglauncher)**
>
> Example of Android/Erlang communication with Jinterface; fork from knewter's code

and it is working fine with the 16KB variant of the Android emulator images.

Let me know if you have any questions!

Cheers,  
Jérôme
