Error response when trying to save Objects

Im trying make a Friend system by creating a column for a one to Many User Relationship.
When im trying to save the BackendlessUser array list with the user its returning the Faults responses

Object[] currentfriendObj = (Object[]) user.getProperty("friends");


if (currentfriendObj .length > 0) {
 currentfriends = (BackendlessUser[]) currentfriendObj ;
 if (currentfriends.length > 0) {


 newfriends = new BackendlessUser[currentfriends.length + 1];




 for (int i = 0; i < currentfriends.length; i++) {
 newfriends = currentfriends;


 }


 newfriends[newfriends.length - 1] = newUser;


}
user.setProperty("friends", newfriends);


Backendless.Persistence.save(user, new AsyncCallback&lt;BackendlessUser&gt;() {//NOT SAVING


 @Override
 public void handleResponse(BackendlessUser backendlessUser) {
 Log.i("hope", "SAVED!!!");
 }


 @Override
 public void handleFault(BackendlessFault backendlessFault) {
 Log.i("hope", "ERROR!!!!");


 }
});

Please provide the details of what the Fault object contains. We’d need to know the following:

    error code error message the "detail" string
All of these are documented here: https://backendless.com/documentation/data/android/error_handling.htm

error code : 1020

message :Missing ___class property for entity: friends

what you mean by the “detail” string

The “detail” string can be obtained using the getDetail() method on the fault object.

Please make sure you’re using the latest build of the Backendless library.

the detail string is “null”

and i am using latest libarary

What if you change the code to:

user.setProperty("friends", Arrays.asList( newfriends ) );

same result

What is the type of the “user” object?

BackendlessUser user;

try changing this:

Backendless.Persistence.save(user, new AsyncCallback&lt;BackendlessUser&gt;() {

to this:

Backendless.Persistence.of( BackendlessUser.class ).save(user, new AsyncCallback&lt;BackendlessUser&gt;() {

sadly same result

Does the user object you save have any other properties?

just “name”

Ok, what does “newUser” object look like? Is it a registered user or just an object you created on the client side?

its a registered user

String whereClause = "name =" + "\'" + secondUser + "\'";
BackendlessDataQuery query = new BackendlessDataQuery();
QueryOptions queryOptions = new QueryOptions();
query.setWhereClause(whereClause);
queryOptions.addRelated("friends");
queryOptions.addRelated("friends.RELATION-OF-RELATION");
query.setQueryOptions(queryOptions);
Backendless.Persistence.of(BackendlessUser.class).find(query, new AsyncCallback&lt;BackendlessCollection&lt;BackendlessUser&gt;>() {
    @Override
    public void handleResponse(BackendlessCollection&lt;BackendlessUser&gt; secUser) {




       newUser = secUser.getCurrentPage().get(0);

Thanks. What is your application id?