iOS build error: use of undeclared identifier 'Unity' and 'UI'


When building for iOS, I go to xcode and try to run it on the iPad but it throws the following errors:

The strange thing is that it works fine with the simulator SDK and it even tried to work the first time I tried running it on the iPad but didn’t have the password for the iCloud account associated with it.

I tried everything, deleted the iOS build, reverted the whole unity project, changing settings back and nothing worked.

I even tried removing and adding imports in the pch file like I’ve read in another post but it seems it is not the same issue.

I experience the same issue. Here are the steps which led me to it (maybe that would produce some ideas):

  • I had a project made with Unity 5.4.1;
  • Then I decided to try a new version 5.5.1;
  • In Unity Editor everything works great, Android builds are ok;
  • If I set mono2x in iOS Player settings with any kind of stripping, it gives me these errors in xcode.

Disabling stripping or using IL2CPP solves it, but that is not an option for me due to the build size

The issue occurs on 5.5.* versions. 5.4.* is okay.

Has anyone figured this out?

I am having the same problem, but only on this line:


@eliastds91 Did you fix this one?

Same error but with the cloud build. Would love to know what to do to get this fixed.

@macropp I couldn´t resolve it and the project priority is low. When I take over the project again, I will publish the progress I have made.

Thanks, its resolved.

@NaumanH how did you solve this ? we have the same problem.