For some reason when I call react-native link
, it adds duplicate includes to android/settings.gradle
which in turn adds duplicate imports to
This is a known bug on React Native. There's currently a PR pending for this bug: https://github.com/facebook/react-native/pull/18131
Update: The bug has been fixed!
To address this issue, you'll just have to manually comb through your dependencies whenever you run react-native-link
. I find it's helpful to have a clean git status before running it, then going over the changed files afterwards with git diff
afterwards.
CAUTION: Before executing below steps please take a backup of your project.
If i would have face this kind of problem then i would have deleted all the dependency from the settings.graddle except the include ':app'
, from getpackages except the new MainReactPackage()
and from the app/build.graddle i would have removed all dependencies except the:
dependencies {
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+"
}
After removing all the above code i would have ran react-native link.
Cheers(coffee) :)