Error when trying to build realm-js from source

Hi,
I have followed the instructions here on building Realm from source: https://github.com/realm/realm-js
But when I run ./gradlew publishAndroid to create the build, it fails with a quite unhelpful message, and therefore I have no idea how to fix it.

Here’s the log: https://pastebin.com/XVCJiK4K
There’s an error line 214 saying cannot open crtbegin_so.o: No such file or directory, but I don’t know what to make of it.

Thanks in advance.