Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android project not found #33835

Closed
dikisubagjaknitto opened this issue May 14, 2022 · 81 comments
Closed

Android project not found #33835

dikisubagjaknitto opened this issue May 14, 2022 · 81 comments
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Platform: Android Android applications.

Comments

@dikisubagjaknitto
Copy link

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(R) Core(TM) 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

@shxinlei
Copy link

Did the problem work out?

@VeoScript
Copy link

The same thing happened to me today, I also can't find a solution to this problem

@shxinlei
Copy link

The same thing happened to me today, I also can't find a solution to this problem

The project I created for the first time yesterday is available, but the one I created today is not available

@alcristog
Copy link

Same here.

@junggernaut
Copy link

same here

1 similar comment
@songzitao-hub
Copy link

same here

@shxinlei
Copy link

Do you guys have any temporary solutions

@sebastiansiedlarz409
Copy link

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.

@shxinlei
Copy link

我有同样的问题。几天前一切都很好。打字后:我没有设置Android路径,但在我的旧项目中我有。npx react-native config

"project": {
"ios": {
"sourceDir": "D:\project\Batters\ios",
"folder": "D:\project\Batters",
"pbxprojPath": "D:\project\Batters\ios\Batters.xcodeproj\project.pbxproj",
"podfile": "D:\project\Batters\ios\Podfile",
"podspecPath": null,
"projectPath": "D:\project\Batters\ios\Batters.xcodeproj",
"projectName": "Batters.xcodeproj",
"libraryFolder": "Libraries",
"sharedLibraries": [],
"plist": [],
"scriptPhases": []
},
"android": null
}

Here? Can it be solved?

@sebastiansiedlarz409
Copy link

@shxinlei Yep, here. I have no clue what to do. I wast half a day today.

@AxanIqbal
Copy link

having the same issue with expo new projects

@VeoScript
Copy link

even in react native cli, the error is still the same

@PrestonThomas
Copy link

PrestonThomas commented May 14, 2022

I encountered the exact same issue today when creating new projects, older projects are still fine.

Edit: It seems like the path config issue isn't present on my Mac but I've not tried running it yet.

@AnkitRoyy
Copy link

I encountered the exact same issue today when creating new projects, older projects are still fine.

Same here

@GouravNainwaya
Copy link

having the same issue with react native new projects

@hafiz-sameed
Copy link

I'm also facing the same issue. Any solution?

@AnkitRoyy
Copy link

AnkitRoyy commented May 14, 2022

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

@poolals
Copy link

poolals commented May 14, 2022

Same here
"project": {
"ios": {
"sourceDir": "C:\Programacao\pessoal\react_native\trademanager\ios",
"folder": "C:\Programacao\pessoal\react_native\trademanager",
"pbxprojPath": "C:\Programacao\pessoal\react_native\trademanager\ios\trademanager.xcodeproj\project.pbxproj",
"podfile": "C:\Programacao\pessoal\react_native\trademanager\ios\Podfile",
"podspecPath": null,
"projectPath": "C:\Programacao\pessoal\react_native\trademanager\ios\trademanager.xcodeproj",
"projectName": "trademanager.xcodeproj",
"libraryFolder": "Libraries",
"sharedLibraries": [],
"plist": [],
"scriptPhases": []
},
"android": null
}

@UjjwalD77
Copy link

"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

@VeoScript
Copy link

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 ✌️

@AnkitRoyy
Copy link

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

Maybe😁

@ilsochrist
Copy link

same problem here 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.

Any one know how fix it?

package.json
{
"name": "org",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"react": "17.0.2",
"react-native": "0.68.2"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/runtime": "^7.12.5",
"@react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "^7.32.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.67.0",
"react-test-renderer": "17.0.2"
},
"jest": {
"preset": "react-native"
}
}

@chirigutraul
Copy link

Same problem here. I have been troubleshooting for 5 hours, nothing works. Older projects still works, but every new project throws up that error. I noticed that the 'build' folder is missing from android/app/.

@Aqibiweb
Copy link

I also faced the same issue today. Yesterday, I created a project on Windows for android and it worked but today when I started a new project same issue occurred.

@mvhk
Copy link

mvhk commented May 14, 2022

Same Here not able to start the android

@mvhk
Copy link

mvhk commented May 14, 2022

Same Here not able to start the android

C:\Users\haris\Desktop\ReactNative\newair>npm run android

newair@0.0.1 android C:\Users\haris\Desktop\ReactNative\newair
react-native run-android

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.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! newair@0.0.1 android: react-native run-android
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the newair@0.0.1 android script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\haris\AppData\Roaming\npm-cache_logs\2022-05-14T14_04_00_565Z-debug.log

@007AxelBerkati
Copy link

same issue here

@nc-devw
Copy link

nc-devw commented May 14, 2022

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

@UjjwalD77
Copy link

@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 👍

@MobileDevStar
Copy link

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

Thanks very much!
It saved me.

@pmg-codes
Copy link

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.

Hello, this doesn't clear up things. Where will I put "resolutions": { "glob": "7.2.0" } in package.json?
image
thank you!! And also, do I just delete the node_modules folder? THank you so much!!!

@priami93
Copy link

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

@KeshavThosar
Copy link

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.

Hello, this doesn't clear up things. Where will I put "resolutions": { "glob": "7.2.0" } in package.json? image thank you!! And also, do I just delete the node_modules folder? THank you so much!!!

Add "overrides" : {"glob" : "7.2.0"}
e.g.
image

Then delete node_modules folder and package-lock.json
Then run npm install

@pmg-codes
Copy link

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

Thank you! It fixed my problem!!

@mr-574rk
Copy link

image

Worked but i now get new error .

@B-Schmitz
Copy link

delete node_modules

npm i glob@7.2.0

npm install

npm run android

solved for me

@mr-574rk
Copy link

Why the glob@7.2.0 .......... latest reactnative update or fix?

@juniorerivaldo
Copy link

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

valeu, deu certo aqui, achei que havia algum problema no pc até formatei ele kkk

@ilsochrist
Copy link

Ty guys solucionated

@mr-574rk
Copy link

image
thats working now but it says this and i nothing is wrong with the code

@realyangchuan
Copy link

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.

@tstampfel
Copy link

@Ganeshguru5
Copy link

delete node_modules

npm i glob@7.2.0

npm install

npm run android

solved for me

Yeah its also worked for me thank you so much

@ilsochrist
Copy link

not work solution

@somersets
Copy link

Updating Android Studio and the JDK to 18 helped me

@LeQuy-123
Copy link

the android studio not see android folder at an android project like it used to? anyone have ideal why?

@cipolleschi cipolleschi added Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. and removed Needs: Triage 🔍 labels May 17, 2022
@github-actions
Copy link

⚠️ Missing Reproducible Example
ℹ️ It looks like your issue is missing a reproducible example. Please provide a Snack or a repository that demonstrates the issue you are reporting in a minimal, complete, and reproducible manner.

@dikisubagjaknitto
Copy link
Author

yeah works for now, thanks you for any solution

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels May 18, 2022
@locdo1005
Copy link

"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.

@aiya000
Copy link

aiya000 commented Jul 12, 2024

I fixed same issue by npx expo prebuild

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Platform: Android Android applications.
Projects
None yet
Development

No branches or pull requests