title: Firebase Storage getDownloadUrl() method can't be resolved
body: <p>To upload <em>images</em> to <strong>Firebase Storage</strong> I am attaching <code>addOnSuccessListener</code> on the instance of the <strong>StorageReference</strong>. While overriding <code>onSuccess</code> method I am calling <code>getDownloadUrl()</code> on the instance of <code>taskSnapshot</code> but it is giving me an error saying </p>
  
  <blockquote>
    <p>Can't resolve method getDownloadUrl()</p>
  </blockquote>
  
  <p>This app I had created 2 months ago, earlier this app was working fine and <code>getDownloadUrl()</code> was working fine as well. Also, in <code>taskSnapshot</code> instance when I press <em>Ctrl+space</em>, in the suggestions I don't find <code>getDownloadUrl()</code> method. Why is it happening?</p>
  
  <p>Code to <code>onActivityResult()</code>:</p>
  
  <pre><code>@Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
  
      if(requestCode == RC_SIGN_IN) {
          if (resultCode == RESULT_OK) {
              Toast.makeText(this, "Signed in!!!1", Toast.LENGTH_SHORT).show();
          } else if (resultCode == RESULT_CANCELED) {
              Toast.makeText(this, "Failed to sign in", Toast.LENGTH_SHORT).show();
              finish();
          }
      }
      else if(requestCode == RC_PHOTO_PICKER &amp;&amp; resultCode == RESULT_OK){
          Uri selectedPhoto = data.getData();
  
          StorageReference localRefrence = storageReference.child(selectedPhoto.getLastPathSegment());
  
          //  Uploading the file on the storage
          localRefrence.putFile(selectedPhoto).addOnSuccessListener(new OnSuccessListener&lt;UploadTask.TaskSnapshot&gt;() {
              @Override
              public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
                   Uri downloadUrl = taskSnapshot.getDownloadUrl();
  
                  FriendlyMessage message = new FriendlyMessage(mUsername, null, downloadUrl.toString());
                  databaseReference.push().setValue(message);
              }
          });
      }
  }
  </code></pre>