UE5.7.1 Packaging Android JNI Error: ld.lld: error: undefined symbol: UE::Jni::FEnv::FEnv()

I’m trying to package an android build on UE5.7.1 but I’m running into the error: ld.lld: error: undefined symbol: UE::Jni::FEnv::FEnv() along with several other Java-related errors.

Here’s what I tried:

Is there anything else that I can try?

I managed to fix this by adding the following in (Game)Editor.Target.cs:

GlobalDefinitions.Add(“USE_ANDROID_JNI=1”);
bOverrideBuildEnvironment = true;

I am not sure if there is a more suitable workaround than this, but that’s what worked for me.