title: Cannot resolve method ´getDownloadUrl'
body: <p>I am new to Android Studio. I am having a problem with the code, and I don't know what it is since I am following a YouTube tutorial
  of creating a user in Android plus Firebase. The problem is about the storage on Firebase.</p>
  
  <p>My code:</p>
  
  <pre class="lang-java prettyprint-override"><code>public class Profile extends AppCompatActivity {
      private static final int CHOOSE_IMAGE = 101;
      EditText editText;
      ImageView imageView;
      String profileimageurl;
      Uri uriProfileImage;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_profile2);
  
          editText = (EditText) findViewById(R.id.nome);
          imageView = (ImageView) findViewById(R.id.foto);
  
          imageView.setOnClickListener(new View.OnClickListener() {
  
              @Override
              public void onClick(View v) {
                  showImageChooser();
              }
          });
      }
  
      @Override
      protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
          super.onActivityResult(requestCode, resultCode, data);
          if (requestCode == CHOOSE_IMAGE &amp;&amp; data != null &amp;&amp; data.getData() != null) {
              uriProfileImage = data.getData();
              try {
                  Bitmap bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), uriProfileImage);
                  imageView.setImageBitmap(bitmap);
  
                  uploadImageToFirebaseStorage();
  
              } catch(IOException e) {
                  e.printStackTrace();
              }
          }
      }
  
      private void uploadImageToFirebaseStorage() {
          StorageReference profileImageRef = FirebaseStorage.getInstance().getReference("profilepics/" + System.currentTimeMillis() + ".jpg");
          if (uriProfileImage != null) {
              profileImageRef.putFile(uriProfileImage)
  
              .addOnSuccessListener(new OnSuccessListener &lt; UploadTask.TaskSnapshot &gt; () {@Override
                  public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
                      profileimageurl = taskSnapshot.getDownloadUrl().toString();
  
                  }
              }).addOnFailureListener(new OnFailureListener() {@Override
                  public void onFailure(@NonNull Exception e) {
  
  }
              });
          }
      }
  
      private void showImageChooser() {
          Intent intent = new Intent();
          intent.setType("image/*");
          intent.setAction(Intent.ACTION_GET_CONTENT);
          startActivityForResult(Intent.createChooser(intent, "Escohe a imagem de perfil"), CHOOSE_IMAGE);
      }
  
  }
  </code></pre>