title: Xcode: "<unknown>:0: error: cannot load module 'main' as 'Swift'" upon trying to compile
body: <p>Just started using Swift on Xcode.</p>
  <p>For some reason, anytime I want to compile, it shows the error: <code>&lt;unknown&gt;:0: error: cannot load module 'main' as 'Swift'</code></p>
  <p>The only way I could find to fix it is to either clean build folder or delete build folder myself, then compile.</p>
  <p>The code I have is just changing from:</p>
  <pre class="lang-swift prettyprint-override"><code>print(&quot;Hello, world!&quot;)
  </code></pre>
  <p>to</p>
  <pre class="lang-swift prettyprint-override"><code>print(&quot;Hello, world&quot;)
  </code></pre>
  <p>Am I doing something totally wrong?</p>
  <p>Xcode version: 12.1 (12A7403) with Xcode 12.1 Toolchain</p>
  <p>Edit:</p>
  <p>The project I created was a Command Line Tool, with Swift selected as the language. All other settings were defaulted (at least I believe so)</p>
  <p>Also, restart Xcode or create a new project wouldn't solve the problem.</p>