Search code examples
javascriptandroidreactjsreact-nativereact-native-router-flux

How do I add these dependencies?


I am very new to React Native. I am trying to install react-native-router-flux on my project following this website

https://github.com/aksonov/react-native-router-flux

One of the steps refers to users with React Native 0.60 and higher. For android users it says to "add the following two lines to dependencies section in android/app/build.gradle:"

implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02'

Although I don't know how to do this Could you please help me?


Solution

  • enter image description hereSo you need to open the file you mentioned and search for the word dependencies followed by curly brackets. Inside the brackets (and exactly where the red arrow is pointing) you need to paste the code they’re telling you to add:

    implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
    implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02'
    

    You should find at least two entries that start with the word implementation and that are already inside the dependencies list (before the red arrow). To find it faster, in you editor you can use CTRL+F or COMMAND+F if you use MacOS.