Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetworkOnMainThreadException crashing app #22

Closed
ViWu opened this issue Jun 23, 2017 · 2 comments
Closed

NetworkOnMainThreadException crashing app #22

ViWu opened this issue Jun 23, 2017 · 2 comments
Assignees
Labels

Comments

@ViWu
Copy link

ViWu commented Jun 23, 2017

When I run and test the app on my emulator, the app crashes when I try to type in the search bar on the main page (destinations). Sometimes it also randomly crashes when I click on some of options in the navigation drawer. Not sure if it's because of my emulator or if it's a bug. Anyways, here is the log:

06-22 17:22:08.291 18492-18492/tie.hackathon.travelguide E/AndroidRuntime: FATAL EXCEPTION: main
Process: tie.hackathon.travelguide, PID: 18492
android.os.NetworkOnMainThreadException
at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1273)
at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:249)
at libcore.io.IoBridge.recvfrom(IoBridge.java:549)
at java.net.PlainSocketImpl.read(PlainSocketImpl.java:481)
at java.net.PlainSocketImpl.-wrap0(PlainSocketImpl.java)
at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:237)
at okio.Okio$2.read(Okio.java:138)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:238)
at okio.RealBufferedSource.indexOf(RealBufferedSource.java:325)
at okio.RealBufferedSource.indexOf(RealBufferedSource.java:314)
at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:210)
at okhttp3.internal.http.Http1xStream$ChunkedSource.readChunkSize(Http1xStream.java:434)
at okhttp3.internal.http.Http1xStream$ChunkedSource.read(Http1xStream.java:418)
at okhttp3.internal.Util.skipAll(Util.java:176)
at okhttp3.internal.Util.discard(Util.java:158)
at okhttp3.internal.http.Http1xStream$ChunkedSource.close(Http1xStream.java:455)
at okio.RealBufferedSource.close(RealBufferedSource.java:434)
at okio.RealBufferedSource.close(RealBufferedSource.java:434)
at okio.InflaterSource.close(InflaterSource.java:126)
at okio.GzipSource.close(GzipSource.java:182)
at okio.RealBufferedSource.close(RealBufferedSource.java:434)
at okhttp3.internal.Util.closeQuietly(Util.java:88)
at okhttp3.ResponseBody.bytes(ResponseBody.java:130)
at okhttp3.ResponseBody.string(ResponseBody.java:154)
at tie.hackathon.travelguide.CityFragment$1.lambda$-tie_hackathon_travelguide_CityFragment$1_lambda$6(CityFragment.java:126)
at tie.hackathon.travelguide.-$Lambda$19.$m$0(Unknown Source)
at tie.hackathon.travelguide.-$Lambda$19.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

@Swati4star Swati4star self-assigned this Oct 14, 2017
@Swati4star
Copy link
Member

Are you still facing this error? I can't reproduce this bug.

@Swati4star Swati4star added the bug label Oct 16, 2017
@Swati4star
Copy link
Member

Closing it for now. Not able to reproduce it. Feel free to open it again, in case you face the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants