title: Task created in a session that has been invalidated
body: <p>I am getting the following crash on crashlytics which I can not reproduce on my device</p>
  
  <pre><code>Fatal Exception: NSGenericException
  Task created in a session that has been invalidated
  </code></pre>
  
  <p>at the following line </p>
  
  <pre><code>NSURLSessionTask *task = [self.session uploadTaskWithRequest:request fromFile:filePathURL];
  [task resume];
  [self.session finishTasksAndInvalidate];
  </code></pre>
  
  <p>I handled session invalidation at the delegate method</p>
  
  <pre><code>- (void)URLSession:(NSURLSession *)session didBecomeInvalidWithError:(NSError *)error {
      // Crashlytics logging
      [CrashlyticsKit setBoolValue:true forKey:@"URLSession_didBecomeInvalid"];
      self.session = [self createNewSession];
  }
  
  - (NSURLSession *)CreateSession {
      NSURLSessionConfiguration *sessionConfig = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:SERVER_URL];
  
      if (@available(iOS 11.0, *)) {
          sessionConfig.waitsForConnectivity = YES;
      }
      return [NSURLSession sessionWithConfiguration:sessionConfig delegate:self delegateQueue:nil];
  }
  </code></pre>
  
  <p>after uploading a new build, I still have the same crash and no Crashlytics logs at "<code>didBecomeInvalidWithError</code>" at all!</p>
  
  <p>any idea how to solve this crash?</p>