1

I am not sure if I need to start my project from the gradle file or not but I am following the instructions for setting up a React Native starter kit as well as the manual way https://rnfirebase.io/docs/v5.x.x/installation/basic-kit and I am not seeing the "Sync Now" alert. I am also not seeing the button to sync the files nor am I seeing anything in the drop downs to sync.

Because my files are not synced I am unable to run the project or able to connect to firebase

Do I need to CD into a different folder before I open the project in Android Studio? Do I need to set the root folder? Not sure where I am going wrong with these gradle files....

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

Olivia
  • 1,843
  • 3
  • 27
  • 48
  • Go to Build tab and click "Make Project" or "Rebuild Project." That will sync your gradle dependencies. Hope it helps, Amen – Yunus Kulyyev Aug 16 '19 at 22:34
  • 1
    I don't have either of those options. I have "Make Module" and when I click that I get another error. I attached the screen shots to the post – Olivia Aug 16 '19 at 22:38
  • what does the error say? I usually use Java or Kotlin and rebuilding project updates the dependencies as well – Yunus Kulyyev Aug 16 '19 at 22:41
  • Olivia, check this answer. It is for Java but it will be the same for React as well: https://stackoverflow.com/a/31822462/7278919 – Yunus Kulyyev Aug 16 '19 at 22:42
  • it looks like it's a root directory issue. When I open a new project under the "Android" folder I am able to run the project and sync it just fine. Is this typical? Should I not be able to work on both iOS and Android in the same project? – Olivia Aug 16 '19 at 22:45

2 Answers2

2

Not the best solution but this works: when I open the project under the android folder, I am able to run the gradle sync. It is when I am opening the project from a top level directory I run into the issue.

This seems wrong as I should be able to work on both iOS and Android in the same project but for now this is a work around.

Olivia
  • 1,843
  • 3
  • 27
  • 48
  • 1
    It is the best solution. The android project is under the android folder so you need to open it to use the Android Studio feature. Same applies for iOS (that you can't work with Android Studio obviously) where your need to open the xcworkspace file under the ios folder. – Victor Levasseur Aug 17 '19 at 07:57
  • oh interesting. I was under the impression from the docs that I could work on the entire project (or at least see the entire project). So if this is the case, why would they have the `App.js` file outside of the Android folder? If I have the Android folder as my top level directory, then I will be missing a lot of files `(gitignore, node_modules, app.js etc...)` @VictorLevasseur – Olivia Aug 17 '19 at 12:54
  • Because you don't work on your app in the Android Studio editor. The android and ios folders contains the native projects that use the common JS code you write in the root folder (or any other folder / node_modules). I recommend you to use another editor like IntelliJ, VScode, ... – Victor Levasseur Aug 17 '19 at 16:16
  • oh interesting. I didn't know that, I thought that development happened within android studio...the documentation actually suggests that I make edits within android studio which is what led me to that understanding. I appreciate that break down. This is my first app so I am unsure of the "best practices" when starting from scratch. thank you! – Olivia Aug 20 '19 at 00:37
0

Just put the command on terminal

flutter packages get
Murad Al Wajed
  • 4,180
  • 1
  • 10
  • 11