Skip to content

Commit

Permalink
Annotate DefaultTurboModuleManagerDelegate to avoid redex stripping d…
Browse files Browse the repository at this point in the history
…ep in prod (facebook#46527)

Summary:
Pull Request resolved: facebook#46527

Changelog: [Internal]

**Context**
- `DefaultTurboModuleManagerDelegate.kt` was being stripped by redex since there was no direct dependency.
- This was causing a crash in prod builds
```
Trace: java.lang.RuntimeException: Unable to create application com.facebook.mobilehome.MobileHomeAppShell: java.lang.ClassNotFoundException: Didn't find class "com.facebook.react.defaults.DefaultTurboModuleManagerDelegate" on path: DexPathList
```

**Change**
- Annotate `DefaultTurboModuleManagerDelegate.kt` with `DoNotStripAny`
- Don't strip `DoNotStripAny` annotated classes

Reviewed By: mdvacca

Differential Revision: D62766339

fbshipit-source-id: 7d9bfa04e252c392b94f739443bacf34f593e481
  • Loading branch information
shwanton authored and facebook-github-bot committed Sep 17, 2024
1 parent 51673e4 commit 9a6354f
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package com.facebook.react.defaults

import com.facebook.jni.HybridData
import com.facebook.proguard.annotations.DoNotStrip
import com.facebook.proguard.annotations.DoNotStripAny
import com.facebook.react.ReactPackage
import com.facebook.react.ReactPackageTurboModuleManagerDelegate
import com.facebook.react.bridge.ReactApplicationContext
Expand All @@ -25,6 +26,7 @@ import com.facebook.react.runtime.cxxreactpackage.CxxReactPackage
* TODO(T186951312): Should this be @UnstableReactNativeAPI?
*/
@OptIn(UnstableReactNativeAPI::class)
@DoNotStripAny
public class DefaultTurboModuleManagerDelegate
private constructor(
context: ReactApplicationContext,
Expand Down

0 comments on commit 9a6354f

Please sign in to comment.