Module exports two methods to JavaScript with the same name
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start in android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java and review the displayIncomingCall and startCall overloads around the reported lines. Verify the React Native new-architecture requirement that exported methods have unique names, then confirm an Android build no longer reports duplicate JavaScript method exports while the supported calls still work.
Written by the indexing model from the issue text.
Description
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch react-native-callkeep@4.3.16 for the project I'm working on.
The android build, using react-native 0.81.1, was crashing due to this error:
Unable to parse @ReactMethod annotations from native module: RNCallKeep. Details: Module exports two methods to JavaScript with the same name: "displayIncomingCall
Turns out that using the new architecture, you can't expose two functions with the same name, even if they have a different signature.
Here is the diff that solved my problem:
diff --git a/node_modules/react-native-callkeep/android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java b/node_modules/react-native-callkeep/android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java
index 025480a..2722d74 100644
--- a/node_modules/react-native-callkeep/android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java
+++ b/node_modules/react-native-callkeep/android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java
@@ -434,10 +434,10 @@ public class RNCallKeepModule extends ReactContextBaseJavaModule implements Life
this.hasListeners = false;
}
- @ReactMethod
- public void displayIncomingCall(String uuid, String number, String callerName) {
- this.displayIncomingCall(uuid, number, callerName, false, null);
- }
+ // @ReactMethod
+ // public void displayIncomingCall(String uuid, String number, String callerName) {
+ // this.displayIncomingCall(uuid, number, callerName, false, null);
+ // }
@ReactMethod
public void displayIncomingCall(String uuid, String number, String callerName, boolean hasVideo) {
@@ -483,10 +483,10 @@ public class RNCallKeepModule extends ReactContextBaseJavaModule implements Life
conn.onAnswer();
}
- @ReactMethod
- public void startCall(String uuid, String number, String callerName) {
- this.startCall(uuid, number, callerName, false, null);
- }
+ // @ReactMethod
+ // public void startCall(String uuid, String number, String callerName) {
+ // this.startCall(uuid, number, callerName, false, null);
+ // }
@ReactMethod
public void startCall(String uuid, String number, String callerName, boolean hasVideo) {
This issue body was partially generated by patch-package.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 511
- Avg merge
- 9h 12m
- Merged PRs (30d)
- 2
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from react-native-webrtc/react-native-callkeep
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
react-native-webrtc/react-native-callkeep#868 · 3 comments · 2 reactions ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
react-native-webrtc/react-native-callkeep#540 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 15/100
react-native-webrtc/react-native-callkeep#874 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
react-native-webrtc/react-native-callkeep#873 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
react-native-webrtc/react-native-callkeep#872 · 5 comments ·
All issues in react-native-webrtc/react-native-callkeep
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100