title: Unity ScriptedImporter AssetImporters does not exist in the namespace 'UnityEditor' on build
body: <p>I'm creating a program where I can open PDFs located in my Resource folder in my Assets.</p>
  <p>It works fine out the box when I change the file extensions from &quot;.pdf&quot; to &quot;.txt&quot;. However, I would rather not change it in order to load the resource as that adds additional tasks whenever new PDFs need to be added.</p>
  <p>No, the resource will not load if the file extension is .pdf.</p>
  <p>I followed some documentation to write my own importer for the .pdf extension and it works perfectly in the Unity editor. However, when I attempt to build, I get a bunch of namespace errors related to the importer I wrote.</p>
  <p>Using <strong>Unity 2021.1.12f1</strong></p>
  <p>My code:</p>
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using System.IO;
  using UnityEditor.AssetImporters;
  using UnityEngine;
  
  [ScriptedImporter(1, &quot;pdf&quot;)]
  public class PDFImporter : ScriptedImporter
  {
      public override void OnImportAsset(AssetImportContext ctx)
      {
          byte[] bytes = File.ReadAllBytes(ctx.assetPath);
          PDFAsset pdfa = new PDFAsset(bytes);
  
          ctx.AddObjectToAsset(&quot;main&quot;, pdfa);
          ctx.SetMainObject(pdfa);
      }
  }
  </code></pre>
  <p>Errors on build:</p>
  <pre><code>Assets\Editor\PDFImporter.cs(4,19): error CS0234: The type or namespace name 'AssetImporters' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?)
  Assets\Editor\PDFImporter.cs(8,28): error CS0246: The type or namespace name 'ScriptedImporter' could not be found (are you missing a using directive or an assembly reference?)
  Assets\Editor\PDFImporter.cs(7,2): error CS0246: The type or namespace name 'ScriptedImporterAttribute' could not be found (are you missing a using directive or an assembly reference?)
  Assets\Editor\PDFImporter.cs(7,2): error CS0246: The type or namespace name 'ScriptedImporter' could not be found (are you missing a using directive or an assembly reference?)
  Assets\Editor\PDFImporter.cs(10,40): error CS0246: The type or namespace name 'AssetImportContext' could not be found (are you missing a using directive or an assembly reference?)
  </code></pre>
  <p>I followed some of the solutions <a href="https://forum.unity.com/threads/cant-build-a-project-that-contains-scriptedimporter.721676/" rel="nofollow noreferrer">here</a>, but still receive those errors. I wasn't able to find any libraries to import into unity to use the experimental libraries as shown <a href="https://docs.unity3d.com/2020.1/Documentation/ScriptReference/Experimental.AssetImporters.ScriptedImporter.GatherDependenciesFromSourceFile.html" rel="nofollow noreferrer">in this documentation</a>.</p>
  <p>To be clear, I was running <strong>Unity 2020.1.5f</strong> and the documentation indicates I should have</p>
  <blockquote>
  <p>using UnityEditor.Experimental.AssetImporters</p>
  </blockquote>
  <p>However, I wasn't able to find an easy location for Experimental stuff and, frankly, don't feel it's necessary since the <strong>UnityEditor.AssetImporters</strong> is available to me for use.</p>
  <p>I updated Unity to the most recent 2021 version and attempt again just in case, but to no avail.</p>