Using the order on custom CouchbaseViewQuery

Hello.
When I try to add the order into the current query:

$query = CouchbaseViewQuery::from("fileActivity", 'toUserIdWithCreatedAt')->limit(100)->custom(["startkey" => $startKey, "endkey" => $endKey])->order(CouchbaseViewQuery::ORDER_DESCENDING)->stale(CouchbaseViewQuery::UPDATE_BEFORE);

I get an error:

not resultexception 'CouchbaseException' with message 
'query_parse_error: No rows can match your key range, reverse your 
start_key and end_key or set descending=false' in 
[CouchbaseNative]/CouchbaseBucket.class.php:285

Prompt please the how you could use a order.
Thank you.