react-native link causes duplicate imports in Android settings.gradle

后端 未结 2 1666
自闭症患者
自闭症患者 2021-01-12 10:16

For some reason when I call react-native link, it adds duplicate includes to android/settings.gradle which in turn adds duplicate imports to

2条回答
  •  时光说笑
    2021-01-12 11:19

    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) :)

提交回复
热议问题