V8 sandbox Android

14 views
Skip to first unread message

Mati Cohen

unread,
Sep 22, 2025, 12:37:53 PM (10 days ago) Sep 22
to v8-users
Hey, I managed to get my builds.

Now, when I run the app on Android it crashes here when trying to initialize v8:

const bool kEmbedderSandbox = (build_config & kSandbox) != 0;
if (kEmbedderSandbox != V8_ENABLE_SANDBOX_BOOL) {
FATAL(
"Embedder-vs-V8 build configuration mismatch. On embedder side "
"sandbox is %s while on V8 side it's %s.",
kEmbedderSandbox ? "ENABLED" : "DISABLED",
V8_ENABLE_SANDBOX_BOOL ? "ENABLED" : "DISABLED");
}

As far as I could see v8_enable_sandbox is true by default (and I am not overwriting it). Is there any reason why these vars don't match? I can't see their values on the debugger.

I am using the default default_min_sdk_version (v21), so maybe sandbox was not supported yet on that version?

I guess another option is to set v8_enable_sandbox=false, but I'd like to take advantage of sandbox if that's an option.

Thanks!

Ben Noordhuis

unread,
Sep 22, 2025, 3:58:43 PM (10 days ago) Sep 22
to v8-u...@googlegroups.com
You have to compile your own code (that is, your code that links
against V8) with the same flags as V8 itself was built with.

For example, if V8 was built with V8_ENABLE_SANDBOX and
V8_COMPRESS_POINTERS (v8_enable_sandbox=true and
v8_enable_pointer_compression=true), then your own code must be
compiled with `c++ -DV8_ENABLE_SANDBOX -DV8_COMPRESS_POINTERS`.

Mati Cohen

unread,
Sep 29, 2025, 5:13:45 PM (3 days ago) Sep 29
to v8-users
Thanks a lot for all your help. I managed to get everything working.
Reply all
Reply to author
Forward
0 new messages