'No app check token for request' flutter firebase error

3,114

Solution 1

Go to Firebase console, then navigate to the storage tab. You should see something like this:

Firebase console storage tab

Click "Configure App Check" and there will be a config page. Ensure that your Firebase Storage is not set to enforce app check.

Of course, the ideal option would be to set up app check. Invertase recently released this plugin for setting it up with Flutter. You can check out the article here.

Solution 2

In my case I solved the problem by using the await typecasting. You are not getting the error related to app check token request. You are getting the error for not waiting for the completion of download. Just add the line after await which is required for the UploadTask finished and it works.

final Reference storageReference = firebase_storage.FirebaseStorage.instance
        .ref()
        .child("products")
        .child("product_$productId.png");
    String downloadURL;

    UploadTask uploadTask = storageReference.putFile(mFileImage);
     
    downloadURL = await (await uploadTask).ref.getDownloadURL();  
Share:
3,114
ryan chandra
Author by

ryan chandra

Updated on December 31, 2022

Comments

  • ryan chandra
    ryan chandra over 1 year

    my flutter android app was working well until i want to upload something to firebase storage. i get 'No app check token for request' error message

    does anyone know what to do to solve this problem?

    • Andrii Syrokomskyi
      Andrii Syrokomskyi over 2 years
      If the AppCheck is not activated, access to the storage is affected by the rules: https://console.firebase.google.com/ > Storage > Rules.
  • ryan chandra
    ryan chandra almost 3 years
    actually the status in firebase storage is unenforce so i dont know why the system still using app check feature for my app
  • Alex Hartford
    Alex Hartford almost 3 years
    That's definitely odd! Can you include your code in the question?
  • MmBaguette
    MmBaguette over 2 years
    Hey, same issue is happening to me. Did anyone find an answer to this? I was doing storageReference.ref(imageFilePath).imageRef.getDownloadURL(‌​);.
  • mike hennessy
    mike hennessy over 2 years
    Same for me, have status to "unenforced" but getting that error.