Skip to content

Proxying AppDelegate's delegate makes downcast nil in Expo 53 #264

@mathias5r

Description

@mathias5r

While upgrading my app to Expo 53 I came across the following error:

*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<JackintheBoxDev.AppDelegate 0x600000e19d40> valueForUndefinedKey:]: this class is not key value coding-compliant for the key _expoAppDelegate.'

Which was happening in the expo-update and in Release mode only.

Image

Basically, the downcast to the ReactNativeFactoryPrivider was returning nil and after banging my head against the wall multiple times I came across this part of the documentation in mParticle, which states:

By default the mParticle SDK replaces your UIApplication.delgate with its own NSProxy implementation in order to facilitate and simplify the handling of remote notifications, local notifications, interactions with notification actions, and application launching. Over time we have found this to be less intrusive than other SDKs which instead perform swizzling.

I followed the documentatiom. Setting up proxyAppDelegateas false and manually overriding the methods made the error go away.

I'm just posting it here because probably it will happen with someone else and there is nothing related to the error discription in the web.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions