小编Jon*_*nny的帖子

任务com.google.firebase.av已从java.util.concurrent.ThreadPoolExecutor中拒绝

朋友们,

我想知道这个错误.我在Android中使用Firebase.完整的错误是:

Fatal Exception: java.util.concurrent.RejectedExecutionException
Task com.google.firebase.a.v@61b9a00 rejected from java.util.concurrent.ThreadPoolExecutor@eacc239[Running, pool size = 2, active threads = 2, queued tasks = 128, completed tasks = 0]
Run Code Online (Sandbox Code Playgroud)

错误发生在DataChangea内部Fragment,谁正在阅读信息以填充RecyclerView.

我想知道为什么会发生这种情况以及我应该如何避免这种错误.

谢谢你,对不起,因为我知道我没有详细解释这个问题,但我真的不知道为什么会这样.

编辑

这是我意识到它显示错误的代码.这一切都始于我试图同时上传超过5张图片.

if (!pet.isUploaded()) {
    File image = new File(pet.getPicPath());
    final StorageReference referenceImage = storageRef.child("Adopcion" + "/" + pet.getOwner() + "/" + "Adopcion" + "/" + pet.getName() + pet.getAnimalID());

    Uri image2 = Uri.parse("");
    if (image.exists()) {
        image2 = Uri.fromFile(new File(image.toURI()));
    }

    UploadTask taskImage = referenceImage.putFile(image2); …
Run Code Online (Sandbox Code Playgroud)

java android firebase firebase-realtime-database

15
推荐指数
1
解决办法
1253
查看次数