react-native: Android project not found

Description

error Android project not found. Are you sure this is a React Native project? If your Android files are located in a non-standard location (e.g. not inside ‘android’ folder), consider setting project.android.sourceDir option to point to a new location. info Run CLI with --verbose flag for more details.

Version

0.68.2

Output of npx react-native info

System: OS: Windows 10 10.0.19042 CPU: (6) x64 Intel® Core™ i5-8400 CPU @ 2.80GHz Memory: 6.21 GB / 15.88 GB Binaries: Node: 14.19.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.15 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 6.14.16 - C:\Program Files\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: Not Found Windows SDK: Not Found IDEs: Android Studio: Version 3.4.0.0 AI-183.6156.11.34.5522156 Visual Studio: 17.1.32319.34 (Visual Studio Community 2022) Languages: Java: 1.8.0_312 - C:\Program Files\OpenJDK\openjdk-8u312-b07\bin\javac.EXE npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.68.2 => 0.68.2 react-native-windows: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

bug

Snack, code example, screenshot, or link to a repository

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 80

Most upvoted comments

Hello everyone. I check this https://github.com/react-native-community/cli/issues/1608#issuecomment-1126581017 and solved with:

  1. Clear node_modules
  2. add this to package.json "resolutions": { "glob": "7.2.0" }
  3. Reinstall node_modules with npm install

And you may vote this result on stackoverflow https://stackoverflow.com/questions/72239857/react-native-android-project-not-found/72241166#72241166

If this is not work please install glob with npm i glob@7.2.0

Is this bug in react-native? Is Facebook will solve it or do we have to find a solution?

Mark Zuckerberg’s birthday today, maybe tomorrow he’ll fix this problem ✌️

"project": {
    "ios": {
      "sourceDir": "C:\\Users\\devre\\Desktop\\Study\\Code\\ReactNativeStuff\\msapp\\ios",
      "folder": "C:\\Users\\devre\\Desktop\\Study\\Code\\ReactNativeStuff\\msapp",
      "pbxprojPath": "C:\\Users\\devre\\Desktop\\Study\\Code\\ReactNativeStuff\\msapp\\ios\\msapp.xcodeproj\\project.pbxproj",
      "podfile": "C:\\Users\\devre\\Desktop\\Study\\Code\\ReactNativeStuff\\msapp\\ios\\Podfile",
      "podspecPath": null,
      "projectPath": "C:\\Users\\devre\\Desktop\\Study\\Code\\ReactNativeStuff\\msapp\\ios\\msapp.xcodeproj",
      "projectName": "msapp.xcodeproj",
      "libraryFolder": "Libraries",
      "sharedLibraries": [],
      "plist": [],
      "scriptPhases": []
    },
    "android": null
  }

My life is ruined

delete node_modules

npm i glob@7.2.0

npm install

npm run android

solved for me

@AsuKaur Try: npm i glob@7.2.0

Hello everyone. I check this react-native-community/cli#1608 (comment) and solved with:

  1. Clear node_modules
  2. add this to package.json "resolutions": { "glob": "7.2.0" }
  3. Reinstall node_modules with npm install

And you may vote this result on stackoverflow https://stackoverflow.com/questions/72239857/react-native-android-project-not-found/72241166#72241166

If this is not work please install glob with npm i glob@7.2.0

This worked for me. thanks a milion.

Mark Zuckerberg’s birthday today, maybe tomorrow he’ll fix this problem ✌️

Maybe😁

Hello everyone. I check this react-native-community/cli#1608 (comment) and solved with:

  1. Clear node_modules
  2. add this to package.json "resolutions": { "glob": "7.2.0" }
  3. Reinstall node_modules with npm install

And you may vote this result on stackoverflow https://stackoverflow.com/questions/72239857/react-native-android-project-not-found/72241166#72241166

If this is not work please install glob with npm i glob@7.2.0

delete also package-lock.json file

Hello everyone. I check this react-native-community/cli#1608 (comment) and solved with:

  1. Clear node_modules
  2. add this to package.json "resolutions": { "glob": "7.2.0" }
  3. Reinstall node_modules with npm install

And you may vote this result on stackoverflow https://stackoverflow.com/questions/72239857/react-native-android-project-not-found/72241166#72241166

If this is not work please install glob with npm i glob@7.2.0

Perfect! Thanks, Bro…

This problem occurred at the beginning of learning RN today, which makes me ready to give it up 恶魔🤔

It is probably an update that doesn’t work so well. Don’t give up, mate, you got this. We are all facing this issue.

Hello everyone. I check this react-native-community/cli#1608 (comment) and solved with:

  1. Clear node_modules
  2. add this to package.json "resolutions": { "glob": "7.2.0" }
  3. Reinstall node_modules with npm install

And you may vote this result on stackoverflow https://stackoverflow.com/questions/72239857/react-native-android-project-not-found/72241166#72241166

nice one

Thanks, now it’s working.

It works for me, Thank you so much.

@THEG77 try install jdk-11. It worked for me

Hey, yeah that should work. Turns out my JAVA_HOME environment variable was pointing to some older version of java. changed it to latest version of java i had installed “java 17” and had to create a new project from scratch and it is running fine now 👍

GALERA, A SOLUÇÃO É ESSA: npm i glob@7.2.0

This problem occurred at the beginning of learning RN today, which makes me ready to give it up🤔

@Hlacer great start, atleast you know now that, the path is hard, and we need more efforts on RN

"project": {
    "ios": {
      "sourceDir": "C:\\Users\\devre\\Desktop\\Study\\Code\\ReactNativeStuff\\msapp\\ios",
      "folder": "C:\\Users\\devre\\Desktop\\Study\\Code\\ReactNativeStuff\\msapp",
      "pbxprojPath": "C:\\Users\\devre\\Desktop\\Study\\Code\\ReactNativeStuff\\msapp\\ios\\msapp.xcodeproj\\project.pbxproj",
      "podfile": "C:\\Users\\devre\\Desktop\\Study\\Code\\ReactNativeStuff\\msapp\\ios\\Podfile",
      "podspecPath": null,
      "projectPath": "C:\\Users\\devre\\Desktop\\Study\\Code\\ReactNativeStuff\\msapp\\ios\\msapp.xcodeproj",
      "projectName": "msapp.xcodeproj",
      "libraryFolder": "Libraries",
      "sharedLibraries": [],
      "plist": [],
      "scriptPhases": []
    },
    "android": null
  }

My life is ruined

Remove the android folder then run expo eject worked for me.

Updating Android Studio and the JDK to 18 helped me

@THEG77 try install jdk-11. It worked for me

Hello everyone. I check this react-native-community/cli#1608 (comment) and solved with:

  1. Clear node_modules
  2. add this to package.json "resolutions": { "glob": "7.2.0" }
  3. Reinstall node_modules with npm install

And you may vote this result on stackoverflow https://stackoverflow.com/questions/72239857/react-native-android-project-not-found/72241166#72241166

nice one

Thanks, now it’s working.

@AsuKaur Try: npm i glob@7.2.0

This worked for me PogU Then I was facing

Included build 'C:\Users\devre\Desktop\Study\Code\ReactNativeStuff\msapp\node_modules\react-native-gradle-plugin' does not exist.

installed it with npm i react-native-gradle-plugin and it seems to be working fine

nvm I’m facing this other issue now

* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.android.internal.application'.
   > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
     You can try some of the following options:
       - changing the IDE settings.
       - changing the JAVA_HOME environment variable.
       - changing `org.gradle.java.home` in `gradle.properties`.

My Java Version Shows:

C:\Users\devre\Desktop\Study\Code\ReactNativeStuff\msapp>java --version
java 17 2021-09-14 LTS
Java(TM) SE Runtime Environment (build 17+35-LTS-2724)
Java HotSpot(TM) 64-Bit Server VM (build 17+35-LTS-2724, mixed mode, sharing)

Finally completely fixed it by changing the JAVA_HOME environment variable to a Java version >=11 and created a new project. Working perfectly now

@sebastiansiedlarz409 @VeoScript Yes this works. Thanks a lot!

Hello everyone. I check this react-native-community/cli#1608 (comment) and solved with:

  1. Clear node_modules
  2. add this to package.json "resolutions": { "glob": "7.2.0" }
  3. Reinstall node_modules with npm install

And you may vote this result on stackoverflow https://stackoverflow.com/questions/72239857/react-native-android-project-not-found/72241166#72241166

This doesn’t work for me. Anything else I can try?

try using

yarn install glob@7.2.0

This problem occurred at the beginning of learning RN today, which makes me ready to give it up 恶魔🤔

It is probably an update that doesn’t work so well. Don’t give up, mate, you got this. We are all facing this issue.

Thank you very much. Let’s continue to refuel together !

This problem occurred at the beginning of learning RN today, which makes me ready to give it up🤔

I have same problem. Few days ago everything works ok. After typing: npx react-native config I have no set android paths, but in my older project i have.