-2

I am facing the crash issue in our app in everywhere I am not finding any solutions can you suggest me how to fix the crash issue, it randomly crashes in the whole app.

Terminating app due to uncaught exception 'NSGenericException', reason: '* Collection was mutated while being enumerated.' * First throw call stack: (0x18ff7efe0 0x18e9e0538 0x18ff7ea30 0x19639c4d4 0x19639c738 0x19639c8c8 0x1004511e0 0x100450b10 0x10063aee8 0x1006336a8 0x1005b0b04 0x1005929a0 0x1005ed8b4 0x1017284fc 0x1931905dc 0x19319048c 0x1901ebb9c 0x18ff15960 0x18ff2dae4 0x18ff2d284 0x18ff2ad98 0x18fe5ada4 0x1918c4074 0x196115058 0x1001886dc 0x18ee6959c) libc++abi.dylib: terminating with uncaught exception of type NSException

navView=[[UIView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width,70)]; 
[self.view addSubview:navView]; 
[mapView clear]; 
mapView = [GMSMapView mapWithFrame:CGRectMake(0,70, self.view.frame.size.width,-70) camera:camera];
 mapView.delegate = self; 
NSBundle *mainBundle = [NSBundle mainBundle]; 
NSURL *styleUrl = [mainBundle URLForResource:@"customMapsJson" withExtension:@"json"]; 
NSError *error; GMSMapStyle *style = [GMSMapStyle styleWithContentsOfFileURL:styleUrl error:&error];
 [self.view addSubview:mapView];
Imad Ali
  • 3,261
  • 1
  • 25
  • 33
Mss iOS
  • 157
  • 9
  • please add some code – Matloob Hasnain Jun 21 '17 at 07:10
  • navView=[[UIView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width,70)]; [self.view addSubview:navView]; [mapView clear]; mapView = [GMSMapView mapWithFrame:CGRectMake(0,70, self.view.frame.size.width,-70) camera:camera]; mapView.delegate = self; NSBundle *mainBundle = [NSBundle mainBundle]; NSURL *styleUrl = [mainBundle URLForResource:@"customMapsJson" withExtension:@"json"]; NSError *error; GMSMapStyle *style = [GMSMapStyle styleWithContentsOfFileURL:styleUrl error:&error]; [self.view addSubview:mapView]; – Mss iOS Jun 21 '17 at 07:14
  • @matloob its happening whole app i am not using any extra code. – Mss iOS Jun 21 '17 at 07:14
  • then it would be difficult to tell whats happening actually – Matloob Hasnain Jun 21 '17 at 07:19
  • 2
    Please see http://www.raywenderlich.com/10209/my-app-crashed-now-what-part-1 to learn how to debug a crash. – rmaddy Jun 21 '17 at 07:21
  • And please do not post code in comments. [Edit] your question. – rmaddy Jun 21 '17 at 07:22
  • The error said you changed the Collection when it on enumerated. you need to check all enumerate (such as for-loop) in whole app. – ovo Jun 21 '17 at 07:23
  • @MssiOS can you please edit your question & provide some code. One more option is add exception breakpoint https://stackoverflow.com/questions/17802662/exception-breakpoint-in-xcode As a beginner be clear what you want to ask. Post some of your work for better response. Otherwise negative marking, rework :( – Gagan_iOS Jun 21 '17 at 07:29
  • insert overall code ... – Sommm Jun 21 '17 at 07:30
  • @Gagan our app is crashed randomly any where but i am getting where my app is crashed. – Mss iOS Jun 21 '17 at 09:10
  • @MssiOS ok that's great. May i know the reason & how u find that – Gagan_iOS Jun 21 '17 at 09:34
  • can you post your delegate methods of your `GMSMapView` i think that crash your app. – vp2698 Jun 21 '17 at 09:36
  • @Gagan_iOS i am finding crash every where i am facing same issue – Mss iOS Jun 21 '17 at 09:51
  • @MssiOS can you share your code. If possible Via GIT or dropbox etc – Gagan_iOS Jun 21 '17 at 11:03
  • @Gagan here is the my code https://www.dropbox.com/s/2toc01q25au84u7/ListViewController_old.m?dl=0 – Mss iOS Jun 22 '17 at 11:03
  • @MssiOS Ohh you have added the only .m file. Please provide the complete set for debugging. – Gagan_iOS Jun 22 '17 at 11:58
  • @Gagan_iOS means you need complete code. – Mss iOS Jun 22 '17 at 12:00

1 Answers1

-1

To know about random crash, you must have to implement Firebase Crash Analytics. You can check you crash issues with all details over Firebase console.

Please refer below link:-

https://firebase.google.com/docs/crash/

Neha Gupta
  • 539
  • 3
  • 13