question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Native Module Incall Manager tried to override IncallManagerModule

See original GitHub issue

i am facing this error

Native Module Incall Manager tried to override IncallManagerModule . check to get Package Method in main Application.java it might be that module has been created twice. if this was your intention, set cannotOverrideExixistingmodule=True

my package.json file

 "axios": "^0.19.0",
    "openvidu-browser": "^2.11.0",
    "openvidu-node-client": "^2.11.0",
    "react": "16.8.6",
    "react-native": "0.60.5",
    "react-native-agora": "^2.8.0-alpha.2",
    "react-native-gesture-handler": "^1.4.0",
    "react-native-incall-manager": "^3.2.4",
    "react-native-paper": "^2.16.0",
    "react-native-reanimated": "^1.2.0",
    "react-native-vector-icons": "^6.6.0",
    "react-native-webrtc": "^1.75.0",
    "react-navigation": "^3.11.1",
    "react-navigation-material-bottom-tabs": "^1.0.0"

my Mainapplication.java file

package com.drjafar;

import android.app.Application;
import android.util.Log;

import com.facebook.react.PackageList;
import com.facebook.hermes.reactexecutor.HermesExecutorFactory;
import com.facebook.react.bridge.JavaScriptExecutorFactory;
import com.facebook.react.ReactApplication;
import com.oblador.vectoricons.VectorIconsPackage;
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
import com.swmansion.reanimated.ReanimatedPackage;
import com.syan.agora.AgoraPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
import com.zxcpoiu.incallmanager.InCallManagerPackage;
import java.util.List;

public class MainApplication extends Application implements ReactApplication {

  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
    @Override
    public boolean getUseDeveloperSupport() {
      return BuildConfig.DEBUG;
    }

    @Override
    protected List<ReactPackage> getPackages() {
      @SuppressWarnings("UnnecessaryLocalVariable")
      List<ReactPackage> packages = new PackageList(this).getPackages();
      // Packages that cannot be autolinked yet can be added manually here, for example:
       packages.add(new InCallManagerPackage());
      return packages;
    }

    @Override
    protected String getJSMainModuleName() {
      return "index";
    }
  };

  @Override
  public ReactNativeHost getReactNativeHost() {
    return mReactNativeHost;
  }

  @Override
  public void onCreate() {
    super.onCreate();
    SoLoader.init(this, /* native exopackage */ false);
  }
}

my build.Gradle file

dependencies {
    implementation project(':react-native-incall-manager')
    implementation project(':react-native-vector-icons')
    implementation project(':react-native-gesture-handler')
    implementation project(':react-native-reanimated')
    implementation project(':react-native-agora')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.facebook.react:react-native:+"  // From node_modules
    implementation "com.android.support:support-v4:28.0.3"
    if (enableHermes) {
      def hermesPath = "../../node_modules/hermesvm/android/";
      debugImplementation files(hermesPath + "hermes-debug.aar")
      releaseImplementation files(hermesPath + "hermes-release.aar")
    } else {
      implementation jscFlavor
    }
}

my graddle.settings

rootProject.name = 'drjafar'

include ':react-native-incall-manager'
project(':react-native-incall-manager').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-incall-manager/android')

include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-gesture-handler'
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
include ':react-native-reanimated'
project(':react-native-reanimated').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-reanimated/android')
include ':react-native-agora'
project(':react-native-agora').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-agora/android')
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'

i am calling InCallManager in App.js inside componentDidMount

  componentDidMount() {
    InCallManager.start({ media: 'audio' });
  }

every thing seems fine to me what is wrong image

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:12

github_iconTop GitHub Comments

1reaction
ruddellcommented, Aug 25, 2019

Since you are using v0.60.x of React Native, dependencies should now autolink. Have you tried removing the call to packages.add(new InCallManagerPackage()); from MainApplication.java?

0reactions
rizwan92commented, Sep 4, 2019

thanks man i am givin it a shot

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-native-incall-manager - npm
Handling media-routes/sensors/events during a audio/video chat on React Native. Latest version: 4.0.1, last published: 10 days ago.
Read more >
lambda - react-native-incall-manager 4.0.0 Android error JDK
Had a similar issue with react-native-keychain. Solution was, go to the node_module, in android/build.grade, add:
Read more >
react-native-incall-manager - NPM Package Overview - Socket
The purpose of this module is to handle actions/events during a phone call (audio/video) on react-native , ex: Manage devices events like wired-headset...
Read more >
Using Native Incoming Call UI for your React Native App (How ...
However, the project had its own in-call UI we wanted to use, ... Writing this native module eventually did result in the desired ......
Read more >
com.facebook.react.bridge.UiThreadUtil#runOnUiThread
runOnUiThread(new Runnable() { @Override public void run() { final Activity ... react-native-incall-manager File: InCallManagerModule.java License: ISC ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found