title: AndroidX ActivityResultContracts package not found / class not found
body: <p>According to <a href="https://developer.android.com/training/basics/intents/result" rel="noreferrer">this documentation from Google about launching an activity to get a result</a>:</p>
  
  <blockquote>
    <p>While the underlying startActivityForResult() and onActivityResult()
    APIs are available on the Activity class on all API levels, it is
    strongly recommended to use the Activity Result APIs introduced in
    AndroidX Activity 1.2.0-alpha02 and Fragment 1.3.0-alpha02.</p>
  </blockquote>
  
  <p>I want to let my users take a photo from within my app and get that photo data back to my app. I was going to use the old startActivityForResult() but this new method looks like it will solve lots of problems and be more reliable, so I wanted to give it a try. I'm supposed to be able to call <code>registerForActivityResult()</code> and pass it a built-in contract for taking a picture called <a href="https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.TakePicture" rel="noreferrer">ActivityResultsContracts.TakePicture</a>:</p>
  
  <pre><code>this.registerForActivityResult(new ActivityResultContracts.TakePicture(), ...);
  </code></pre>
  
  <p>But I get: <code>error: package ActivityResultContracts does not exist</code></p>
  
  <p>I've added this to my app/build.gradle:</p>
  
  <pre><code>// original include
  //implementation 'androidx.appcompat:appcompat:1.1.0'
  
  // suggestion from Google documentation
  //implementation 'androidx.appcompat:appcompat:1.2.0-alpha02'
  
  // AndroidStudio suggested a newer version was available
  implementation 'androidx.appcompat:appcompat:1.2.0-beta01'
  </code></pre>
  
  <p>I tried the <code>alpha02</code> and the <code>beta01</code> and neither of them seem to have the classes referred to in the documentation. </p>
  
  <p>When I try to import the class manually at the top of my java file, AndroidStudio doesn't think the package exists either. It should be <code>androidx.activity.result.contract.ActivityResultContracts.TakePicture</code>, but this is what I see:</p>
  
  <p><a href="https://i.stack.imgur.com/hCoDX.png" rel="noreferrer"><img src="https://i.stack.imgur.com/hCoDX.png" alt="screenshot of Android Studio auto-complete package list in import statement"></a></p>
  
  <p>I'm using gradle 3.5.3 if that matters at all. (Whenever I try to upgrade to the latest gradle, my project goes insane, so I've just been staying with the version that works.)</p>