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 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.
Answer by PopovVadim · Feb 01, 2017 at 07:20 AM
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.
Answer by macropp · Dec 21, 2016 at 10:36 AM
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.
Answer by murteas · Dec 27, 2016 at 10:18 PM
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.
Because stripping optimizes ios builds in terms of space.
Answer by eliastds91 · Feb 03, 2017 at 06:27 PM
@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.
Your answer
Follow this Question
Related Questions
Unity iOS - Wont compile in Xcode 2 Answers
Xcode stuck / hangs when compiling source files for Unity project 5 Answers
Can't build with simulator SDK selected! 2 Answers
Xcode 7.0 build error 1 Answer