Sorry about that. Clearly deciding to write git myself instead of fixing the problems with all cross-compilation was a terrible idea.
I've now reverted back to libgit2, since I don't need to access it via Dart -> Flutter Message -> Android -> NDK -> custom C wrapper -> libgit2.