title: FirebaseInstanceId: Token retrieval failed android
body: <p>I am trying to retrive data using a recylerView, but I keep getting an error in regards to this line <code>Upload upload=postsnapshot.getValue(Upload.class);</code> but it's not telling me what the problem is exaclty and plus I get another error saying this <code>E/FirebaseInstanceId: Token retrieval failed: INVALID_SENDER</code> I'm not sure what's going on. Here is my code below. Any help will be appricated. Thanks in advance</p>
  
  <pre><code>//Log cat error
  
  2020-03-31 17:15:47.842 1943-1943/? E/FirebaseInstanceId: binding to the service failed
  
  
  
  
  //This my model class
  
      public class Upload {
      private String mImageUrl;
      private String nickName;
      private String fullname;
      private String age;
      private String height;
  
  
      public Upload(){
          //Empty constructor needed
      }
  
      public Upload(String imageUrl ){
          mImageUrl=imageUrl;
  
  
  
  
      }
  
      public String getNickName() {
          return nickName;
      }
  
      public void setNickName(String nickName) {
          this.nickName = nickName;
      }
  
      public String getFullname() {
          return fullname;
      }
  
      public void setFullname(String fullname) {
          this.fullname = fullname;
      }
  
      public String getAge() {
          return age;
      }
  
      public void setAge(String age) {
          this.age = age;
      }
  
      public String getHeight() {
          return height;
      }
  
      public void setHeight(String height) {
          this.height = height;
      }
  
       public String getmImageUrl() {
          return mImageUrl;
      }
  
      public void setmImageUrl(String mImageUrl) {
          this.mImageUrl = mImageUrl;
      }
  
     //My adapter class
  
     public class ImageAdapter extends RecyclerView.Adapter&lt;ImageAdapter.ImageViewHolder&gt;{
  
      private Context mContext;
      private List&lt;Upload&gt; mUploads;
  
      public ImageAdapter(Context context, List&lt;Upload&gt; uploads){
          mContext = context;
          mUploads = uploads;
  
      }
  
      @NonNull
      @Override
      public ImageViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
          View V = LayoutInflater.from(mContext).inflate(R.layout.cardview, parent, false);
          return new ImageViewHolder(V);
  
  
      }
  
      @Override
      public void onBindViewHolder(@NonNull ImageViewHolder holder, int position) {
          Upload uploadCurrent=mUploads.get(position);
  
          holder.txt1.setText(uploadCurrent.getnickName());
          Picasso.get().load(String.valueOf(uploadCurrent)).fit().centerCrop().into(holder.imageView);
  
      }
  
      @Override
      public int getItemCount() {
          return mUploads.size();
  
      }
  
      public class ImageViewHolder extends RecyclerView.ViewHolder{
          public ImageView imageView;
          public TextView txt1;
  
          public ImageViewHolder(@NonNull View itemView) {
              super(itemView);
  
              imageView=itemView.findViewById(R.id.imageview);
              txt1=itemView.findViewById(R.id.nickname);
          }
      }
  
      //This the main page 
  
         databaseReference.child(uid).addValueEventListener(new ValueEventListener() {
              @Override
              public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
  
                  for (DataSnapshot postsnapshot : dataSnapshot.getChildren()) {
  
                   Upload upload=postsnapshot.getValue(Upload.class);
                   mUploads.add(upload);
  
  
  
                  }
  
  
  
                  mAdapter.notifyDataSetChanged();
  
  
  
  
              }
  
              @Override
              public void onCancelled(@NonNull DatabaseError databaseError) {
                  Toast.makeText(MainActivity.this, databaseError.getMessage(), Toast.LENGTH_LONG).show();
  
              }
          });
  
        //This class is where they upload their image
       storageRef.putFile(filepath).addOnSuccessListener(new OnSuccessListener&lt;UploadTask.TaskSnapshot&gt;() {
                              @Override
                              public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
                                  //Toast.makeText(UploadAdActivity.this,"Uploaded successfully",Toast.LENGTH_LONG).show();
                                  //Upload upload=new Upload(taskSnapshot.getStorage().getDownloadUrl().toString());
                                  //String uploadId=update.push().getKey();
                                  //update.child(uploadId).setValue(upload);
  
                                  progressDialog.dismiss();
                                  Toast.makeText(UploadAdActivity.this,"Uploaded successfully",Toast.LENGTH_LONG).show();
                                  storageReference.getDownloadUrl().toString();
                                  taskSnapshot.getStorage().getDownloadUrl().addOnSuccessListener(new OnSuccessListener&lt;Uri&gt;() {
                                      @Override
                                      public void onSuccess(Uri uri) {
                                          String download_url=uri.toString();
                                          Upload upload=new Upload(download_url);
                                          String uploadId=update.push().getKey();
                                         // String a=update.push().getKey();
  
  
                                          Intent d=new Intent(UploadAdActivity.this,AllInOneActivity.class);
  
                                          d.putExtra("a",uploadId);
  
  
  
                                          update.child(uploadId).setValue(upload);
                                          Intent i = new Intent(UploadAdActivity.this, NextPage.class);
                                          i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
                                          i.putExtra("a",uploadId);
                                          startActivity(i);
                                      }
                                  });
                              }
                          }).addOnFailureListener(new OnFailureListener() {
                              @Override
                              public void onFailure(@NonNull Exception e) {
                                  progressDialog.dismiss();
                                  Toast.makeText(UploadAdActivity.this,"Failed to upload",Toast.LENGTH_LONG).show();
  
                              }
                          }).addOnProgressListener(new OnProgressListener&lt;UploadTask.TaskSnapshot&gt;() {
                              @Override
                              public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {
                                  double progress = (100.0*taskSnapshot.getBytesTransferred()/taskSnapshot
                                          .getTotalByteCount());
                                  progressDialog.setMessage("Uploaded "+(int)progress+"%");
  
                              }
                          });
  </code></pre>