Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15903] Android: Map will not display in 2.3.3 and higher (Google Maps Android API v2 module)

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2015-03-25T02:01:49.000+0000
Affected Version/sn/a
Fix Version/sRelease 4.1.0
ComponentsAndroid
Labelsandroid, mapsv2, module, triage
ReporterEric Wieber
AssigneeAshraf Abu
Created2013-12-05T19:18:22.000+0000
Updated2017-03-21T21:43:19.000+0000

Description

Issue:

Maps will not display on an Android device running 2.3.3+ and Google Maps Android API v2 module 2.1.3.

Steps to Reproduce:

1. Create a project from the code downloaded here: https://github.com/prakash-anubavam/V2MapTestApp 2. Run the app on an Android device with 2.3.3+ (I tested with 2.3.6) 3. Notice that the map will not display

Additional notes:

The user says that on Android devices 2.3.3- that the app will crash. I tested this app on a Galaxy S2, while the user was on an HTC Explorer (2.3.5) and Galaxy Y -GT-S5360 (2.3.6).

Comments

  1. Hieu Pham 2013-12-05

    I looked at your project, and it looks like your tiapp.xml is missing the module link. You need to put this in your tiapp.xml: ti.map If this is still happening, please attach a log.
  2. Eric Wieber 2013-12-05

    On my local machine, the project has the module added to the project and has the lines you provided in the tiapp.xml. I still do not see the map displaying properly.
  3. Eric Wieber 2013-12-05

    This issue may actually come from the API key that the user placed in the tiapp.xml; it could be for the wrong environment. We are asking them to double check their key.
  4. Ingo Muschenetz 2013-12-07

    Hi Eric--please reopen this if it continues to be a problem.
  5. Lokesh Choudhary 2013-12-07

    Tested using both my debug & release key in my app with the app.js from https://github.com/prakash-anubavam/V2MapTestApp & could not reproduce the issue. Tested on the following devices & the maps seem to appear fine: 1.)Nexus 5 -- android 4.4 2.)Samsung Galaxy S4 -- android 4.2.2 3.)Samsung Galaxy S3 -- android 4.0.4 4.)Sony Experia -- android 2.3.7 Environment: Appcel Studio : 3.2.0.201312052211 Ti SDK : 3.2.0.v20131206182444 & 3.1.3.GA Mac OSX : 10.8.5 Alloy : 1.3.0-beta CLI - 3.2.0-beta
  6. Lokesh Choudhary 2014-09-09

    Reopening as I am seeing this issue. Can see the issue on 3 devices as of now: 1. Galaxy Nexus : android 4.2.2 2. Samsung Galaxy S2 - android 2.3.6 3. sony xperia - android 2.3.7 works fine on Nexus 5 - android 4.4.4 checking it on more devices will update accordingly. I tried with sdk 3.3.0.GA see the issue there too. Environment: Appc Studio : 3.4.0.201409032106 Ti SDK : 3.4.0.v20140907150914 Mac OSX : 10.9.4 Alloy : 1.5.0-beta CLI - 3.4.0-beta Code Processor: 1.1.1 Map module : 2.1.4
  7. Joe Falcone 2014-09-24

    Is this issue related to TIMOB-17085?
  8. Ingo Muschenetz 2015-03-20

    [~msamah], can you take a look when you get in?
  9. Ashraf Abu 2015-03-23

    [~ingo] Will do.
  10. Ashraf Abu 2015-03-23

    [~lchoudhary] On the devices that fail, what does the log say? Does it say something very similar to:-
        [WARN] :   GooglePlayServicesUtil: Google Play services out of date.  Requires 6171000 but found 5089036
        
  11. Ashraf Abu 2015-03-23

    [~lchoudhary] If you can, could you share any log files with the warning/errors? I'm using an Android 4.4.4 Nexus 4 and it seems to not work cause it has an outdated Google Play service. I'm suspecting that this could be it. Can you try running this code? If it gives the error code 2, it means that the device needs to upgrade the Google Play (or OS) in order to use this version of Ti.Map.
        // Add in the module
        var MapModule = require('ti.map');
        
        var win = Ti.UI.createWindow({
        	backgroundColor : 'white',
        	navBarHidden : true,
        	exitOnClose : true
        });
        var googlePlayServiceCode = MapModule.isGooglePlayServicesAvailable();
        
        if (googlePlayServiceCode == MapModule.SUCCESS) {
        
        	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 : '70%',
        		top : 50,
        		left : 10,
        		right : 10
        	});
        
        	win.add(map1);
        } else {
        	switch(googlePlayServiceCode) {
        	case MapModule.SERVICE_VERSION_UPDATE_REQUIRED:
        		alert("Please upgrade your Google Play Service before using this app. Error code: " + googlePlayServiceCode);
        		break;
        	default:
        		alert("An error occured using the Google Play Service. Error code: " + googlePlayServiceCode);
        	}
        
        }
        win.open(); 
        
        
  12. Lokesh Choudhary 2015-03-24

    [~msamah]I ran your code on the devices I mentioned which were had this issue & below are my findings using sdk 4.0.0.v20150323131014: 1. Galaxy Nexus : android 4.2.2 - Got error code 2 as the google play services needs updating. 2. Samsung Galaxy S2 - android 2.3.6 - Map showed without any issues. 3. Sony xperia - android 2.3.7 - Got error code 2 as the google play services needs updating. I could not run the tests with 3.4.0SDK & 3.3.0 SDK due to Java 1.8.0 incompatibility. I don't remember exactly what was the reason for failure before as the comment is like 6 months old. Environment: Appc Studio : 4.0.0.201503232213 Ti SDK : 4.0.0.v20150323131014 CLI : 4.0.0-alpha Alloy : 1.6.0-alpha MAC Yosemite : 10.10.2 Appc npm : 0.3.34 Appc CLI : 0.2.187 MAP module: 2.2.3
  13. Ashraf Abu 2015-03-25

    [~lchoudhary] If it's an error 2 code and not really any other issues, it's working correctly. The device just needs to upgrade/update it's google play service. If there's no other outstanding issues, I'll resolve this ticket.
  14. Lee Morris 2017-03-21

    Closing ticket as the issue cannot be reproduced and due to the above comments.

JSON Source