react-native-callkeep icon indicating copy to clipboard operation
react-native-callkeep copied to clipboard

com.facebook.react.internal.turbomodule.core.TurboModuleInteropUtils$ParsingException: Unable to parse @ReactMethod annotations from native module: RNCallKeep. Details: Module exports two methods to JavaScript with the same name: "displayIncomingCall

Open kmamtora opened this issue 1 year ago • 17 comments

Bug report

  • [ ] I've checked the example to reproduce the issue.

Error: Exception in HostObject::get for prop 'RNCallKeep': com.facebook.react.internal.turbomodule.core.TurboModuleInteropUtils$ParsingException: Unable to parse @ReactMethod annotations from native module: RNCallKeep. Details: Module exports two methods to JavaScript with the same name: "displayIncomingCall

  • Reproduced on:
  • [x] Android
  • [ ] iOS

Description

Steps to Reproduce

Versions

- Callkeep:
- React Native:
- iOS:
- Android:
- Phone model: 

Logs

Paste here

kmamtora avatar Jul 24 '24 03:07 kmamtora

having the same issue

AsadAlihp avatar Sep 09 '24 12:09 AsadAlihp

Same issue on latest "react-native": "^0.76.1", but not "react-native": "^0.75.4",

super-potion avatar Nov 01 '24 19:11 super-potion

having the same issue

shahzaib803 avatar Nov 02 '24 06:11 shahzaib803

Same issue. RN 0.76.1. newArch enabled.

C0rren avatar Nov 04 '24 08:11 C0rren

Same issue. It happens only on Android when "new arch" is enabled.

To reproduce:

  • create a new React Native repo
  • make sure "new arch" is enabled newArchEnabled=true in gradle.properties
  • install CallKeep and import CallKeep in the index.js file import RNCallKeep from 'react-native-callkeep';
  • App crashes on start and the error message mentioned in the OP is displayed

Removing the CallKeep import gets rid of the error message. Disabling "new arch" gets rid of the error message.

This happens on React Native 0.76 (where new architecture is enabled by default) and also happens in earlier versions if you enable the new architecture manually.

dan-avg avatar Nov 04 '24 09:11 dan-avg

Same issue.

MoamberRaza avatar Nov 04 '24 21:11 MoamberRaza

Same issue. RN 0.76.1. newArch enabled.

The issue below describes the problem:

https://github.com/facebook/react-native/issues/45193


Temporarily disabled newArch on gradle.properties as workaround:
# newArchEnabled=true

marcosluizfp avatar Nov 07 '24 14:11 marcosluizfp

same issue.

there is one more issue.

com.facebook.react.internal.turbomodule.core.TurboModuleInteropUtils$ParsingException: Unable to parse @ReactMethod annotations from native module: RNCallKeep. Details: Module exports two methods to JavaScript with the same name: "startCall

arungirivasan avatar Nov 20 '24 17:11 arungirivasan

I was able to get around the error by commenting out one of the methods. Here's how I did it: edit the file node_modules/react-native-callkeep/android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java look for this:

@ReactMethod
public void displayIncomingCall(String uuid, String number, String callerName) {
        this.displayIncomingCall(uuid, number, callerName, false, null);
}

and this:

@ReactMethod
 public void startCall(String uuid, String number, String callerName) {
        this.startCall(uuid, number, callerName, false, null);
 }

comment or delete them and rebuilt, it should work.

kavehmovahedi avatar Dec 18 '24 15:12 kavehmovahedi

I was able to get around the error by commenting out one of the methods. Here's how I did it: edit the file node_modules/react-native-callkeep/android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java look for this:

@ReactMethod
public void displayIncomingCall(String uuid, String number, String callerName) {
        this.displayIncomingCall(uuid, number, callerName, false, null);
}

and this:

@ReactMethod
 public void startCall(String uuid, String number, String callerName) {
        this.startCall(uuid, number, callerName, false, null);
 }

comment or delete them and rebuilt, it should work. react-native-callkeep+4.3.16.patch I've created the patch to be used with patch-package

lpfrenette avatar Dec 30 '24 13:12 lpfrenette

same here

shais99 avatar Jan 16 '25 22:01 shais99

I was able to get around the error by commenting out one of the methods. Here's how I did it: edit the file node_modules/react-native-callkeep/android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java look for this:

@ReactMethod
public void displayIncomingCall(String uuid, String number, String callerName) {
        this.displayIncomingCall(uuid, number, callerName, false, null);
}

and this:

@ReactMethod
 public void startCall(String uuid, String number, String callerName) {
        this.startCall(uuid, number, callerName, false, null);
 }

comment or delete them and rebuilt, it should work. react-native-callkeep+4.3.16.patch I've created the patch to be used with patch-package

I have tried that, still getting the error:

 (NOBRIDGE) ERROR  Error: Exception in HostObject::get for prop 'RNCallKeep': com.facebook.react.internal.turbomodule.core.TurboModuleInteropUtils$ParsingException: Unable to parse @ReactMethod annotations from native module: RNCallKeep. Details: Module exports two methods to JavaScript with the same name: "displayIncomingCall [Component Stack]

shais99 avatar Jan 17 '25 09:01 shais99

one another solution to turn new architecture in to False in gradle.properties or comment display incoming call and start call in node modules in Android folder. Thanks

MoamberRaza avatar Jan 17 '25 09:01 MoamberRaza

react-native-callkeep+4.3.16.patch I've created the patch to be used with patch-package

Your patch is redundant. Your build folder got there.

Correct react-native-callkeep+4.3.16.patch:

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..fb98e65 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) {

P.S. @kavehmovahedi Thanks for your solution! It works!

danilvalov avatar Jan 30 '25 09:01 danilvalov

I simply set the "newArchEnabled": true, to "newArchEnabled": false, or remove entirely from app.json, deleted node_module and previous builds and restarted them afresh, and it fixed the error.

SolomonFoskaay avatar Jun 19 '25 07:06 SolomonFoskaay

@SolomonFoskaay This is not good solution. The new architecture is our present. You can't ignore it. And new RN versions won't have support for the old architecture. Your solution is the same as you will use old versions of RN always.

danilvalov avatar Jun 19 '25 07:06 danilvalov

@SolomonFoskaay This is not good solution. The new architecture is our present. You can't ignore it. And new RN versions won't have support for the old architecture. Your solution is the same as you will use old versions of RN always.

Thanks, and I appreciate your response, it's true will have to end up re-enabling it later if I want to use up-to-date version of RN.

I am working on creating Solana Mobile dApp Examples to help mobile devs build mobile apps on Solana Blockchain and whenever I allow enable the "newArchEnabled": true,, it gives this error:

Image

(NOBRIDGE) LOG  Bridgeless mode is enabled
 (NOBRIDGE) ERROR  Error: Exception in HostObject::get for prop 'SolanaMobileWalletAdapter': com.facebook.react.internal.turbomodule.core.TurboModuleInteropUtils$ParsingException: Unable to parse @ReactMethod annotation from native module method: SolanaMobileWalletAdapter.endSession(). Details: Unable to parse JNI signature. Detected unsupported return class: kotlinx.coroutines.Job

Any temporal and permanent suggestion for this will be appreciated. Because for now, the only workaround that have worked for me is to set this to false as in "newArchEnabled": false,

Thanks!

SolomonFoskaay avatar Jun 19 '25 08:06 SolomonFoskaay

any solution for this?

jhonbergmann avatar Aug 08 '25 01:08 jhonbergmann