Good day. The problem is that I upload a picture to the firebase server in my android application as follows
/** * Upload image from Bitmap localImage to Firebase server */ public void loadImageToServer(){ ByteArrayOutputStream baos = new ByteArrayOutputStream(); localImg.compress(Bitmap.CompressFormat.JPEG, 100, baos); byte[] dataBAOS = baos.toByteArray(); /***************** UPLOADS THE PIC TO FIREBASE*****************/ StorageReference storageRef = FirebaseStorage.getInstance(). getReferenceFromUrl("gs://*************.appspot.com/userImages/"); UploadTask uploadTask = storageRef.putBytes(dataBAOS); uploadTask.addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception exception) { Toast.makeText(rootView.getContext(),R.string.error,Toast.LENGTH_SHORT).show(); showLoading(false); } }).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() { @Override public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) { urlToImage = taskSnapshot.getDownloadUrl().toString(); // TODO Здесь отправляется ивент на создание аккаунте в Auth showLoading(false); } }); } The file is loaded, but when you try to get the link (apparently), you get an exception like this:
E/StorageUtil: error getting token java.util.concurrent.ExecutionException: com.google.android.gms.internal.zzbqn: Please sign in before trying to get a token. W/NetworkRequest: no auth token for request The userImages folder in firebase exists, the rules are as follows:
service firebase.storage { match /b/******-******.appspot.com/o { match /{allPaths=**} { allow read, write; } } } And besides, the file really appears in the database!