Titanium JIRA Archive
Appcelerator Community (AC)

[AC-651] Android: Ti.Map (any version) + Ti SDK 5.2.0.GA crashes

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2016-02-26T09:39:08.000+0000
Affected Version/sAppcelerator Studio 4.5.0
Fix Version/sn/a
ComponentsAppcelerator Modules
Labelsn/a
ReporterJoseph Sachs
AssigneeAminul Islam
Created2016-02-24T15:25:42.000+0000
Updated2016-02-26T09:39:08.000+0000

Description

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:
[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)

Comments

  1. Aminul Islam 2016-02-24

    Hi, Thanks for reaching out. Can you be more specific about your issue like provide a screenshot and reproducing test case showing this is a bug so that we can dig into and help you out.
  2. Sharif AbuDarda 2016-02-25

    Hello, I have tested Ti.Map with the below sample code. Map is working as expected.
       
       // Add in the module
       var MapModule = require('ti.map');
       var win = Ti.UI.createWindow({backgroundColor: 'white'});
       var map1 = MapModule.createView({
           userLocation: true,
           mapType: MapModule.NORMAL_TYPE,
           animate: true,
           region: {latitude: -33.87365, longitude: 151.20689, latitudeDelta: 0.1, longitudeDelta: 0.1 },
           height: '50%',
           top: 0,
           left: 0,
           width: '50%'
       });
       var map2 = MapModule.createView({
           userLocation: true,
           mapType: MapModule.TERRAIN_TYPE,
           animate: true,
           region: {latitude: -33.87365, longitude: 151.20689, latitudeDelta: 0.1, longitudeDelta: 0.1 },
           height: '50%',
           top: 0,
           right: 0,
           width: '50%'
       });
       var map3 = MapModule.createView({
           userLocation: true,
           mapType: MapModule.SATELLITE_TYPE,
           animate: true,
           region: {latitude: -33.87365, longitude: 151.20689, latitudeDelta: 0.1, longitudeDelta: 0.1 },
           height: '50%',
           bottom: 0,
       	left: 0,
           width: '50%'
       });
       var map4 = MapModule.createView({
           userLocation: true,
           mapType: MapModule.HYBRID_TYPE,
           animate: true,
           region: {latitude: -33.87365, longitude: 151.20689, latitudeDelta: 0.1, longitudeDelta: 0.1 },
           height: '50%',
           bottom: 0,
           right: 0,
           width: '50%',
           traffic: true
       });
       win.add(map1);
       win.add(map2);
       win.add(map3);
       win.add(map4);
       win.open();
       
    I have tested with SDK 5.2.0.GA. The issue is not reproducible from our end. Pleas provide your code or we will close the ticket. Thanks.
  3. Joseph Sachs 2016-02-25

    Was just about to provide a sample code. I will provide my sample shortly. Thanks
  4. Joseph Sachs 2016-02-25

    You can close this ticket, it was an issue with my custom ti.map version.

JSON Source