java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.maps.GoogleMap.moveCamera(com.google.android.gms.maps.CameraUpdate)' on a null obj ect reference

Appcelerator JIRA | Joseph Sachs | 9 months ago
  1. 0

    The Map I have, has polygon overlays, it centers to a location, event listeners do not trigger, and has other ti.map functions that do not get called. Running the App with Ti SDK 5.2.0.GA, The App compiles and runs, the Map loads, however does not center to the specified location, it simply defaults to the World view. Zooming in manually to the Polygons that have been placed, shows no polygons. It's as if the Map only loads, but nothing else can be done with it. Running the same code, with Ti SDK 5.1.2.GA, everything works normally and well, it's when we use Ti SDK 5.2.0.GA that causes the issues. Calling a method to center the map (for example with Ti.SDK 5.2.0.GA, as with other calls), crashes, here is the console when that happens: {code:java} [ERROR] TiApplication: (main) [703569,708944] Sending event: exception on thread: main msg:java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.maps.GoogleMap .moveCamera(com.google.android.gms.maps.CameraUpdate)' on a null object reference; Titanium 5.2.0,2016/02/20 08:05,384775e [ERROR] TiApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.maps.GoogleMap.moveCamera(com.google.android.gms.maps.CameraUpdate)' on a null obj ect reference [ERROR] TiApplication: at ti.map.TiUIMapView.moveCamera(TiUIMapView.java:395) [ERROR] TiApplication: at ti.map.TiUIMapView.updateCamera(TiUIMapView.java:388) [ERROR] TiApplication: at ti.map.TiUIMapView.propertyChanged(TiUIMapView.java:262) [ERROR] TiApplication: at org.appcelerator.kroll.KrollPropertyChange.fireEvent(KrollPropertyChange.java:21) [ERROR] TiApplication: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1093) [ERROR] TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:356) [ERROR] TiApplication: at ti.map.ViewProxy.handleMessage(ViewProxy.java:248) [ERROR] TiApplication: at android.os.Handler.dispatchMessage(Handler.java:98) [ERROR] TiApplication: at android.os.Looper.loop(Looper.java:135) [ERROR] TiApplication: at android.app.ActivityThread.main(ActivityThread.java:5221) [ERROR] TiApplication: at java.lang.reflect.Method.invoke(Native Method) [ERROR] TiApplication: at java.lang.reflect.Method.invoke(Method.java:372) [ERROR] TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899) [ERROR] TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694) {code}

    Appcelerator JIRA | 9 months ago | Joseph Sachs
    java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.maps.GoogleMap.moveCamera(com.google.android.gms.maps.CameraUpdate)' on a null obj ect reference
  2. 0

    The Map I have, has polygon overlays, it centers to a location, event listeners do not trigger, and has other ti.map functions that do not get called. Running the App with Ti SDK 5.2.0.GA, The App compiles and runs, the Map loads, however does not center to the specified location, it simply defaults to the World view. Zooming in manually to the Polygons that have been placed, shows no polygons. It's as if the Map only loads, but nothing else can be done with it. Running the same code, with Ti SDK 5.1.2.GA, everything works normally and well, it's when we use Ti SDK 5.2.0.GA that causes the issues. Calling a method to center the map (for example with Ti.SDK 5.2.0.GA, as with other calls), crashes, here is the console when that happens: {code:java} [ERROR] TiApplication: (main) [703569,708944] Sending event: exception on thread: main msg:java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.maps.GoogleMap .moveCamera(com.google.android.gms.maps.CameraUpdate)' on a null object reference; Titanium 5.2.0,2016/02/20 08:05,384775e [ERROR] TiApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.maps.GoogleMap.moveCamera(com.google.android.gms.maps.CameraUpdate)' on a null obj ect reference [ERROR] TiApplication: at ti.map.TiUIMapView.moveCamera(TiUIMapView.java:395) [ERROR] TiApplication: at ti.map.TiUIMapView.updateCamera(TiUIMapView.java:388) [ERROR] TiApplication: at ti.map.TiUIMapView.propertyChanged(TiUIMapView.java:262) [ERROR] TiApplication: at org.appcelerator.kroll.KrollPropertyChange.fireEvent(KrollPropertyChange.java:21) [ERROR] TiApplication: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1093) [ERROR] TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:356) [ERROR] TiApplication: at ti.map.ViewProxy.handleMessage(ViewProxy.java:248) [ERROR] TiApplication: at android.os.Handler.dispatchMessage(Handler.java:98) [ERROR] TiApplication: at android.os.Looper.loop(Looper.java:135) [ERROR] TiApplication: at android.app.ActivityThread.main(ActivityThread.java:5221) [ERROR] TiApplication: at java.lang.reflect.Method.invoke(Native Method) [ERROR] TiApplication: at java.lang.reflect.Method.invoke(Method.java:372) [ERROR] TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899) [ERROR] TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694) {code}

    Appcelerator JIRA | 9 months ago | Joseph Sachs
    java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.maps.GoogleMap.moveCamera(com.google.android.gms.maps.CameraUpdate)' on a null obj ect reference
  3. 0

    mapView.setAnnotations( Array<Modules.Map.Annotation> ) is crashing the application

    GitHub | 3 months ago | deckameron
    java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.maps.model.Marker com.google.android.gms.maps.GoogleMap.addMarker(com.google.android.gms.maps.model.MarkerOptions)' on a null object reference
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    CameraUpdateFactory.newLatLngZoom returns null

    Stack Overflow | 4 months ago | christian surban
    java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.maps.GoogleMap.moveCamera(com.google.android.gms.maps.CameraUpdate)' on a null object reference
  6. 0

    Java.lang.NullPointerException: moveCamera(cameraUpdate) on null object reference

    Stack Overflow | 6 days ago | umang dobariya
    java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.maps.GoogleMap.moveCamera(com.google.android.gms.maps.CameraUpdate)' on a null object reference

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'void com.google.android.gms.maps.GoogleMap.moveCamera(com.google.android.gms.maps.CameraUpdate)' on a null obj ect reference

      at ti.map.TiUIMapView.moveCamera()
    2. ti.map
      TiUIMapView.propertyChanged
      1. ti.map.TiUIMapView.moveCamera(TiUIMapView.java:395)
      2. ti.map.TiUIMapView.updateCamera(TiUIMapView.java:388)
      3. ti.map.TiUIMapView.propertyChanged(TiUIMapView.java:262)
      3 frames
    3. org.appcelerator.kroll
      KrollProxy.handleMessage
      1. org.appcelerator.kroll.KrollPropertyChange.fireEvent(KrollPropertyChange.java:21)
      2. org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1093)
      2 frames
    4. org.appcelerator.titanium
      TiViewProxy.handleMessage
      1. org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:356)
      1 frame
    5. ti.map
      ViewProxy.handleMessage
      1. ti.map.ViewProxy.handleMessage(ViewProxy.java:248)
      1 frame
    6. Android Platform
      ActivityThread.main
      1. android.os.Handler.dispatchMessage(Handler.java:98)
      2. android.os.Looper.loop(Looper.java:135)
      3. android.app.ActivityThread.main(ActivityThread.java:5221)
      3 frames
    7. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invoke(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:372)
      2 frames
    8. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
      2 frames