1

I am trying to install image picker, it gets installed. But then post running android this error is thrown. When I remove installed image picker line from package json, the issue gets resolved. How to I resolve this?

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Unable to delete directory 'D:\React\OMW\project\omw_mobile2\onmyway_mobile\OnMyWay\android\app\build\generated\not_namespaced_r_class_sources\debug\r\androidx\appcompat' after 10 attempts

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

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

BUILD FAILED in 47s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! OnMyWay@0.0.1 android: `react-native run-android`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the OnMyWay@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\admin\AppData\Roaming\npm-cache\_logs\2020-07-18T03_05_08_404Z-debug.log
Sakshi
  • 73
  • 3
  • 12

1 Answers1

1

you need to clean project

Build > Clean Project

and than build your project again

moxspoy
  • 154
  • 1
  • 4
  • I tried cd android && ./gradlew cleanBuildCache a and it worked!! THanks for suggestion. Before this tried everything mentioned in https://github.com/facebook/react-native/issues/27443 and nothing worked. Thanks so much – Sakshi Jul 18 '20 at 08:28