title: How do I fix Dagger 2 error '... cannot be provided [...]'?
body: <blockquote>
    <p>This is a <a href="https://meta.stackoverflow.com/q/291992/1837367">Canonical Question</a> because this is a common error with Dagger 2.</p>
    
    <p><em>If your question was flagged as a duplicate</em> please read this post carefully <em>and make sure to understand what this error means and why it occured. If this post does not work for you make sure to include</em> where <em>and</em> how <em>you provide the mentioned classes and include the</em> full error message <em>in your question like the one here.</em></p>
  </blockquote>
  
  <p>I tried to use a dependency with Dagger 2, but I receive the following error when I try to compile my project:</p>
  
  <blockquote>
    <p><strong>error:</strong> com.example.<em>MyDependency</em> cannot be provided without an @Inject constructor or from an @Provides-annotated method.  </p>
    
    <p>com.example.<em>MyDependency</em> is provided at<br>
    com.example.MyComponent.myDependency()</p>
  </blockquote>
  
  <p>What does this mean and how can I fix it?</p>
  
  <p>I have a component and tried to provide a dependency. My basic setup looks like this:</p>
  
  <pre><code>// this is the dependency I try to use
  class MyDependency {}
  
  @Component
  interface MyComponent {
      // I want to make it accessible to be used with my component
      MyDependency myDependency();
  }
  </code></pre>