Android Parse SDK I / O failure unknown format (magic number 227b)

I am trying to restore my entries from Parse. The class is called Rating. When I try to find less than 5 entries, there is no problem. But when I try to find more records, the following stack is displayed:

com.parse.ParseRequest$ParseRequestException: i/o failure at com.parse.ParseRequest.newTemporaryException(ParseRequest.java:289) at com.parse.ParseRequest$2.then(ParseRequest.java:144) at com.parse.ParseRequest$2.then(ParseRequest.java:138) at bolts.Task$15.run(Task.java:839) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) at java.lang.Thread.run(Thread.java:841) Caused by: java.io.IOException: unknown format (magic number 227b) at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:101) at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:81) at com.parse.ParseDecompressInterceptor.intercept(ParseDecompressInterceptor.java:40) at com.parse.ParseHttpClient$ParseNetworkInterceptorChain.proceed(ParseHttpClient.java:147) at com.parse.ParsePlugins$1.intercept(ParsePlugins.java:115) at com.parse.ParseHttpClient$ParseNetworkInterceptorChain.proceed(ParseHttpClient.java:147) at com.parse.ParseHttpClient.execute(ParseHttpClient.java:122) at com.parse.ParseRequest$3.then(ParseRequest.java:135) at com.parse.ParseRequest$3.then(ParseRequest.java:132) at bolts.Task$15.run(Task.java:839) at bolts.BoltsExecutors$ImmediateExecutor.execute(BoltsExecutors.java:105) at bolts.Task.completeAfterTask(Task.java:830) at bolts.Task.continueWithTask(Task.java:642) at bolts.Task.continueWithTask(Task.java:653) at bolts.Task$13.then(Task.java:745) at bolts.Task$13.then(Task.java:733) ... 4 more 

Does anyone know why this is happening?

+8
android
source share
4 answers

To do this, I use version 1.11.0 (compile 'com.parse: parse-android: 1.11.0'). No problem so far.

+7
source share

I have the same error, but with me the request works fine with Android Api +19, older versions cause this exception

+3
source share

Create Class ParseLogInterceptor

 public class ParseLogInterceptor implements ParseNetworkInterceptor { @Override public ParseHttpResponse intercept(Chain chain) throws IOException { ParseHttpRequest request = chain.getRequest(); ParseHttpResponse response = chain.proceed(request); // Consume the response body ByteArrayOutputStream responseBodyByteStream = new ByteArrayOutputStream(); int n; byte[] buffer = new byte[1024]; while ((n = response.getContent().read(buffer, 0, buffer.length)) != -1) { responseBodyByteStream.write(buffer, 0, n); } final byte[] responseBodyBytes = responseBodyByteStream.toByteArray(); Log.i("Response_Body", new String(responseBodyBytes)); // Make a new response before return the response response = new ParseHttpResponse.Builder(response) .setContent(new ByteArrayInputStream(responseBodyBytes)) .build(); return response; }} 

Add this before Parse.initialize ():

 Parse.addParseNetworkInterceptor(new ParseLogInterceptor()); 

This works for me.

Source: https://github.com/ParsePlatform/Parse-SDK-Android/issues/325

+2
source share

This is a bug in Parse 1.12.0 . I opened the problem in my repository at https://github.com/ParsePlatform/Parse-SDK-Android/issues/355 - the developers reproduced it and are working on a fix.

As others have noted, the current workaround is to simply go back to 1.11.0 or compile with API19 or higher.

+1
source share

All Articles