[MOD-2417] Android: Map Animation Crash due to missing guards
GitHub Issue | n/a |
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-05-03T07:46:29.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Ti.Map Android 4.2.0 |
Components | Map |
Labels | andoid, animate, crash, map |
Reporter | josh.mocek |
Assignee | Gary Mathews |
Created | 2018-02-20T17:20:05.000+0000 |
Updated | 2018-08-06T17:49:10.000+0000 |
Description
exception on thread: main msg:java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.maps.GoogleMap.animateCamera(com.google.android.gms.maps.CameraUpdate)' on a null object reference; Titanium 7.0.2,2018/02/09 10:59,undefined
You will need the 'Ti.Map' module and to add the API key to tiapp.xml in the project. The app crashes on android when switching between the home tab and the 2nd tab repeatedly on android.
Open up project. Accept location services. Tab between Home and 2nd page quickly. Once that is fixed uncomment the other longitudes and latitudes in 'pageOne' and test again. Once that works, uncomment the $.map stuff in content.js and the $.map id in the XML for content.xml. Then make sure all of that doesn't crash the app when switching between tabs quickly.
With this same app. If you turn off location services on the tablet/phone you get a different error.
[ERROR] : TiApplication: (main) [63672,63838] Sending event: exception on thread: main msg:java.lang.NullPointerException: Attempt to invoke virtual method 'org.appcelerator.kroll.KrollDict org.appcelerator.kroll.KrollProxy.getProperties()' on a null object reference; Titanium 7.0.2,2018/02/09 10:59,undefined
[ERROR] : TiApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'org.appcelerator.kroll.KrollDict org.appcelerator.kroll.KrollProxy.getProperties()' on a null object reference
[ERROR] : TiApplication: at ti.map.TiUIMapView.onMapReady(TiUIMapView.java:170)
Attachments
Hello [~josh.mocek], Tested the issue and unable to reproduce the issue using SDK 7.0.2.GA on Android 7 device. The app is working as expected without any crash. *Test Envionemnts:*
*Test steps:* 1.Open studio. 2.Import the app and run 3.Tab between Home and 2nd page quickly. Once that is fixed uncomment the other longitudes and latitudes in 'pageOne' and test again. Once that works, uncomment the $.map stuff in content.js and the $.map id in the XML for content.xml. There is no crash when switching between tabs quickly. *Test Output:* [Screenshot](https://s17.postimg.org/bhnh5dr5r/Screenshot_20180222-144910.png) *Console logs:*
Please share your environment details. Thanks
Galaxy tab e running 7.1.1 samsung prime express oneplus 3t android 8 Did you make sure to edit the API key in tiapp.xml? I was switching between them pretty quickly too
we have this problem in a project and this code replicates it for me
Here is a video of the code I submitted with it crashing the app. https://youtu.be/d8wILNdaUZU
master: https://github.com/appcelerator-modules/ti.map/pull/223
Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.