The type or namespace name 'Xcode' does not exist in the namespace 'UnityEditor.iOS'
See original GitHub issueI was using a plugin in my project which has a build post processor.
When VSCode loaded the project, it showed an error on the line
using UnityEditor.iOS.Xcode;
saying:
The type or namespace name ‘Xcode’ does not exist in the namespace ‘UnityEditor.iOS’ (are you missing an assembly reference?) [Assembly-CSharp-Editor]
However, in Unity, build was successful. Is there any way to let VSCode recognize this namespace?
I was using Unity 5.4.0b15 on El Capitan with latest VSCode and VSCode plugin.
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
error CS0234: The type or namespace name `iOS' does not ...
If you're facing with this problem there are 2 steps to solve it: ... UnityEditor.iOS.Xcode namespace cannot be used in your main project....
Read more >Missing Xcode namespace in UnityEditor.iOS
Error CS0234 : The type or namespace name `Xcode' does not exist in the namespace `UnityEditor.iOS'. Are you missing an assembly reference?
Read more >[iOS] UnityEditor.iOS.Xcode is not referenced in Monodevelop
Results: Error CS0234: The type or namespace name `Xcode' does not exist in the namespace `UnityEditor.iOS'. Reproduced with: 5.4.0b24, ...
Read more >Errors importing Apple.Core package on Windows machine
Hi,. When I try to import the com.apple.unityplugin.core-1.0.3.tgz package into Unity from my Windows development machine I get lots of errors like :....
Read more >error CS0234: The type or namespace name `iOS' does not ...
Place your script in Assets -> Editor folder. UnityEditor.iOS.Xcode namespace cannot be used in your main project. It works only in special Assembly-CSharp- ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
So, to elaborate, the code looks like this in the file:
The building target was set as iOS so this precompile conditions included this. If the build target is set as Android this error disappears.
Actually there is a PBXProject class in the code that seems to rely on that namespace (since VSCode thinks that the namespace does not exists so does the PBXProject class):
Actually I did a google search and I found this class description located in the online scripting reference. Looks like the Xcode.iOS namespace is also shown there:
http://docs.unity3d.com/540/Documentation/ScriptReference/iOS.Xcode.PBXProject.html
…and this class exists since 5.0
http://docs.unity3d.com/500/Documentation/ScriptReference/iOS.Xcode.PBXProject.html
793624
I would paste the actual link, but the whole back history is visible for my account with them at that point and sadly, thats not something I wish to share 😃 its been quite a few years LOL