Uploaded image for project: 'Appcelerator Modules'
  1. Appcelerator Modules
  2. MOD-2337

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: None
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 6.1.0
    • Component/s: None
    • Environment:
    • Story Points:
      3
    • Sprint:
      2017 Sprint 11 SDK

      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:

      1. Create a Titanium project
      2. 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
      3. Download the map module from https://github.com/appcelerator-modules/ti.map
      4. 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
      5. Go to the dist folder which will be created and then extract the module and add it to your existing modules
      6. Add the ti.map module in to your project
      7. Run the application
      8. Go to annotation test
      9. press the RM ALL button
      10. You should see all pins being removed
      11. Press the ADD ALL button
      12. 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

        1. app.js
          52 kB
          Samir Mohammed
        2. CurvyRoutes.js
          3 kB
          Samir Mohammed

          Activity

            People

            • Assignee:
              ybanev Yordan Banev
              Reporter:
              smohammed Samir Mohammed
              Reviewer:
              Yordan Banev
            • Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Git Source Code