30

I've just recently started to receive a nullpointerexception from Android google maps and I can't figure out what causes it. Currently it has only been reported on a HTC Desire 500 (z4u) device running android 4.1. Any suggestions or ideas would be greatly appreciated.

Edit:

So I've gotten my hands on a device that gives the error (HTC Desire, Android 4.1.2, HTC SDK API 5.26). As I suspected from trace it is purely internal error. Following didn't help:

  • Rebooting
  • reinstall
  • Newest version of google play services
  • Update app to use play services 8.3.0

The stack trace is seen bellow:

java.lang.RuntimeException: Unable to resume activity {dk.mobikom.android/dk.mobikom.android.activities.ContactDetailActivity}: java.lang.NullPointerException
    at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3036)
    at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3077)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2373)
    at android.app.ActivityThread.access$600(ActivityThread.java:151)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1330)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:155)
    at android.app.ActivityThread.main(ActivityThread.java:5536)
    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:1074)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:841)
    at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
    at com.google.maps.api.android.lib6.gmm6.m.ad.a(Unknown Source)
    at com.google.maps.api.android.lib6.gmm6.c.h.a(Unknown Source)
    at com.google.maps.api.android.lib6.gmm6.c.y.a(Unknown Source)
    at com.google.maps.api.android.lib6.e.bd.a(Unknown Source)
    at com.google.maps.api.android.lib6.e.ev.a(Unknown Source)
    at com.google.maps.api.android.lib6.e.z.a(Unknown Source)
    at com.google.maps.api.android.lib6.e.y.a(Unknown Source)
    at com.google.android.gms.maps.internal.u.onTransact(SourceFile:107)
    at android.os.Binder.transact(Binder.java:326)
    at com.google.android.gms.maps.internal.IMapFragmentDelegate$zza$zza.onCreateView(Unknown Source)
    at com.google.android.gms.maps.SupportMapFragment$zza.onCreateView(Unknown Source)
    at com.google.android.gms.dynamic.zza$4.zzb(Unknown Source)
    at com.google.android.gms.dynamic.zza.zza(Unknown Source)
    at com.google.android.gms.dynamic.zza.onCreateView(Unknown Source)
    at com.google.android.gms.maps.SupportMapFragment.onCreateView(Unknown Source)
    at android.support.v4.app.Fragment.performCreateView(Fragment.java:1962)
    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1026)
    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1207)
    at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738)
    at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1572)
    at android.support.v4.app.Fragment.performResume(Fragment.java:2012)
    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)
    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1207)
    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1189)
    at android.support.v4.app.FragmentManagerImpl.dispatchResume(FragmentManager.java:2011)
    at android.support.v4.app.FragmentController.dispatchResume(FragmentController.java:187)
    at android.support.v4.app.FragmentActivity.onResumeFragments(FragmentActivity.java:426)
    at android.support.v4.app.FragmentActivity.onPostResume(FragmentActivity.java:415)
    at android.support.v7.app.AppCompatActivity.onPostResume(AppCompatActivity.java:141)
    at android.app.Activity.performResume(Activity.java:5161)
    at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3019)
    ... 12 more
Warpzit
  • 27,966
  • 19
  • 103
  • 155
  • Looks like Google Maps issue with latest version of Google maps (I haven't seen this issue on v7.8). We are using Google Maps v8.3 , what version are you using? – Yuraj Dec 11 '15 at 08:55
  • any solution how to resolve this kind of problem sir? – Ram Dec 12 '15 at 06:52
  • @Ram No not yet. Investigating if client update of google play services could solve problem... – Warpzit Dec 12 '15 at 07:32
  • Im also getting this on HTC Desire X 4.1.1 – George Dec 17 '15 at 20:55
  • https://code.google.com/p/gmaps-api-issues/issues/detail?id=9021&q=NullPointerException&sort=-id&colspec=ID%20Type%20Status%20Introduced%20Fixed%20Summary%20Stars%20ApiType%20Internal – Yuraj Dec 18 '15 at 11:08
  • @Yuraj Thanks, I'll encourage everyone to go and star the issue. – Warpzit Dec 20 '15 at 20:14
  • Same issue with Htc Desire VC 4.0.4, developers are still counting on Google to role out a fix. – Muhammad Babar Mar 12 '16 at 08:25

4 Answers4

22

So as suspected this is an issue at googles side. They've verified the bug and are working on a fix (2015-12-21), see googles bug tracker for up to date info about the issue.

Edit:

So I got to test Georges SD info and yes inserting a SD card solved the problem. So from this we can conclude phones that don't have an internal fake-external storage (like most phones now a days) will crash from this bug... So this might be a workaround for those who work in the enterprise segment but for those working in the consumer segment this will not really help a lot...

Edit Jan 20, 2016

A developer from the Google team has announced the fix has been made and it will be rolled out with the next major release of Google play, but they haven't set a timeline for that yet.

Edit Jun 02, 2016

A developer from the Google team has announced it is confirmed fixed:

Sorry this took so long to fix, but here is the bug fix you've been waiting for!

We can confirm that this issue is now fixed in version 9.0.83 of Google Play Services, released in May 2016.

Warpzit
  • 27,966
  • 19
  • 103
  • 155
  • same problem here ! please notice everybody when this be fixed – JoeCoolman Dec 22 '15 at 07:55
  • @JoeCoolman the easiest thing is to go star the issue at Google then you'll get an update automatically. I'll update this post but I don't think you'll get a notification from that. – Warpzit Dec 22 '15 at 19:35
  • 1
    Ok @Warpzit, I see this problem appeared in December 12 and until today it has not been fixed by Google programmers, wow :O – JoeCoolman Dec 22 '15 at 19:47
  • In my case I got also android.view.InflateException and after that, somewhere really deep, I got yours NullPointer. Got it 3 hours solving and trying every dump solution guys from other 10 threads on stackoverflow suggested. Thank you so much. – arenaq Jan 11 '16 at 17:49
  • Don't know why its taking so long! Its simple fix, just fallback to internal storage in case of no sdcard! – Muhammad Babar Mar 12 '16 at 08:27
  • Removing from Google Play Services 8.3 helped me to avoid this crash (tested under 4.0.3) – xiaomi Apr 13 '16 at 07:17
5

Ok found the solution in my case 5 hours later.

Without touching the device (HTC Desire X 4.1.1) all I did is install an SD card and the error magically disappeared. Install SD card, reboot (updated Google photos in the process by I don't think it has anything to do with the issue).

For crying out loud !

George
  • 1,224
  • 12
  • 21
1

Adding size of SD card on my Emulator worked for me.

Emulator Android

Alessandro Mattiuzzi
  • 2,309
  • 2
  • 18
  • 24
-2

Have u tried these

<!-- EXTERNAL_STORAGE permissions are optional for Android 6.0 onwards. -->
    <uses-permission
        android:name="android.permission.WRITE_EXTERNAL_STORAGE"
        android:maxSdkVersion="22" />
    <uses-permission
        android:name="android.permission.READ_EXTERNAL_STORAGE"
        android:maxSdkVersion="22" />

This may solve the issue.

shijin
  • 2,998
  • 1
  • 24
  • 30
  • Since the issue happens internally with Google maps the suggestion is pretty silly. Also Google acknowledge that there is a bug. And third yes the app has these permissions already. – Warpzit Dec 26 '15 at 07:37