Native module WebRTCModule tried to override WebRTCModule
See original GitHub issueI followed the Android installation instructions but I got this error I checked and the package is declared only once.
MainApplication.java
package ...;
import android.app.Application;
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.learnium.RNDeviceInfo.RNDeviceInfo;
import com.swmansion.reanimated.ReanimatedPackage;
import org.reactnative.camera.RNCameraPackage;
import com.oney.WebRTCModule.WebRTCModulePackage;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
import java.lang.reflect.InvocationTargetException;
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 MyReactNativePackage());
packages.add(new WebRTCModulePackage());
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);
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
}
/**
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
*
* @param context
* @param reactInstanceManager
*/
private static void initializeFlipper(
Context context, ReactInstanceManager reactInstanceManager) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.pipelinetransfert.ReactNativeFlipper");
aClass
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
.invoke(null, context, reactInstanceManager);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
}
Platform information
- React Native version: 0.62.2
- react-native-webrtc version: 1.75.3
- OS: Android
- OS version: 9
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Native module WebRTCModule tried to override ... - GitHub
I ınstalled a clean react-native and build. There was not problem. And I did install react-native-webrtc with AndroidInstallation.md file.
Read more >Native module NativeUnimoduleProxy tried to override ...
I'm trying to run my react-native build on android. The error in the title has been pestering me for the last couple hours...
Read more >react-native-webrtc - npm
Start using react-native-webrtc in your project by running `npm i react-native-webrtc`. There are 35 other projects in ... A WebRTC module for React...
Read more >App immediatly crash after installing react-native-webrtc - Help
I just created a new app (react 16.11 and react-native 0.62) , installed react-native-webrtc ... “Native module WebRTCModule tried to override WebRTCModule.
Read more >WebRTC on mobile devices - Delivery Hero - Tech Blog
All WebRTC classes are now provided by react-native-webrtc module, ... If you notice logs starting with “WebRTC tries to override …
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It worked ! For those who have the same problem I set
minSdkVersion = 24
in build.gradle and I putandroid.enableDexingArtifactTransform.desugaring=false
inapp/gradle.properties
I think this could fix the problem for #780Thank you very much @8BallBomBom !
It would seem that crash error is related to this.