Titanium JIRA Archive
Appcelerator Modules (MOD)

[MOD-2337] (Android) When removing a pin from the map and then add it back, the application throws an error

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2017-05-25T19:07:15.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.1.0
Componentsn/a
Labelsqe-6.1.0, regression
ReporterSamir Mohammed
AssigneeYordan Banev
Created2017-05-18T23:24:23.000+0000
Updated2018-08-06T17:49:37.000+0000

Description

When adding pins on to a map using the ti.map module after they have been removed the application throws an error. *Test Steps:*

Create a Titanium project

Copy the the following files in the attachments section from this ticket in to the project (app.js and CurvyRoutes.JS) under the resources directory

Download the map module from https://github.com/appcelerator-modules/ti.map

Build the android module from the repo you just downloaded (This can be done by going in to ti.map/android from the CLI and running the following command appc run --build-only

Go to the dist folder which will be created and then extract the module and add it to your existing modules

Add the ti.map module in to your project

Run the application

Go to annotation test

press the RM ALL button

You should see all pins being removed

Press the ADD ALL button

Application will crash

*Expected result* Pins should be added without any issues. *Actual result* Application crashes and the following error is shown:
[ERROR] :  TiExceptionHandler: (main) [4126,11648] ----- Titanium Javascript Runtime Error -----
[ERROR] :  TiExceptionHandler: (main) [0,11648] - In /app.js:416,6
[ERROR] :  TiExceptionHandler: (main) [0,11648] - Message: Uncaught Attempt to invoke virtual method 'com.google.android.gms.maps.model.MarkerOptions com.google.android.gms.maps.model.MarkerOptions.position(com.google.android.gms.maps.model.LatLng)' on a null object reference
[ERROR] :  TiExceptionHandler: (main) [0,11648] - Source: 	map.addAnnotations([anno, anno2, anno3, anno4]);
[ERROR] :  V8Exception: Exception occurred at /app.js:416: Uncaught Attempt to invoke virtual method 'com.google.android.gms.maps.model.MarkerOptions com.google.android.gms.maps.model.MarkerOptions.position(com.google.android.gms.maps.model.LatLng)' on a null object reference
[ERROR] :  V8Exception: Attempt to invoke virtual method 'com.google.android.gms.maps.model.MarkerOptions com.google.android.gms.maps.model.MarkerOptions.position(com.google.android.gms.maps.model.LatLng)' on a null object reference

Attachments

FileDateSize
app.js2017-05-18T22:54:28.000+000052816
CurvyRoutes.js2017-05-18T22:54:30.000+00003382

Comments

  1. Gary Mathews 2017-05-21

    ti.map: https://github.com/appcelerator-modules/ti.map/pull/202
  2. Samir Mohammed 2017-05-25

    FR Passed, test and other information can be found at: https://github.com/appcelerator-modules/ti.map/pull/202
  3. Eric Merriman 2018-08-06

    Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.

JSON Source