Skip to content

Commit

Permalink
Fix instacrash on main for Release due to java.lang.NoSuchMethodError (
Browse files Browse the repository at this point in the history
…#37550)

Summary:
Pull Request resolved: #37550

RN Tester is instacrashing on Android on main sadly since a while.
I've noticed it while working on another diff. The crash is a native crash with message:

```
Abort message: 'terminating with uncaught exception of type facebook::jni::JniException: java.lang.NoSuchMethodError: no non-static method "Lcom/facebook/react/fabric/events/EventEmitterWrapper;.<init>(Lcom/facebook/jni/HybridData;)V"'
```

which happens because this method is stripped by proguard. I'm fixing it here.

Changelog:
[Android] [Fixed] - Fix instacrash on main for Release due to java.lang.NoSuchMethodError

Reviewed By: cipolleschi

Differential Revision: D46145613

fbshipit-source-id: 4716458e80fefad5eb9a29a06740134b480e1cd7
  • Loading branch information
cortinico authored and facebook-github-bot committed May 24, 2023
1 parent 1671247 commit bf1bd48
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* This class holds reference to the C++ EventEmitter object. Instances of this class are created in
* FabricMountingManager.cpp, where the pointer to the C++ event emitter is set.
*/
@DoNotStrip
@SuppressLint("MissingNativeLoadLibrary")
public class EventEmitterWrapper {

Expand All @@ -30,6 +31,7 @@ public class EventEmitterWrapper {

@DoNotStrip private final HybridData mHybridData;

@DoNotStrip
private EventEmitterWrapper(HybridData hybridData) {
mHybridData = hybridData;
}
Expand Down

0 comments on commit bf1bd48

Please sign in to comment.