Uri downloaduri=taskSnapshot.getDownloadUrl();//here i cant use getdownloadurl() function
DatabaseReference new_prod=db.push();
This worked for me after hours of research and differents ways :
filepath.putFile(resultUri).addOnSuccessListener(new OnSuccessListener() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
//here
Task urlTask = taskSnapshot.getStorage().getDownloadUrl();
while (!urlTask.isSuccessful());
Uri downloadUrl = urlTask.getResult();
final String sdownload_url = String.valueOf(downloadUrl);