Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Crash using Mabbox iOS SDK(Annotation view) #9065

Closed
macro-shen opened this issue May 22, 2017 · 2 comments
Closed

Crash using Mabbox iOS SDK(Annotation view) #9065

macro-shen opened this issue May 22, 2017 · 2 comments
Labels
annotations Annotations on iOS and macOS or markers on Android crash iOS Mapbox Maps SDK for iOS

Comments

@macro-shen
Copy link

macro-shen commented May 22, 2017

a issue from a iOS developer:

Platform: iOS
Mapbox SDK version: 3.5.0

Steps to trigger behavior

find a crash in Mabbox, and it often happens. The crash log is like this:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Annotation view's annotation property should not be nil.'

Add a gesture to the map, but don't know the problem.
And there is an online log for this crash: http://crashes.to/s/468bb46a57c

For this bug, I have a problem, I code like this, the problem is: if the annotation is nil, there cannot be a Annotation view, so I don't know how could this bug happen.

- (MGLAnnotationView *) mapView:(MGLMapView *)mapView viewForAnnotation:(id<MGLAnnotation>)annotation {
    if( ![annotation isKindOfClass:[CDRunGroundAnnotationEntity class]] ) {
        return nil;
    }
}
@macro-shen macro-shen changed the title Crash in Mabbox iOS SDK from Crash using Mabbox iOS SDK from Codoon(Annotation view) May 22, 2017
@macro-shen macro-shen changed the title Crash using Mabbox iOS SDK from Codoon(Annotation view) Crash using Mabbox iOS SDK(Annotation view) May 22, 2017
@Guardiola31337 Guardiola31337 added annotations Annotations on iOS and macOS or markers on Android crash iOS Mapbox Maps SDK for iOS labels May 22, 2017
@fabian-guerra fabian-guerra added this to the ios-v3.6.0 milestone May 22, 2017
@boundsj
Copy link
Contributor

boundsj commented May 22, 2017

Hi @macro-shen this is most likely a duplicate of the issue described in #8754 and #8755. That issue was fixed in #9025 and the fix will be in the our iOS map SDK v3.6.0 beta 1 release this week.

I'm going to close this as fixed but please feel free to reopen if the issue still occurs when testing with the the 3.6.0 beta 1 version that'll be available soon.

@boundsj boundsj closed this as completed May 22, 2017
@fabian-guerra fabian-guerra removed this from the ios-v3.6.0 milestone May 22, 2017
@frederoni
Copy link
Contributor

frederoni commented May 22, 2017

The implementation above should yield a compile-time error saying “Control reaches end of non-void function”. Looks like warnings or errors about return type has been disabled in the build settings but it should be treated as an error by default.
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
screenshot 2017-05-22 10 17 15

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
annotations Annotations on iOS and macOS or markers on Android crash iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

No branches or pull requests

5 participants