Error when fetching objects in Android

I’m trying to make a simple query sorted by a column and I keep getting this error and I can’t seem to figure out what I’m doing wrong I get this Error (with no error code):

BackendlessFault{ code: 'IllegalArgumentException', message: 'Attempt to invoke interface method 'java.lang.String android.content.SharedPreferences.getString(java.lang.String, java.lang.String)' on a null object reference' }

This is my code:

QueryOptions qo = new QueryOptions();
qo.addSortByOption("worldIndex");
BackendlessDataQuery query = new BackendlessDataQuery();
query.setQueryOptions(qo);
Backendless.Persistence.of(World.class).find(query,new AsyncCallback<BackendlessCollection<World>>(){
 @Override
 public void handleResponse(BackendlessCollection<World> worlds )
 {
 // list of worlds
 Log.i(TAG,"Got " + worlds.getCurrentPage().size() + "/" + worlds.getTotalObjects());
 }
 @Override
 public void handleFault( BackendlessFault fault )
 {
 Log.e(TAG,"Error fetching worlds with code: " + fault.getCode()+", message: " + fault.getMessage());
 // an error has occurred, the error code can be retrieved with fault.getCode()
 }
});

Hi Elad,

have you initialized your app with the Backendless.initApp call?

Regards,
Mark

Yes I have this line earlier in onCreate
Backendless.initApp( this, backendlessAppId, backendlessAppSecret, appVersion );

After running clean build I am now getting this error:

message: https://api.backendless.com/1.0/binary
code: Internal client exception

Any ideas?

I have copy & pasted from the docs so I have really no clue of where it could have went wrong

What does it mean ? (when pressing on the link given in the error)

‘Action not found For request ‘GET /1.0/binary’’

Make sure you are using async API when invoking from the main thread on Android. Network communication is not allowed from the UI thread.

Regards,
Mark

How can I make sure of that?
I’m using
Backendless.Persistence.of(myObject.class).find(query,new AsyncCallback<BackendlessCollection<myObject>>(){

Hi Elad, you mentioned you copied the code from the docs. Could you please point out the section in the docs you used so I can try reproducing the problem?