title: The app's Info.plist must contain an NSMotionUsageDescription key
body: <p>I am getting the following error during the runtime:</p>
  
  <p>This app has crashed because it attempted to access privacy-sensitive data without a usage description.  The app's Info.plist must contain an NSMotionUsageDescription key with a string value explaining to the user how the app uses this data.</p>
  
  <p>I have added the key to the plist file:</p>
  
  <pre><code>&lt;!--  Motion --&gt;
  &lt;key&gt;NSMotionUsageDescription&lt;/key&gt;
  &lt;string&gt;This app needs to be able to access your motion use&lt;/string&gt;
  </code></pre>
  
  <p>and this the code in AppDelegate:</p>
  
  <pre><code>if ([CMMotionActivityManager isActivityAvailable])
  {
      CMMotionActivityManager *motionManager = [[CMMotionActivityManager alloc] init];
      NSOperationQueue *motionActivityQueue = [[NSOperationQueue alloc] init];
  
      [motionManager queryActivityStartingFromDate:[NSDate distantPast] toDate:[NSDate date] toQueue:motionActivityQueue withHandler:^(NSArray *activities, NSError *error) {
          if (error &amp;&amp; (error.domain == CMErrorDomain) &amp;&amp; (error.code == CMErrorMotionActivityNotAuthorized)) {
  
          } else if (activities || !error) {
  
          }
  
          dispatch_async(dispatch_get_main_queue(), ^{
  
          });
      }];        
  }
  </code></pre>
  
  <p>Why am I keep getting this crash? I deleted all the derived folder, cleaned the project. But still asking me the key! Is it an Apple bug?</p>