9

I have developed an Android client-server application. I have implemented Google map V2 in my application so that user can see his nearby places on map. But when I switch between map and normal activity, my application is suddenly crashing only on Android device with OS 5.0. I have used map fragment. Below is the crash report that I am getting:

android.system.ErrnoException: read failed: EAGAIN (Try again)
        at libcore.io.Posix.readBytes(Native Method)
        at libcore.io.Posix.read(Posix.java:147)
        at libcore.io.BlockGuardOs.read(BlockGuardOs.java:230)
        at android.system.Os.read(Os.java:364)
        at com.android.server.am.NativeCrashListener.consumeNativeCrashData(NativeCrashListener.java:240)
        at com.android.server.am.NativeCrashListener.run(NativeCrashListener.java:138)

Here is how I have instantiated my google map:

mapView = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.mapview)).getMap();

I googled a lot to find out the root cause of this crash, but I found nothing. Is that OS specific issue, as I am not getting anything from crash log telling where my application is crashing.
Please guide me to get ride of this crash.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
adi
  • 698
  • 8
  • 15
  • Did you tried to use getMapAsync instead getMap? – Selvin Sep 01 '15 at 07:44
  • Yes.. I tried using getMapAsync, but the issue still persists. – adi Sep 01 '15 at 08:22
  • Ever find a solution to this? – user1064249 Aug 25 '16 at 22:13
  • 2
    I found the issue I was having! I was using GSON to serialize the Location object, which has no default constructor so it can't recreate the class and crashes (found this answer in another SO thread, can't remember where though sorry).. to solve this I encapsulated my Location object inside an object I created with a constructor and BOOM, no more random crashes! – user1064249 Aug 31 '16 at 17:23
  • @user1064249 I guess this is the thread you're talking about: https://stackoverflow.com/a/37279407/1101730 – Micer Jun 29 '17 at 09:28

0 Answers0