Skip to content

Crash [__NSArrayM getObjects:range:]: range {0, 3} extends beyond bounds [0 .. 1] #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Feb 5, 2018 · 7 comments

Comments

@ghost
Copy link

ghost commented Feb 5, 2018

after installing AppsFlyerFramework we received Crash on our Fabrics.Crash details as follow.

0 CoreFoundation __exceptionPreprocess
1 libobjc.A.dylib objc_exception_throw
2 CoreFoundation _CFArgv
3 CoreFoundation -[__NSArrayM getObjects:range:]
4 CoreFoundation -[NSArray initWithArray:range:copyItems:]
5 UIKit +[_UICanvas canvases]
6 UIKit +[_UIApplicationCanvas canvases]
7 UIKit +[_UIApplicationCanvas mostActiveCanvas]
8 UIKit -[UIApplication isSuspendedEventsOnly]
9 UIKit UpdateSystemSoundActiveStatus
10 UIKit IsSystemSoundEnabled
11 UIKit UpdateSystemSoundActiveStatus
12 UIKit -[UIDevice _updateSystemSoundActiveStatus:]
13 CoreFoundation CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER
14 CoreFoundation _CFXRegistrationPost
15 CoreFoundation ___CFXNotificationPost_block_invoke
16 CoreFoundation -[_CFXNotificationRegistrar find:object:observer:enumerator:]
17 CoreFoundation _CFXNotificationPost
18 Foundation -[NSNotificationCenter postNotificationName:object:userInfo:]
19 iFax iOS -[AppsFlyerTracker getCounter:]
20 iFax iOS -[AppsFlyerTracker getEventParameters:]
21 iFax iOS -[AppsFlyerTracker callServerWithEventName:value:withDictionary:isEvent:isIAd:]
22 iFax iOS -[AppsFlyerTracker callServerWithEventName:value:isInAppEvent:isIAd:]
23 libdispatch.dylib _dispatch_client_callout
24 libdispatch.dylib _dispatch_continuation_pop$VARIANT$armv81
25 libdispatch.dylib _dispatch_source_invoke$VARIANT$armv81
26 libdispatch.dylib _dispatch_queue_serial_drain$VARIANT$armv81
27 libdispatch.dylib _dispatch_queue_invoke$VARIANT$armv81
28 libdispatch.dylib _dispatch_root_queue_drain_deferred_wlh$VARIANT$armv81
29 libdispatch.dylib _dispatch_workloop_worker_thread$VARIANT$armv81
30 libsystem_pthread.dylib _pthread_wqthread
31 libsystem_pthread.dylib start_wqthread
@andr-ggn
Copy link
Contributor

andr-ggn commented Feb 5, 2018

Hello, @moontecholabs

  • Are you listening to any NSUserDefaults changes with NSNotificationCenter?
  • We have a very nice support at [email protected] for such kind of problems.

  • There is such kind of problem already discussed at firebase-crash from November 2017 and the problem was considered to be on the Apple' side. The AppsFlyer team can workaround this by forcing the NSUserDefaults change on the main queue.

@ghost
Copy link
Author

ghost commented Feb 8, 2018

@andr-ggn thanks For your help

  1. no we are not listening NSUserDefaults changes using NSNotificationCenter
  2. OK. we will contact if any new problem occur in future

@ghost
Copy link
Author

ghost commented Feb 14, 2018

@andr-ggn any update on above crash.

@andr-ggn
Copy link
Contributor

Hello, @moontecholabs again!

We are checking the best way to fix it on SDK side but in the meanwhile, I prepared a small workaround for you.

Please, let us know if it works for you.

//
//  AppsFlyer+Workaround.m
//
//  Created by AndreyG-AF on 10/02/17.
//

#import <objc/runtime.h>
#import <Foundation/Foundation.h>

@implementation NSUserDefaults (AppsFlyer)

+ (void)load {
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        Class class = [self class];
        
        method_exchangeImplementations(class_getInstanceMethod(class, @selector(setObject:forKey:)),
                                       class_getInstanceMethod(class, @selector(af_setObject:forKey:)));
                                       
        method_exchangeImplementations(class_getInstanceMethod(class, @selector(removeObject:)),
                                       class_getInstanceMethod(class, @selector(af_removeObject:)));
    });
}

- (void)af_setObject:(NSString *)string forKey:(NSString *)key {
    dispatch_async(dispatch_get_main_queue(), ^{
        [self af_setObject:string forKey:key];
    });
}

- (void)af_removeObject:(NSString *)key {
    dispatch_async(dispatch_get_main_queue(), ^{
        [self af_removeObject:key];
    });
}

@end

@ghost
Copy link
Author

ghost commented Feb 20, 2018

@andr-ggn thanks for your help.We will check and update if it working.

@andr-ggn
Copy link
Contributor

@moontecholabs any updates?

@ghost
Copy link
Author

ghost commented Apr 6, 2018

We have updated latest pod version, so now not facing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant