This is the AMP version of this page.
If you want to load the real page instead, click this text.

Help! Frida --> Failed to attach: the connection is closed

I need to attach to the game process using Frida on the MemuPlayer emulator running Android 9 x64.
When I use the --realm=emulated flag, I immediately get Failed to attach: the connection is closed, even if my .js file only contains console.log("hello").
My main goal is to locate the module Process.findModuleByName("libil2cpp.so").
Without --realm=emulated, Frida can't detect this module.
I found a forum solution that suggested using the emulator with Android 7 x64, but my game crashes on Android 7 at launch, so I’m forced to use Android 9.
Could you please help me?