title: Generating resource_bundle_accessor, Type 'Bundle' has no member 'module'
body: <p>Some times Xcode can not determine the <code>module</code> parameter in the Bundle.</p>
  <blockquote>
  <p>Type 'Bundle' has no member 'module'</p>
  </blockquote>
  <p>My investigations show that SPM generates an extension on the module (some times) for this property automatically in a file called <em><code>resource_bundle_accessor</code></em> like:</p>
  <pre><code>import class Foundation.Bundle
  
  private class BundleFinder {}
  
  extension Foundation.Bundle {
      /// Returns the resource bundle associated with the current Swift module.
      static var module: Bundle = {
          let bundleName = &quot;ABUIKit_ABStyleKit&quot;
  
          let candidates = [
              // Bundle should be present here when the package is linked into an App.
              Bundle.main.resourceURL,
  
              // Bundle should be present here when the package is linked into a framework.
              Bundle(for: BundleFinder.self).resourceURL,
  
              // For command-line tools.
              Bundle.main.bundleURL,
          ]
  
          for candidate in candidates {
              let bundlePath = candidate?.appendingPathComponent(bundleName + &quot;.bundle&quot;)
              if let bundle = bundlePath.flatMap(Bundle.init(url:)) {
                  return bundle
              }
          }
          fatalError(&quot;unable to find bundle named ABUIKit_ABStyleKit&quot;)
      }()
  }
  </code></pre>
  <p>But sometimes it won't.  Why is that and how can I make it work automatically <strong>again</strong> (Without the need to manually implement that.)</p>
  <p>Both situations happen on <strong>Xcode 12 beta.3</strong></p>
  <h3>Update</h3>
  <p>Sometimes it shows:</p>
  <blockquote>
  <p>'module' is inaccessible due to 'internal' protection level</p>
  </blockquote>
  <p>And it's not showing the file at all.</p>