Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/194.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android RequestBatch出现语法分析器错误_Android_Facebook_Facebook Fql_Facebook Batch Request - Fatal编程技术网

Android RequestBatch出现语法分析器错误

Android RequestBatch出现语法分析器错误,android,facebook,facebook-fql,facebook-batch-request,Android,Facebook,Facebook Fql,Facebook Batch Request,我想在facebook sdk中使用RequestBatch类执行多个请求。 但我遇到了一个奇怪的问题,那就是requestBatch总是为第二次响应返回“错误数据”。错误响应为: {Response: responseCode: 200, graphObject: null, error: {HttpStatus: 400, errorCode: 601, errorType: OAuthException, errorMessage: (#601) Parser error: unexpe


我想在facebook sdk中使用RequestBatch类执行多个请求。
但我遇到了一个奇怪的问题,那就是requestBatch总是为第二次响应返回“错误数据”。错误响应为:

{Response:  responseCode: 200, graphObject: null, error: {HttpStatus: 400, errorCode: 601, errorType: OAuthException, errorMessage: (#601) Parser error: unexpected end of query.}, isFromCache:false}
这就是我的消息来源。在这段代码中,我执行了2个请求。我确信有两个请求是正确的,因为如果我执行一个请求,RequestBatch将返回正确的数据。如果我执行两个请求,并且只有第二个请求得到错误响应,那么问题就会发生

 String mutualFriendPatternQuery="SELECT name,mutual_friend_count FROM user WHERE uid IN(1797105393,100000027665293)";

        Bundle args1=new Bundle();
        args1.putString("q", mutualFriendPatternQuery);

        Request request1 = new Request(session, "fql", args1, HttpMethod.GET);
        requests.add(request1);

        String commonLikesQuery="SELECT page_id FROM page_fan WHERE uid = 100004429063597 AND page_id IN (SELECT page_id FROM page_fan WHERE uid = me())";

        Bundle args2=new Bundle();
        args2.putString("q", commonLikesQuery);

        Request request2 = new Request(session, "fql", args2, HttpMethod.GET);
        requests.add(request2);

        RequestBatch requestBatch=new RequestBatch(requests);
        requestBatch.setTimeout(60000);

        List<Response> responses = requestBatch.executeAndWait();
固定的
这是我愚蠢的过错。将args1更改为args2以进行修复。

我认为这是您的问题:

Bundle args2=new Bundle();
args1.putString("q", commonLikesQuery); // <----- this should be args2.putString(...)
Bundle args2=新Bundle();

args1.putString(“q”,commonLikesQuery);//天哪,让我马上试试。抱歉耽误了你的时间。没问题,这很容易犯错误。
Bundle args2=new Bundle();
args1.putString("q", commonLikesQuery); // <----- this should be args2.putString(...)