Error cs0234 unity

I have installed the latest versions of Unity (2017.3.1), Daydream SDKs (GVR SDK for Unity v1.130.0) and followed the steps here: https://developers.google.com/vr/develop/unity/get-started#

I have installed the latest versions of Unity (2017.3.1), Daydream SDKs (GVR SDK for Unity v1.130.0) and followed the steps here: https://developers.google.com/vr/develop/unity/get-started#configure_build_settings_and_player_settings

However when I press Play I get the following error, ideas on what is the reason & how to fix it?

Assets/GoogleVR/Editor/GvrBuildProcessor.cs(20,19): error CS0234: The type or namespace name ‘iOS’ does not exist in the namespace ‘UnityEditor’. Are you missing an assembly reference?

Edit: Issue fixed after a few hours of submission on GitHub with the release of GVR SDK for Unity v1.130.1

asked Mar 16, 2018 at 23:29

Reha's user avatar

RehaReha

911 gold badge1 silver badge7 bronze badges

5

If you’re facing with this problem there are 2 steps to solve it:

  1. Make sure that «iOS Build Support» is checked in Unity Hub -> Installs as Adam mentioned (if U’re developing for iOS platform then this option most definitely is already checked).
  2. 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-Editor project intended to modify native Xcode project. (That’s the option that worked for me after searching a ton of forums).

answered Apr 4, 2020 at 10:55

Shpand's user avatar

ShpandShpand

6219 silver badges14 bronze badges

2

I went ahead and changed the «Current Platform» to «iOS» in Unity Hub, This is a quick fix and it works now.

Change «Current Platform» to iOS Image:
Change "Current Platform" to iOS Image

Nimantha's user avatar

Nimantha

6,6746 gold badges27 silver badges66 bronze badges

answered Sep 12, 2019 at 17:02

Jonathan Caraveo's user avatar

If you have installed IOS build through unity hub while the project is open, try restarting Unity Hub and Unity Editor. This solved my issue.

iminiki's user avatar

iminiki

2,41112 gold badges34 silver badges44 bronze badges

answered Jan 10, 2022 at 10:06

Muhammad Shahzaib's user avatar

I met this issue When useing unity-arkit-plugin to develop something, i did nothing but import this plugin it throw this error .
And after i installed UnitySetup-IOS-Support-for-Editor-2017.3.0f3.pkg ,the issue fixed.

answered Apr 1, 2018 at 1:31

Jack LI's user avatar

This usually happens when iOS Build Support is not installed in Unity Hub

answered Dec 16, 2022 at 16:23

Mihai Galan's user avatar

Mihai GalanMihai Galan

3384 silver badges12 bronze badges

I’m trying to make a simple button perform an action when pressed. Initially I was using vscode, but as I couldn’t solve the problem, I switched to visual studio 2017. For some reason the error persists.

The button has been removed from this link:

https://www.c-sharpcorner.com/article/unity-change-scene-on-button-click-using-c-sharp-scripts-in-unity/

Button code (internet sketch):

using System.Collections;  
using System.Collections.Generic;  
using UnityEngine;  
using UnityEngine.SceneManagement;

public class SceneChanger: MonoBehaviour {  
    public void Scene1() {  
        SceneManager.LoadScene("Scene1");  
    }  
    public void Scene2() {  
        SceneManager.LoadScene("Scene2");  
    }  
    public void Scene3() {  
        SceneManager.LoadScene("Scene3");  
    }  
}

Button code (my code):

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using System.Windows.Forms;

public class botaoJogar : MonoBehaviour
{
    public Button btn_Jogar;

    void Start()
    {
        Button btn = btn_Jogar.GetComponent<Button>();
        btn.onClick.AddListener(TaskOnClick);
    }

    void TaskOnClick()
    {
        Debug.Log("You have clicked the button!");
    }
}

Image of the construction in unity:

enter image description here

Before, I was able to solve the CS0236 error using the answers from this link:

https://stackoverflow.com/questions/2883505/the-type-or-namespace-name-button-could-not-be-found-are-you-missing-a-using

The answer says to add the line using System.Windows.Forms; to the button code, but for some reason, now in visual studio, this error doesn’t go away.

Errors:

Assetsbotajogar.cs(4,22): error CS0234: The type or namespace name
‘Forms’ does not exist in the namespace ‘System.Windows’ (are you
missing an assembly reference?)

Assetsbotajogar.cs(8,12): error CS0246: The type or namespace name
‘Button’ could not be found (are you missing a using directive or an
assembly reference?)

Some community links, which I accessed:

https://stackoverflow.com/questions/42000798/how-do-i-add-assembly-references-in-visual-studio-code

https://stackoverflow.com/questions/49805204/adding-reference-to-another-project-from-visual-studio-code

https://stackoverflow.com/questions/2883505/the-type-or-namespace-name-button-could-not-be-found-are-you-missing-a-using

https://stackoverflow.com/questions/47412796/system-windows-forms-assembly-reference-in-vs-code

https://stackoverflow.com/questions/46582847/creating-a-windows-forms-application-in-c-sharp-using-dotnet-new

https://stackoverflow.com/questions/40562192/windows-form-application-on-visual-studio-code

https://stackoverflow.com/questions/48496542/forms-does-not-exist-in-the-namespace-system-windows

Other links:

https://docs.microsoft.com/en-us/visualstudio/ide/how-to-add-or-remove-references-by-using-the-reference-manager?view=vs-2019

https://docs.microsoft.com/pt-br/dotnet/csharp/language-reference/compiler-messages/cs0246

I don’t know what to do anymore, I feel like I tried to do everything I could, but windows forms simply don’t work. Visual studio 2017 has no bugs, just unity.

Installation I did in visual studio 2017:

enter image description here

enter image description here

Ошибка при билде проекта. UnityEngine.UI

Невозможно билдить проект. Так-как не видит библиотеку

не смотря на то что она есть. И консоль говорит что такая ошибка во всех скриптах, где используется эта библиотека:
error CS0234: The type or namespace name `UI’ does not exist in the namespace `UnityEngine’. Are you missing an assembly reference?
Всё перепробовал. Даже двиг переустанавливал. Мне кажется дело в самом проекте.
Что делать то?
Может в папке проекта что-то ковырять?
Возраст проекта около года (возможно «износился»).

mahovik321
UNец
 
Сообщения: 41
Зарегистрирован: 20 дек 2014, 17:50

Re: Ошибка при билде проекта. UnityEngine.UI

Сообщение samana 28 фев 2016, 20:48

А если всё перенести в новый проект?

Аватара пользователя
samana
Адепт
 
Сообщения: 4733
Зарегистрирован: 21 фев 2015, 13:00
Откуда: Днепропетровск

Re: Ошибка при билде проекта. UnityEngine.UI

Сообщение getAlex 02 мар 2016, 11:29

Версия юнити должна быть 4.6 и выше

getAlex
Адепт
 
Сообщения: 1775
Зарегистрирован: 10 авг 2013, 18:30

Re: Ошибка при билде проекта. UnityEngine.UI

Сообщение mahovik321 03 мар 2016, 16:08

getAlex писал(а):Версия юнити должна быть 4.6 и выше

У меня последняя версия

mahovik321
UNец
 
Сообщения: 41
Зарегистрирован: 20 дек 2014, 17:50

Re: Ошибка при билде проекта. UnityEngine.UI

Сообщение jetyb 04 мар 2016, 16:00

error CS0234: The type or namespace name `UI’ does not exist in the namespace `UnityEngine’. Are you missing an assembly reference?

Пишет же: проверь все ссылки на сборки в свойствах проекта.

jetyb
Адепт
 
Сообщения: 1481
Зарегистрирован: 31 окт 2011, 17:21

Re: Ошибка при билде проекта. UnityEngine.UI

Сообщение seaman 04 мар 2016, 17:42

> не смотря на то что она есть
Где? Должна быть в «Путь_до_проектаLibraryUnityAssemblies»
Возможно ненормально проапгрейдился? Попробуйте добавить туда вручную что ли.
> Пишет же: проверь все ссылки на сборки в свойствах проекта.
А Вы что их вручную добавляете?

seaman
Адепт
 
Сообщения: 8351
Зарегистрирован: 24 янв 2011, 12:32
Откуда: Самара

Re: Ошибка при билде проекта. UnityEngine.UI

Сообщение getAlex 04 мар 2016, 17:58

Можно в моно добавить референсы

getAlex
Адепт
 
Сообщения: 1775
Зарегистрирован: 10 авг 2013, 18:30


Вернуться в Общие вопросы

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 12



Понравилась статья? Поделить с друзьями:
  • Error cs0176 member
  • Error cs0170 use of possibly unassigned field
  • Error cs0165 use of unassigned local variable
  • Error cs0161 not all code paths return a value
  • Error cs0150 a constant value is expected