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

UnhandledPromiseRejection: Command 'clean android project' failed with code: 1 #47

Closed
aliceathens opened this issue Dec 8, 2020 · 11 comments

Comments

@aliceathens
Copy link

Trying to use:

npx react-native-clean-project

Get the following error:

Screen Shot 2020-12-08 at 2 00 25 pm

@pmadruga
Copy link
Owner

Does it happen every time?

@prescindivel
Copy link

this error also happened to me

@pmadruga
Copy link
Owner

I'm not able to replicate this with a new RN project? Was that the case?

@tolgaberk
Copy link

tolgaberk commented Apr 8, 2021

is there any solution?
it just happened to me.

(edit)
i was just in the android dir thats why it thrown an error.

@pmadruga
Copy link
Owner

pmadruga commented Apr 8, 2021

So this error happens when you're in the android directory? I'll give it a try tonight.

@iamandiradu
Copy link

Tried it after upgrading to RN 0.64.1. Had the same error as mentioned above.
Ran yarn, retried cleaning and it worked.

@apfritts
Copy link

This is because you have removed your node_modules directory and your build.gradle file requires a resource in order to load your project and then clean your project.

@Kailash23
Copy link

@pmadruga

> cwingsdeliveryapp@0.2.1 clean
> react-native-clean-project

Wipe iOS build folder? (Y/n) Y
Wipe iOS Pods folder? (Y/n) Y
Wipe system iOS Pods cache? (Y/n) Y
Wipe user iOS Pods cache? (Y/n) Y
Update pods? (Y/n) Y
Wipe android build folder? (Y/n) Y
Clean Android project? (Y/n) Y
Wipe node_modules folder? (Y/n) Y
Update brew? (Y/n) Y
✅  wipe iOS Pods folder task has finished running in 29ms.
✅  wipe android build folder task has finished running in 24ms.
✅  wipe temporary caches task has finished running in 17ms.
✅  watchman cache clear (if watchman is installed) task has finished running in 36ms.
✅  wipe user iOS Pods cache task has finished running in 2s.
Error running 'clean android project': 

Error running 'clean android project': FAILURE: Build failed with an exception.


Error running 'clean android project': * Where:

Error running 'clean android project': Script '/Users/kailashuniyal/Desktop/cwings-delivery-app/node_modules/react-native-unimodules/gradle.groovy' line: 168
Error running 'clean android project': 

* What went wrong:

Error running 'clean android project': A problem occurred evaluating settings 'CwingsDeliveryApp'.

Error running 'clean android project': > 
Error running 'clean android project': /Users/kailashuniyal/Desktop/cwings-delivery-app/node_modules/expo-camera/unimodule.json


Error running 'clean android project': * Try:

Error running 'clean android project': Run with --stacktrace option to get the stack trace. Run with --info
Error running 'clean android project':  or --debug option to get more log output. Run with 
Error running 'clean android project': --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 6s

❌  Command 'clean android project' failed with code: 1
node:internal/process/promises:245
          triggerUncaughtException(err, true /* fromPromise */);
          ^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "undefined".] {
  code: 'ERR_UNHANDLED_REJECTION'
}

@lulmichal
Copy link

lulmichal commented Jun 17, 2021

Hello,

I'm experiencing the same issue (React Native version is 0.63.4). @iamandiradu solution didn't work although I didn't yet update version.

Have a nice day.

@MaganAnkur
Copy link

I am experiencing the same issue with 0.66

@pmadruga
Copy link
Owner

Closing because the discussion has been moved to #79 . I've also released a potential fix - please check that thread. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants