Packaging fail for Android (but succeed for iOS)

Hi - this is possibly an advanced programming/packaging question…

I’m on UE4 version 4.21 compiled from source and have a fully functional app on the Apple app store in production for quite some time. No issues there. I was hoping to launch the app on Android to have access to more users and make the game more profitable, but am stuck on an issue I don’t know how to solve. While the app compiles like a charm on iOS, it fails on Android with the attached message.

My devstack for iOS is simply UE4 running on a PC with VS2017 and compiling remotely on a Mac using XCode (latest version - not a Mac expert so don’t really care). For Android it is the same, minus the Mac stuff, plus all Android CodeWorks stuff (installed from the engine extras folder, recommended version, all standard stuff).

The app is quite straight forward, blueprint only, nothing fancy. The error message is on ClangPlatformAtomics.h (engine asset - absolutely no idea what it does) and the specific function causing the error is:

static FORCEINLINE int64 AtomicRead(volatile const int64* Src)
	{
		int64 Result;
		__atomic_load((volatile int64*)Src, &Result, __ATOMIC_SEQ_CST);
		return Result;
	}

The bit “__atomic_load” is undefined. No idea - the engine compiles no problem but this bit is somehow used during packaging and breaks there because it’s undefined. Doesn’t break on iOS, just on Android.

Has anyone got any idea of what might be going on here?

Thanks in advance.

Update here - I tried several things:

  • Repointing the project settings to the SDK and NDK installation for AndroidWorks
  • Installing AndroidWorks again this time using full installation rather than standard
  • Disabling Arm64 to see if that was causing the issue (based on the error messages)
  • Trying with Unreal Engine running as administrator
  • Lighting a virtual candle to all developers that like me are struggling to compile for the Android platform (here)

Unfortunately all to no avail. I get exactly the same error each and every time. Has anyone got any idea of what is the issue here?

Problem solved. Here is how I did it:

  • Disable x86 support for Android in the defautengine.ini (line should read “bBuildForX86=False”)
  • Download Android Studio, make sure all installations are up to date and accept the licences

This solved my problem. The candle probably helped.