-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate module name: react-native #139
Comments
@vkandk the ideal solution is blacklisting the node modules folder in react-native-razorpay.But even if you remove node modules it will work. |
Tried blacklisting the node modules folder in react-native-razorpay still having the same issue
|
@jfreak delete your derived data , close your metro bundler , clean and build. |
create rn-cli.config.js in your root folder and blacklist the node_modules from react-native-razorpay.
|
react-native run-android --config rn-cli.config.js |
Stopped and cleared all temp files of metro bundler still facing the same issues. |
@jfreak there are two permanent solutions for this :
|
having same issue guys! hope it will be resolved soon. |
@perminder-klair the solution is posted above , please follow it. |
You don't have to pass the config file. It takes by default if you place it in the root folder. check here |
@direwolf424 have a look at the example folder in this repo , it'll help you out.Ive used blacklisting there. |
Sorry for the late reply @iThink32 the solution works as of now
Just run react-native run android normally |
@jfreak cool. |
closing this issue.Reopen if required. |
Blacklisting node_modules in react-native-razorpay wouldn't create prob while in production ? As blacklisting solves the duplicate module name problem. But what about in production is it safe to do that ? Can i use this method to continue or is there any other good solution ? |
@itsarvindh blacklisting helps in avoiding files being compiled to ultimately create an executable , it has no effect after an executable has been created. |
ERROR:
Duplicate module name: react-native
Paths: ..<project-name>\node_modules\react-native-razorpay\node_modules\react-native\package.json
collides with
..<project-name>\node_modules\react-native\package.json
This error is caused by a @providesModule declaration with the same name across two different files.
Application details ->
React Native AWS Mobile Hub App -
package.json:
{...
"react": "16.5.0",
"react-native": " 0.57.1",
"react-native-razorpay": "^2.0.16",
...
}
build.gradle:
buildscript {
repositories {
google()
jcenter()
gradlePluginPortal()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
allprojects {
repositories {
mavenLocal()
jcenter()
maven { url "https://jitpack.io" }
maven { url "https://maven.google.com" }
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
android/app/build.gradle:
android {
compileSdkVersion 27
buildToolsVersion "28.0.3"
defaultConfig {
applicationId ""
minSdkVersion 19
targetSdkVersion 27
versionCode 29
versionName ""
vectorDrawables.useSupportLibrary = true
}
dependencies {
implementation project(':react-native-view-pdf')
implementation project(':react-native-svg')
implementation project(':react-native-image-crop-picker')
implementation project(':amazon-cognito-identity-js')
implementation project(':react-native-fetch-blob')
implementation project(':react-native-vector-icons')
implementation project(':react-native-razorpay')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:25.0.0"
implementation "com.facebook.react:react-native:+" // From node_modules
}
The text was updated successfully, but these errors were encountered: