Firebase RecyclerView : Not able to Query

I had an issue regarding query, I was actually trying inflate view in which the Person who is added as friend can be added to recyclerView.

@Override
public void onStart(){
super.onStart();
if(EmailPref!=null){

    Log.e("SahajLOG", " EmailPref " +EmailPref);
    FriendsData er=new FriendsData();
    er.setEmailPref("sahaj9917730102@gmail");
    final Firebase mFirebaseRef = new Firebase(constants.FIREBASE_URL+"rootssahaj/authGplus");
    Query ref = mFirebaseRef.orderByChild("sahaj9917730102@gmail").equalTo("yes");


    ref.addValueEventListener(new ValueEventListener() {
        @Override
        public void onDataChange(DataSnapshot dataSnapshot) {
            Log.e("SahajLOG", " dataSnapshot " + dataSnapshot);
        }

        @Override
        public void onCancelled(FirebaseError firebaseError) {

        }
    });



    FirebaseRecyclerAdapter<FriendsData,FriendsViewHolder> adapter=new FirebaseRecyclerAdapter<FriendsData, FriendsViewHolder>(
            FriendsData.class,
            R.layout.chat_view_list,
            FriendsViewHolder.class,
            ref

    ) {
        @Override
        protected void populateViewHolder(FriendsViewHolder friendsViewHolder, FriendsData s, int i) {
            friendsViewHolder.mName.setText(s.getUserNAME());
            friendsViewHolder.mStatus.setText(s.getStatus());
            Picasso.with(context).load(s.getPicurl()).transform(new CircleTransform()).into(friendsViewHolder.mImageProfile);
        }
    };

    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    AlphaInAnimationAdapter alphaAdapter = new AlphaInAnimationAdapter(adapter);
    alphaAdapter.setDuration(500);
    alphaAdapter.setInterpolator(new OvershootInterpolator(.5f));
    alphaAdapter.setFirstOnly(false);
    recyclerView.setAdapter(new ScaleInAnimationAdapter(alphaAdapter));


}



}

public static class FriendsViewHolder extends RecyclerView.ViewHolder{
ImageView mImageProfile;
android.widget.TextView mName;
android.widget.TextView mStatus;

public FriendsViewHolder(View itemView) {
    super(itemView);
    mImageProfile=(ImageView)itemView.findViewById(R.id.profilePICC);
    mName=(android.widget.TextView)itemView.findViewById(R.id.NameUSER);
    mStatus=(android.widget.TextView)itemView.findViewById(R.id.Status);

}


}

the error is :

Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "sahaj9917730102@gmail" (class com.rana.sahaj.myyu.FriendsData), not marked as ignorable (5 known properties: , "status", "sahaj", "picurl", "userNAME", "emailPref"])

i tried many soln as email is not consistent so i cant define it in FriendsData class n i tried to make it ignorable but it shows hat i m duplicating jackson files

Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'. com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/ASL2.0 File1: C:\Users\Sahaj.gradle\caches\modules-2\files-2.1\org.codehaus.jackson\jackson-mapper-asl\1.9.13\1ee2f2bed0e5dd29d1cb155a166e6f8d50bbddb7\jackson-mapper-asl-1.9.13.jar File2: C:\Users\Sahaj.gradle\caches\modules-2\files-2.1\org.codehaus.jackson\jackson-core-asl\1.9.13\3c304d70f42f832e0a86d45bd437f692129299a4\jackson-core-asl-1.9.13.jar`

so what should i do, any solution ?

n my Firebase data screenshot

ScreenShot here

GRADLE File

  apply plugin: 'com.android.application'



   android {
compileSdkVersion 23
buildToolsVersion '23.0.2'

dataBinding {
    enabled = true
}

defaultConfig {
    applicationId "com.rana.sahaj.myyu"
    minSdkVersion 16
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    renderscriptTargetApi 20
    renderscriptSupportModeEnabled true

}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

packagingOptions {
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE-FIREBASE.txt'
    exclude 'META-INF/NOTICE'
  }
  }

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile('com.github.afollestad.material-dialogs:core:0.8.5.4@aar') {
    transitive = true
}
compile('com.github.coyarzun89:fabtransitionactivity:0.1.1') {
    exclude module: 'CircularReveal'
}
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile 'com.android.support:design:23.2.1'
compile 'com.android.support:recyclerview-v7:23.2.1'
compile 'org.lucasr.dspec:dspec:0.1.1'
compile 'com.firebase:firebase-client-android:2.5.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.android.gms:play-services-auth:8.4.0'
compile 'com.google.android.gms:play-services-plus:8.4.0'
compile 'com.android.support:cardview-v7:23.2.1'
compile 'com.github.greenfrvr:rubber-loader:1.1.2@aar'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.koushikdutta.ion:ion:2.1.7'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'jp.wasabeef:blurry:1.0.5'
compile 'in.workarounds.typography:typography:0.0.8'
compile 'konifar:fab-transformation:1.0.0'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.github.dmytrodanylyk:android-morphing-button:98a4986e56'
compile 'jp.wasabeef:recyclerview-animators:2.2.1'
compile 'net.sjava:advancedasynctask:1.0.1'
compile 'com.firebaseui:firebase-ui:0.3.1'
// compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.13'

}

EDIT : Added FriendsData Class

public class FriendsData {
String picurl;
String userNAME;
String status;
String sahaj;
String EmailPref="sahaj9917730102@gmail";


public String getSahaj() {
    return sahaj;
}

public void setSahaj(String sahaj) {
    this.sahaj = sahaj;
}

public String getEmailPref() {
    return EmailPref;
}

public void setEmailPref(String emailPref) {
    EmailPref = emailPref;
}




public FriendsData(){

}

public String getPicurl() {
    return picurl;
}

public void setPicurl(String picurl) {
    this.picurl = picurl;
}

public String getUserNAME() {
    return userNAME;
}

public void setUserNAME(String userNAME) {
    this.userNAME = userNAME;
}

public String getStatus() {
    return status;
}

public void setStatus(String status) {
    this.status = status;
}



}

In this EmailPref is changing for very Individual User so i cnt hardCode it in class


ANSWERS:


I am looking at the snapshot you provided. You have a few dummy_n@gmail users. In them, they have a key-value pair with the key being sahaj9917730102@gmail. This makes sense cause your error says:

Unrecognized field "sahaj9917730102@gmail"

In your FriendsData object, you do not have a field with that name. However, you do have status, sahaj, picurl, userNAME, and emailPref. You either need to remove those from your dashboard, or modify your FriendsData object to have a value with that name

EDIT

If you want to add that as a field, modify your object like so:

public class FriendsData {

    String picurl;
    String userNAME;
    String status;
    String sahaj;
    String sahaj9917730102@gmail; // this is the key NAME, not value. 

    //all your accessors

}

I understand this is not practical, but I gave you the solution so you can understand the problem. You need to change it so that value does not need to be hard coded. I am not sure the purpose of the value, but I would recommend a boolean list? ie:

public class FriendsData {
     //others
     Map<String, Boolean> emails = new HashMap<>();
     ///...
}

then to add to it, you can just do

 emails.put("sahaj9917730102@gmail", true);

This is not a problem with your java code at runtime, but rather your build. Try adding this in your android block in your build.gradle

android {

    // ... other stuff

    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'
    }
}


 MORE:


 ? Firebase RecyclerView : Not able to Query
 ? Firebase RecyclerView : Not able to Query
 ? Firebase RecyclerView infinite scroll
 ? how to sort in the new Firebase database reference (Recyclerview)
 ? Getting Firebase children to RecyclerView
 ? Populate recyclerview with firebase through databinding
 ? Populate recyclerview with firebase through databinding
 ? Populate recyclerview with firebase through databinding
 ? Ignoring new fields on JSON objects using Jackson
 ? Implementing Firebase native express ads with Firebase query