From 7c41a736bbcb1a930a0e13f3ba4e241789282710 Mon Sep 17 00:00:00 2001 From: Caleb Clarke Date: Thu, 7 Apr 2022 18:18:03 -0700 Subject: [PATCH] Fix Android NativeEventEmitter warnings Adds method stubs required by React Native 0.65+, to address warnings that "new NativeEventEmitter was called with a non-null argument without the required [addListener/removeListeners] method" --- .../main/java/com/rnziparchive/RNZipArchiveModule.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/android/src/main/java/com/rnziparchive/RNZipArchiveModule.java b/android/src/main/java/com/rnziparchive/RNZipArchiveModule.java index 8558d33..d94f7ac 100644 --- a/android/src/main/java/com/rnziparchive/RNZipArchiveModule.java +++ b/android/src/main/java/com/rnziparchive/RNZipArchiveModule.java @@ -510,4 +510,14 @@ private String getStackTrace(Exception e) { return sw.toString(); } + @ReactMethod + public void addListener(String eventName) { + // Keep: Required for RN built in Event Emitter Calls. + } + + @ReactMethod + public void removeListeners(Integer count) { + // Keep: Required for RN built in Event Emitter Calls. + } + }