アプリは 2.2.1 および 2.2 では正常に動作しますが、4.0.3 では次のエラーが発生します。
android.os.NetworkOnMainThreadException
at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1178)
at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:163)
at libcore.io.IoBridge.recvfrom(IoBridge.java:503)
at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488)
at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)
at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240)
at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:103)
at org.apache.http.impl.io.AbstractSessionInputBuffer.read(AbstractSessionInputBuffer.java:134)
at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:161)
at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:175)
at org.apache.http.impl.io.ChunkedInputStream.exhaustInputStream(ChunkedInputStream.java:289)
at org.apache.http.impl.io.ChunkedInputStream.close(ChunkedInputStream.java:262)
at org.apache.http.conn.BasicManagedEntity.streamClosed(BasicManagedEntity.java:179)
at org.apache.http.conn.EofSensorInputStream.checkClose(EofSensorInputStream.java:266)
at org.apache.http.conn.EofSensorInputStream.close(EofSensorInputStream.java:213)
at java.io.FilterInputStream.close(FilterInputStream.java:64)
at java.util.zip.InflaterInputStream.close(InflaterInputStream.java:256)
at java.util.zip.GZIPInputStream.close(GZIPInputStream.java:148)
at com.myapp.apper.contact.ContactService.a(SourceFile:390)
at com.myapp.apper.contact.ContactService.a(SourceFile:347)
at com.myapp.apper.contact.ContactService.a(SourceFile:41)
at com.myapp.apper.contact.g.a(SourceFile:322)
at com.myapp.apper.contact.q.a(SourceFile:58)
at com.myapp.apper.contact.q.onPostExecute(SourceFile:23)
at android.os.AsyncTask.finish(AsyncTask.java:602)
at android.os.AsyncTask.access$600(AsyncTask.java:156)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:615)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4974)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
私のすべてのネットワーク操作は AsyncTask にあり、スタックトレースから、エラーが原因で発生しているように見え、java.util.zip.GZIPInputStream.close
それはgzipIn.close();
.
GZIPInputStream がこのエラーの原因ですか? そうでない場合、エラーの原因は何ですか?