Sometimes (especially after restarting the computer I'm working on, or after updating some packages), when I Run the code (via a React Native configuration for Android in IntelliJ), I'm getting errors like:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':linkedin-sdk:packageReleaseResources'.
> Error: Cannot create directory E:\<appname>\android\linkedin-sdk\build\intermediates\
incremental\packageReleaseResources\merged.dir\values
What I'm currently doing is manually deleting several of these build folders (e.g. <appname>\android\build
, <appname>\android\app\build
, <appname>\node_modules\react-native-fbsdk\android\build
etc.) whenever this happens - which works, but is quite tedious and annoying.
I am not too familiar with gradle, so I don't know if relevant gradle clean
commands apply here. I don't remember encountering problems like this when working on native projects in Android Studio, so I'm concluding this is something specific to RN-for-android builds.
If this information is useful, I'm using 'com.android.tools.build:gradle:2.3.1'
, IntelliJ IDEA 2017.1, Win 10. I'm not running IntelliJ as admin.
Would anybody please suggest a way to automate this deletion? I'd also love to know what causes this...