question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The type or namespace name 'Xcode' does not exist in the namespace 'UnityEditor.iOS'

See original GitHub issue

I 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:closed
  • Created 7 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
heshuimucommented, May 2, 2016

So, to elaborate, the code looks like this in the file:

#if UNITY_5 && (UNITY_IOS || UNITY_TVOS)
using UnityEditor.iOS.Xcode;
#endif

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):

The type or namespace name ‘PBXProject’ could not be found (are you missing a using directive or an assembly reference?) [Assembly-CSharp-Editor]

#if UNITY_IOS
#if UNITY_5
...
PBXProject project = new PBXProject();
...
#endif
#endif

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

0reactions
reapazorcommented, May 4, 2016

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found