Skip to content

docs(android): add required Proguard rule for CodePush#39

Open
jackyrusly wants to merge 1 commit into
codemagic-ci-cd:masterfrom
jackyrusly:master
Open

docs(android): add required Proguard rule for CodePush#39
jackyrusly wants to merge 1 commit into
codemagic-ci-cd:masterfrom
jackyrusly:master

Conversation

@jackyrusly

Copy link
Copy Markdown

Description

When Proguard / R8 is enabled, react-native-code-push may fail to apply the updated JS bundle on the first restart after an update.

This happens because getReactHostDelegate uses reflection to access reactHostDelegate from ReactHostImpl:

Field field = clazz.getDeclaredField("reactHostDelegate");

If Proguard obfuscates or removes this field, the reflection lookup fails at runtime and the CodePush bundle is not applied on first restart.

@kmsbernard

Copy link
Copy Markdown
Collaborator

Sorry for the long wait, and thank you for opening this PR.

This points out a real issue with ProGuard. After looking into it, I think this is better handled by fixing the library’s ProGuard rules directly rather than documenting an extra setup step for users, so I opened #54 with that change.

If you think there’s anything missing in that approach, feedback is very welcome.

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

Successfully merging this pull request may close these issues.

2 participants