Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/react-native/ReactAndroid/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,7 @@
-keep public class com.facebook.imageutils.** {
public *;
}

# Activity result launcher keys include the contract's class name. Keep those names so that R8
# doesn't merge different contracts into one class or rename them between builds.
-keepnames class * extends androidx.activity.result.contract.ActivityResultContract
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ The same stability concern applies to minification. If the app minifies class
names (R8/ProGuard), the obfuscated name of the owner class is not guaranteed to
be the same from one build to the next, so a result delivered after an app
update can be dropped. Keep the owner class's name (for example with
`-keepnames`) if results must survive across builds.
`-keepnames`) if results must survive across builds. React Native's consumer R8
rules already keep the names of `ActivityResultContract` subclasses, so R8
doesn't merge different contracts into one class, which would give them the same
key.

Registering the same contract class twice from one owner throws
`IllegalStateException`. In that case use the overload that takes a key:
Expand Down
Loading