title: URL to local Bundle.main always returns nil
body: <p><strong>Overview</strong></p>
  
  <p>I’m doing a simple singing game for kids. The game just plays a video and shows three options. I was updating the videos, so I deleted it from the <em>Assets.xcassets</em> then added the new ones.</p>
  
  <p><strong>The problem</strong></p>
  
  <p>Now I’m getting this error:</p>
  
  <pre><code>Fatal error: Unexpectedly found nil while unwrapping an Optional value: file /Volumes/Documentos/Trabajo/Codigo proyectos/Currents/HANDSUP/diloEnSenas/SingsCategoryView.swift, line 69
  2020-05-12 14:03:46.769427-0500 HandsUP[12221:549710] Fatal error: Unexpectedly found nil while unwrapping an Optional value: file /Volumes/Documentos/Trabajo/Codigo proyectos/Currents/HANDSUP/diloEnSenas/SingsCategoryView.swift, line 69
  
  </code></pre>
  
  <p><strong>This is the code where I have the problem</strong>  </p>
  
  <pre><code>struct video: View {
      var url: String
  
      var body: some View{
          VideoPlayerView(playerQueve: self.changeVideo(file: self.url))
      }
  
      func changeVideo(file: String) -&gt; AVQueuePlayer {
  
          //let fileURL = file
          //let url = Bundle.main.url(forResource: fileURL , withExtension: "mp4")
  
          let url = Bundle.main.url(forResource: "color_1" , withExtension: "mp4")
  
          let playerItem = AVPlayerItem(url: url!)
  
          //set video
  
          let player = AVQueuePlayer(playerItem: playerItem)
  
          return player
      }
  }
  </code></pre>
  
  <p>It was working fine before. So my first thought was that I’m not adding the files in the right way, but I checked it again and the buttons that are in the same folder as the videos are showing correctly.</p>
  
  <p><a href="https://i.stack.imgur.com/Xuy6E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Xuy6E.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/BSkUI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BSkUI.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/V0kaG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/V0kaG.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/i9G2y.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/i9G2y.jpg" alt="enter image description here"></a></p>
  
  <p>Like you can see in the last image the button is showing well and the button image is in the same folder</p>
  
  <p><a href="https://i.stack.imgur.com/GJnZt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GJnZt.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/YO90v.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YO90v.png" alt="enter image description here"></a>
  Second thing I checked was the build phase but all files are in the right folder.</p>
  
  <p><strong>Question</strong></p>
  
  <ul>
  <li>Why isn't it getting the file? </li>
  <li>How can I debug the URL?</li>
  </ul>