Upcoming Android 15 requirement - 16KB page size

2,073 views
Skip to first unread message

Yurii Kyrylchuk

unread,
Jul 17, 2024, 4:49:56 AM7/17/24
to discuss-webrtc
Hello team! I have a question about upcoming Android 15 change, which adds a support for 16KB page memory size https://developer.android.com/guide/practices/page-sizes.
Is it already addressed in buildscripts, like described here https://developer.android.com/guide/practices/page-sizes#compile-16-kb-alignment
or we should address this on our own now?

Thanks!

Patrick Ouellet

unread,
Aug 21, 2024, 10:18:43 AM8/21/24
to discuss-webrtc
I am also interested in the answer to this question. If WebRTC already supports this, in which version does it and if not in which version will it start supporting it.
Glancing through the code, I do see some place where the PAGE_SIZE macro is used which could cause issues at runtime.

Thanks

tomwa...@gmail.com

unread,
Sep 2, 2024, 5:44:56 AM9/2/24
to discuss-webrtc
 During previous testing, i found that version M123 was functioning normally on Android 15 with 16kb page size.  
Patrick Ouellet 在 2024年8月21日 星期三晚上10:18:43 [UTC+8] 的信中寫道:

Muhammad Usman Bashir

unread,
Sep 2, 2024, 10:21:36 AM9/2/24
to discuss-webrtc

Hi Yurii and Patrick,

I've tested WebRTC versions from M112 to M125 on Android 15 with the new 16KB page size and haven't encountered any practical challenges or bugs. I've compiled WebRTC for Android from scratch for these versions, and everything appears to be functioning as expected. While the release notes don’t specifically address this change, the builds seem robust enough to handle it. 
 If your project is particularly sensitive to memory alignment, I recommend validating this by reviewing the PAGE_SIZE macro usage in your build scripts.   

Duc Trung Mai

unread,
Sep 16, 2024, 3:48:44 AM9/16/24
to discuss-webrtc
hi @Muhammad Usman Bashir

Do you have an example of setting up + running WebRTC on Android?

I can't find a simple,complete on Google, the example provided by webrtc source code can't be run 

Vào lúc 22:21:36 UTC+8 ngày Thứ Hai, 2 tháng 9, 2024, Muhammad Usman Bashir đã viết:

Muhammad Usman Bashir

unread,
Sep 16, 2024, 8:32:37 PM9/16/24
to discuss-webrtc
You can follow this repo for better understanding how things are working: WebRTC Android Example

Ray Hunter

unread,
Apr 22, 2025, 3:39:49 AMApr 22
to discuss-webrtc
What I found is that it is not fully supported as of yet. On M134 I have found the following:

ndk/29.0.13113456/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-objdump -p libwebrtc/jni/x86/libjingle_peerconnection_so.so | grep LOAD
    LOAD off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**12
    LOAD off    0x00b91990 vaddr 0x00b92990 paddr 0x00b92990 align 2**12
    LOAD off    0x00bb2450 vaddr 0x00bb4450 paddr 0x00bb4450 align 2**12

The load segments should be 2**14 or higher and they are not.

I am wondering in the build.py script if there is a way to set the PAGE_SIZE so that the library is linked properly.

I tried to add the following to the build.py file

# Adding the linker flags specifically for page size
gn_args_str += ' ldflags=["-Wl,-z,max-page-size=16384"]'

and update the BUILD.gn, but that does not work.

I would love to know if there is a way to fix this issue.


Thank you,
Ray



Ray Hunter

unread,
Apr 24, 2025, 2:34:17 AMApr 24
to discuss-webrtc
I have made the following change in the BUILD.gn file 

ldflags = ["-Wl,-z,max-page-size=16384"]

and this has worked for me and I have verified that the jni/x86_64/libjingle_peerconnection_so.so file now has the correct 16kb page size following the instructions at https://developer.android.com/guide/practices/page-sizes#alignment-use-tools step #3.

If you have questions, let me know.

Thanks,
Ray

kohe...@gmail.com

unread,
Apr 27, 2025, 6:35:37 PMApr 27
to discuss-webrtc
Ray,

Which BUILD.gn file did you make that change in?

Thanks,
Moshe

Ray Hunter

unread,
Apr 28, 2025, 1:22:35 PMApr 28
to discuss-webrtc
 I took the M134 version of webrtc and modified this file.


Top level one.

Sandeep

unread,
Jul 16, 2025, 8:31:49 AMJul 16
to discuss-webrtc
I took the M134 version and compiled it without any changes.

It has generated libjingle_peerconnection_so.so with correct alignment of ELF segments for 64-bit devices, checked with https://developer.android.com/guide/practices/page-sizes#alignment-use-tools

Sandeep

unread,
Jul 17, 2025, 2:38:58 AMJul 17
to discuss-webrtc
Ray,

Android 15 requirement for 16KB page size is for 64-bit arch only, and not for 32-bit arch. what you have tested above, libwebrtc/jni/x86/libjingle_peerconnection_so.so, is not 64-bit arch.

check with 64-bit arch files and see. the load segments will not have values less than 2**14.

Sandeep

unread,
Jul 17, 2025, 4:11:38 AMJul 17
to discuss-webrtc
WebRTC has supported 16KB page size since M121.

The following link is the commit with the fix.

https://chromium.googlesource.com/chromium/src/build/+/8918c32e85c10226c37806fde56f9d5c4dba11f3%5E%21

jayprakash kumar

unread,
Jul 22, 2025, 7:06:39 AMJul 22
to discuss...@googlegroups.com
Hi guys,

I am also facing same issue for android and building the latest M138,

Issue is that, after creating libwebrtc.aar and adding to my project getting crashed logs

java.lang.NoClassDefFoundError: Failed resolution of: Lorg/webrtc/Environment;
                                                                                                      at org.webrtc.PeerConnectionFactory$Builder.<init>(PeerConnectionFactory.java:169)
                                                                                                      at org.webrtc.PeerConnectionFactory$Builder.<init>(Unknown Source:0)
                                                                                                      at org.webrtc.PeerConnectionFactory.builder(PeerConnectionFactory.java:298)
                                                                                                      at enx_rtc_android.Controller.EnxRoom.initPeerFactory(EnxRoom.java:12461)
                                                                                                      at enx_rtc_android.Controller.EnxRoom.checkSubscription(EnxRoom.java:1473)
                                                                                                      at enx_rtc_android.Controller.EnxRoom.onConnected(EnxRoom.java:8062)
                                                                                                      at enx_rtc_android.Controller.EnxSignaling$35.call(EnxSignaling.java:377)
                                                                                                      at io.socket.emitter.Emitter.emit(Emitter.java:117)
                                                                                                      at io.socket.client.Socket.onevent(Socket.java:378)
                                                                                                      at io.socket.client.Socket.onpacket(Socket.java:322)
                                                                                                      at io.socket.client.Socket.access$100(Socket.java:19)
                                                                                                      at io.socket.client.Socket$2$2.call(Socket.java:92)
                                                                                                      at io.socket.emitter.Emitter.emit(Emitter.java:117)
                                                                                                      at io.socket.client.Manager.ondecoded(Manager.java:361)
                                                                                                      at io.socket.client.Manager.access$1200(Manager.java:22)
                                                                                                      at io.socket.client.Manager$5.call(Manager.java:355)
                                                                                                      at io.socket.parser.IOParser$Decoder.add(IOParser.java:103)
                                                                                                      at io.socket.client.Manager$2.call(Manager.java:331)
                                                                                                      at io.socket.emitter.Emitter.emit(Emitter.java:117)
                                                                                                      at io.socket.engineio.client.Socket.onPacket(Socket.java:556)
                                                                                                      at io.socket.engineio.client.Socket.access$1000(Socket.java:29)


it saying that Environment is not find , 

here is some more details i am 

after gclient sync 

calling 
./build/install-build-deps.sh

and then 

gclient runhooks


then 


gn args out/Debug


target_os = "android"
target_cpu = "arm64"
is_debug = false
rtc_include_tests = false
is_component_build = false
symbol_level = 1
is_java_debug = false
dcheck_always_on = true
use_errorprone_java_compiler = false
android_static_analysis = "off"
rtc_enable_android_environment = true


ninja -C out/Debug


and then final 


python3 tools_webrtc/android/build_aar.py   --arch arm64-v8a   --build-dir out/Debug   --output /home/svcvplatx/DoNotTouch_Jay/Out_Put/libwebrtc.aar

This will pack you .aar



Please help if there are any steps I am missing.





Best Regards,
Jay Kumar
Engineering Manager (Mobility)
Mobile Number - +91,7461857919
Skype id- jayprakash_gtl



--
This list falls under the WebRTC Code of Conduct - https://webrtc.org/support/code-of-conduct.
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/discuss-webrtc/287de281-9fe2-4696-9f01-0ef64337b9een%40googlegroups.com.

James Gustafson

unread,
Aug 25, 2025, 5:49:50 AMAug 25
to discuss-webrtc
I am also facing same issue for android and building the latest M138,
Issue is that, after creating libwebrtc.aar and adding to my project getting crashed logs
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/webrtc/Environment;

We solved this issue by adding ":environment_java" to the deps section of dist_jar("libwebrtc") in sdk/android/BUILD.gn.

James

Philipp Hancke

unread,
Aug 25, 2025, 7:48:23 AMAug 25
to discuss...@googlegroups.com
see https://issues.webrtc.org/issues/440301668, should be fixed soon (and is not related to the 16kb page size issue)

--
This list falls under the WebRTC Code of Conduct - https://webrtc.org/support/code-of-conduct.
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages