Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

Bug Can't use Editor Coroutines in custom pacakge

Discussion in 'Editor & General Support' started by NamelessPerson, May 2, 2020.

  1. NamelessPerson

    NamelessPerson

    Joined:
    Apr 17, 2017
    Posts:
    26
    Editor Coroutines package is installed and listed as a dependency but when trying to use it inside a custome package I get the followinf compilation error.

    error CS0234: The type or namespace name 'EditorCoroutines' does not exist in the namespace 'Unity' (are you missing an assembly reference?)

    The error does not occur with editor scripts inside the Assets/Editor folder
     
    paternostrox likes this.
  2. NamelessPerson

    NamelessPerson

    Joined:
    Apr 17, 2017
    Posts:
    26
    Ignore this. Just had to add the EditorCoroutines to the .asmdef
     
  3. L0tan

    L0tan

    Joined:
    Jul 16, 2017
    Posts:
    75
    Please can you explain it a little bit? I'm facing the same problem, you have to add a .asmdef file to your Assets folder? Details please, noob with .asmdef files here! ^^'
     
    paternostrox and TheFastLane like this.
  4. oleg_v

    oleg_v

    Joined:
    Nov 10, 2017
    Posts:
    67
    Hi! I got the same problem - can't reference EditorCoroutines in unitypackage. After import my package to side project i got "error CS0234: The type or namespace name 'EditorCoroutines' does not exist in the namespace 'Unity' (are you missing an assembly reference?)".

    What i have:
    1. asmdef for my scripts (with linked reference to EditorCoroutines)
    2. asmref in root of package to EditorCoroutines
    3. package.json with "dependencies" pointed to EditorCoroutines

    Seems Unity don't want to resolve external references in this way. Are there any other way to reference?
     
  5. Leon-Reis

    Leon-Reis

    Joined:
    Sep 1, 2014
    Posts:
    8
    What you need to do is : Go to the Packaged Manager , and put as advanced Preview , and download the EditorCoroutines . I did this and fixed the problem.

    I hope you understand ,and hekped you .
     
    DhiaSendi and Max_Aigner like this.
  6. oleg_v

    oleg_v

    Joined:
    Nov 10, 2017
    Posts:
    67
    Yes, but i need to do it in target project where i import unitypackage. So it's not a good solution if considering unitypackage as all-in-one package. Or am i missed something?
     
  7. W_A_LL

    W_A_LL

    Joined:
    Feb 12, 2015
    Posts:
    2
    Installing Memory Profiler package solved the problem for me ( If you install the Memory Profiler package it will automatically install the Editor Coroutines package as a dependency.)
     
  8. WhendricSo

    WhendricSo

    Joined:
    Jan 1, 2011
    Posts:
    171
    Broken in Unity 2020.3.20f1 Editor Coroutines v 1.0.0 causes this error to be reported by Visual Studio.
     
    paternostrox likes this.
  9. paternostrox

    paternostrox

    Joined:
    Oct 31, 2015
    Posts:
    42
    Still an issue in 2020.3.22f1. Importing Editor Coroutines package or Memory Profiler package like @W_A_LL suggested didn't work. I feel this package shouldn't have left preview.

    EDIT:
    Checked for the Editor Coroutines .asmdef file and it is present in the PackageCache folder. Still looking for a solution.

    EDIT2:
    While pointing an error, the assemblies are somehow recognized and members of Unity.EditorCoroutines.Editor actually work. Getting an error still isn't good though, hope this gets fixed soon.

    EDIT3:
    A "Reimport All" in the project explorer fixed the issue for me.
     
    Last edited: Jan 6, 2022
    TH3_TWIN likes this.
  10. batuhank1997

    batuhank1997

    Joined:
    Jun 29, 2019
    Posts:
    1
    this solved the problem for me. For begginners just Go to the packages folder>Editor Coroutines>Unity.EditorCoroutines.Editor.asmdef

    and
    "includePlatforms": [
    "Editor",
    "EditorCoroutines" //add this line
    ],

    thats it
     
    joshua_salcido likes this.
  11. TH3_TWIN

    TH3_TWIN

    Joined:
    Nov 17, 2015
    Posts:
    1
    Still an issue in 2021.2.7f1.
    I was having the same issues as @paternostrox and tried fixes suggested.
    Editing the asmdef didn't work.

    Closing the project and reopening fixed the issue.
     
    Arlorean likes this.
  12. MichaelEGA

    MichaelEGA

    Joined:
    Oct 11, 2019
    Posts:
    31
    This worked for me, also didn't know that I had to install the "Editor Coroutines" package in the package manager.

     
    joshua_salcido likes this.
  13. joshua_salcido

    joshua_salcido

    Joined:
    May 10, 2022
    Posts:
    12
    just confirming the issue was resolved by doing this. i installed the "EditorCoroutines" package from the package manager under unity registry.