El codigo que me produce error es el siguiente
public void createOrUpdateProfileWithImage(final Profile profile, Uri imageUri, final OnProfileCreatedListener onProfileCreatedListener) {
String imageTitle = ImageUtil.generateImageTitle(UploadImagePrefix.PROFILE, profile.getId());
UploadTask uploadTask = databaseHelper.uploadImage(imageUri, imageTitle);
if (uploadTask != null) {
uploadTask.addOnCompleteListener(task -> {
if (task.isSuccessful()) {
Uri downloadUrl = task.getResult().getDownloadUrl();
LogUtil.logDebug(TAG, "successful upload image, image url: " + String.valueOf(downloadUrl));
profile.setPhotoUrl(downloadUrl.toString());
createOrUpdateProfile(profile, onProfileCreatedListener);
} else {
onProfileCreatedListener.onProfileCreated(false);
LogUtil.logDebug(TAG, "fail to upload image");
}
});
} else {
onProfileCreatedListener.onProfileCreated(false);
LogUtil.logDebug(TAG, "fail to upload image");
}
}
...