Appstore error: "your app is using the advertising identifier (IDFA)"

Hey folks! If you’re using source distribution of the engine from github, here’s a quick fix that worked for me (on UE4.17):

  1. Locate the file Engine/Source/Runtime/Core/Private/IOS/IOSPlatformMisc.cpp
  2. In this file comment out (or #if#endif, or delete) the following code:

(lines 39-41)

#if !PLATFORM_TVOS
#include <AdSupport/ASIdentifierManager.h> 
#endif

and

(lines 791-799)

#if !PLATFORM_TVOS
	// Check to see if this OS has this function
	if ([[ASIdentifierManager sharedManager] respondsToSelector:@selector(advertisingIdentifier)])
	{
		NSString* IdfaString = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
		FString IDFA(IdfaString);
		return IDFA;
	}
#endif

3 . Rebuild the engine, repackage your project, reupload. For me iTunes Connect stopped complaining about IDFA after these steps.

The code above references the ASIdentifierManager API and it looks like iTunes Connect somehow detects the API reference in the binary even if you are not using any related functionality in your project.