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

Runtime crash on iOS 8 #12

Closed
jjshammas opened this issue Feb 1, 2016 · 8 comments
Closed

Runtime crash on iOS 8 #12

jjshammas opened this issue Feb 1, 2016 · 8 comments

Comments

@jjshammas
Copy link

If I try to run an app on iOS 8 that uses this plugin, I crash immediately with this error:

dyld: Symbol not found: _OBJC_CLASS_$_UIApplicationShortcutIcon
@jordanbyron
Copy link
Owner

@Kemcake can you confirm this? TBH I didn't test iOS versions < 9

@ptmt
Copy link

ptmt commented Feb 1, 2016

+1. I'm actually even can't compile with XCode 6. Yeah, this is my fault as a developer to forget about this when deploying to AppStore.

- (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL succeeded)) completionHandler {
  [RNQuickActionManager onQuickActionPress:shortcutItem completionHandler:completionHandler];
}

UIApplicationShortcutItem: Expected a type

@jordanbyron
Copy link
Owner

@ptmt @jjshammas since I assume you both have the iOS 8.x simulator installed, can you try changing the line in your AppDelegate.m file to this:

- (void)application:(UIApplication *)application performActionForShortcutItem:(NSObject *)shortcutItem completionHandler:(void (^)(BOOL succeeded)) completionHandler {
  [RNQuickActionManager onQuickActionPress:shortcutItem completionHandler:completionHandler];
}

I'm curious to see if that works. I'm downloading the simulator now but it's a big file so it may take a while.

@jordanbyron
Copy link
Owner

@jjshammas @ptmt at this point I'm pretty close to saying, "It just ain't gonna work", but I'm willing to be proven wrong. I spent a little while playing around with the 8.x iOS simulator and I can't get it working without removing nearly all references to UIApplicationShortcut classes.

@Kemcake let us know if there is something magical you did you get it working that we are missing.

@grabbou
Copy link
Collaborator

grabbou commented Feb 2, 2016

@ptmt
Copy link

ptmt commented Feb 2, 2016

It would be nice solution if Apple can recompile apps against each SDK. As far as I understand, they don't do it, so we need a dynamic runtime checking. I'm thinking about something like this:

@interface RCTApplicationShortcutItem : NSObject
@end

@implementation RCTApplicationShortcutItem

- (instancetype)init
{
    Class UIApplicationShortcutItem = NSClassFromString(@"UIApplicationShortcutItem");
    if (NSClassFromString(@"UIApplicationShortcutItem")) {
        return [[UIApplicationShortcutItem alloc] init];;
    }
    return self;
}

@end

I hope to find the better and shorter solution, if not, will try to use this approach and test it today.

Too bad that there is at 17% share by iOS8, and it's even more on our target audience.

@ptmt
Copy link

ptmt commented Feb 2, 2016

So, I wasted a few hours on #13, but it scares me. I would go with Weak Linking (with simple Class checking as you already have in master) or even just would set target = iOS9 (sorry iOS 8 users).

@jordanbyron
Copy link
Owner

Since we don't have any sane solutions for this issue I am going make the call that for now this project does not support older versions of iOS. If anyone wants to work on this more I'd be happy to review their work and merge it in if it doesn't add a ton of complexity. 🎱

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

No branches or pull requests

4 participants