0

I have react-native based app and every time I run it via famous react-native run-android. Most of the times it works, but almost every day I get this error when running, and the only thing I can do to fix it, is to pull the whole project again in the different directive. Aka. start all over.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> java.io.IOException: Could not delete path 'C:\Users\John\Documents\React-projects\insta-clone3\mobile\android\app\build\generated\source\r\debug\com\aurelhubert'.

Always the same exeception, Could not delete path. This is my build.gradle

android {
compileSdkVersion 26
buildToolsVersion "25.0.1"

defaultConfig {
    applicationId "com.instagramclone"
    minSdkVersion 16
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
    ndk {
        abiFilters "armeabi-v7a", "x86"
    }
}

None of the solutions I found online does not seem to work for me.

3 Answers3

4

Have you tried deleting the android/app/build folder before running react-native run-android ? In the error message you can see that something fails in android/app/build/generated/...

Andrada L
  • 266
  • 1
  • 6
0

Try these commands in root directory

cd android

./gradlew clean

Then go back to root and try again

cd ..

react-native run-android

Feroz Khan
  • 2,396
  • 5
  • 20
  • 37
Lev
  • 1
  • 1
0

First enter these commands:

cd android
./gradlew.bat installDebug

After that,

cd..
react-native run-android

It works fine for me.

sɐunıɔןɐqɐp
  • 3,332
  • 15
  • 36
  • 40