Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2107] Map loading in IOS 6 crashing app with error 'Invalid Region'

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2014-01-06T19:00:46.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterArvind Joshi
AssigneeShak Hossain
Created2013-12-04T13:11:01.000+0000
Updated2016-03-08T07:41:04.000+0000

Description

Steps to Reproduce

The application was already working with IOS 6 and Titanium SDK 2.1.3 while we have update the application for Titanium SDK 3.1.3 and IOS 7. The application is working ok with IOS 7 while getting crash with IOS 6. These instructions are throwing exception: mapview.set(region); animate:true, regionFit:true

Actual Result

[ERROR] : The application has crashed with an uncaught exception 'NSInvalidArgumentException'. [ERROR] : Reason: [ERROR] : Invalid Region [ERROR] : Stack trace: [ERROR] : 0 CoreFoundation 0x038d7012 __exceptionPreprocess + 178 [ERROR] : 1 libobjc.A.dylib 0x03398e7e objc_exception_throw + 44 [ERROR] : 2 CoreFoundation 0x0395ffb1 -[NSException raise] + 17 [ERROR] : 3 MapKit 0x023a50cd -[MKMapView setRegion:animated:] + 709 [ERROR] : 4 Derby Bus 0x0011bff7 -[TiMapView render] + 1383 [ERROR] : 5 Derby Bus 0x0011c8f6 -[TiMapView frameSizeChanged:bounds:] + 294 [ERROR] : 6 Derby Bus 0x000960b6 -[TiUIView checkBounds] + 806 [ERROR] : 7 Derby Bus 0x000961b7 -[TiUIView setBounds:] + 119 [ERROR] : 8 Derby Bus 0x0011c7b5 -[TiMapView setBounds:] + 453 [ERROR] : 9 Derby Bus 0x00078d80 -[TiViewProxy relayout] + 2016 [ERROR] : 10 Derby Bus 0x0007c990 -[TiViewProxy layoutChild:optimize:withMeasuredBounds:] + 1472 [ERROR] : 11 Derby Bus 0x0007cc70 -[TiViewProxy layoutChildren:] + 656 [ERROR] : 12 Derby Bus 0x00077886 -[TiViewProxy refreshView:] + 710 [ERROR] : 13 Derby Bus 0x000790d3 -[TiViewProxy layoutChildrenIfNeeded] + 259 [ERROR] : 14 Derby Bus 0x001fd017 +[TiLayoutQueue layoutProxy:] + 87 [ERROR] : 15 Derby Bus 0x001fcde2 performLayoutRefresh + 530 [ERROR] : 16 CoreFoundation 0x03896376 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22 [ERROR] : 17 CoreFoundation 0x03895e06 __CFRunLoopDoTimer + 534 [ERROR] : 18 CoreFoundation 0x0387da82 __CFRunLoopRun + 1810 [ERROR] : 19 CoreFoundation 0x0387cf44 CFRunLoopRunSpecific + 276 [ERROR] : 20 CoreFoundation 0x0387ce1b CFRunLoopRunInMode + 123 [ERROR] : 21 GraphicsServices 0x0365e7e3 GSEventRunModal + 88 [ERROR] : 22 GraphicsServices 0x0365e668 GSEventRun + 104 [ERROR] : 23 UIKit 0x011b565c UIApplicationMain + 1211 [ERROR] : 24 Derby Bus 0x000042c8 main + 456 [ERROR] : 25 Derby Bus 0x00002c15 start + 53 [ERROR] : 26 ??? 0x00000001 0x0 + 1 -- End simulator log --------------------------------------------------------- [ERROR] : An error occurred running the iOS Simulator [ERROR] : [DEBUG] using retina iphone retina tall ios 7 [ERROR] : [ERROR] : Project failed to build after 2m 14s 113ms

Expected Result

Should work in IOS 6 as working in IOS 7

Attachments

FileDateSize
.log2013-12-04T13:12:36.000+00009908799
diagnostic1800571363625380034.log2013-12-04T13:12:45.000+00007568

Comments

  1. Eric Wieber 2013-12-06

    Hello Arvind, I have been unable to reproduce your issue. I tested the sample app Kitchen Sink, as it has a map view in it, on iOS 6.1.2 and 7.0 devices. Both were able to properly display the map. I noticed that in the log that you posted that, at the bottom, it says: "using retina iphone retina tall ios 7". Is your app crashing on iOS 6.X or 7.X? Have you tried opening the map to another region or point? Also, could you please attach some sample code or test cases so that I can see the issue that you are seeing?
  2. Arvind Joshi 2013-12-07

    Hi, The issues are coming for the following statements: mapview.set(region); animate:true, regionFit:true I have changes instructions as: animate: false setTimeout(function(){mapview.set(region);},300) This is stopped the crashing and showing error Invalid Region. I think this should be resolve in next versions. Thanks,
  3. Mostafizur Rahman 2014-01-03

    Hello, I tested this issue with the test code below. I can't reproduce this issue in Ti SDK 3.1.3GA and iOS 7.0.0. Please check my code and let me know if you have this problem. If you have different test case that reproduces the issue, please post it here. We will re-test this.

    Test Environment:

    Mac OS X 10.8.5 IOS 7.0.0 Titanium SDK: 3.1.3 Titanium CLI: 3.1.2

    Test Code

       
        
       var win = Ti.UI.createWindow();
       
       var mountainView = Titanium.Map.createAnnotation({
           latitude:37.390749,
           longitude:-122.081651,
           title:"Appcelerator Headquarters",
           subtitle:'Mountain View, CA',
           pincolor:Titanium.Map.ANNOTATION_RED,
           animate:true,
           leftButton: '/images/appcelerator_small.png',
           myid:1 ,// Custom property to uniquely identify this annotation.
           rightButton: '/images/appcelerator_small.png',
       });
       
       var mapview = Titanium.Map.createView({
           mapType: Titanium.Map.STANDARD_TYPE,
           region: {latitude:37.390749, longitude:-122.081651,
                   latitudeDelta:0.04, longitudeDelta:0.04},
           animate:true,
           regionFit:true,
           userLocation:true,
           annotations:[mountainView]
       });
       
       win.add(mapview);
        
       
       win.open();
        
       
       
    Thanks
  4. Eric Wieber 2014-01-06

    Glad you were able to stop the crashes. This info has been passed to engineering and should be fixed. Please let us know if you experience the issue again. Thank you!
  5. Arvind Joshi 2014-01-07

    Thanks Team, I do not experience the issues again after update the code as: animate: false setTimeout(function(){mapview.set(region);},300) Thanks for the help.

JSON Source