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

Hi,

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.

Same exact thing happens to me. There's an [issue open][1] about this. I've added my vote to it. I would downgrade back to 5.4, but it seems that it can't be done. 5.5 is the first version that uses new serialization and downgrading is impossible. Have someone submitted a bug report? I can't submit out project, and this issue doesn't seem to affect new projects. [1]: https://issuetracker.unity3d.com/issues/ios-xcode-fails-to-build-for-ios-with-errors-use-of-undeclared-identifier-unity-ui-textrendering

7 Answers

7

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.

I disabled the stripping and it worked!

Has anyone figured this out?

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

RegisterClass<Unity::Component>();

@eliastds91 Did you fix this one?

No, not yet, I was about to try to compile a blank project to see what happens but even if it works it wouldn't help me with the one I need it to work. Please let me know if you find anything about it.

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

You just need to disable stripping in Unity and it'll fix the errors. But it's a "not so good" solution.

@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.

@PopovVadim
Thanks, its resolved.

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