Sporadic Android build failure: libApplicationMain.so

On Windows, I run into a sporadic (but frequent enough) build error sometimes when building (incremental, not clean) on Android:

arm-linux-androideabi-strip libApplicationMain-v7.so
arm-linux-androideabi-strip: unable to rename 'libApplicationMain-v7.so'; reason
: File exists
Error: Cannot open "export/android/bin/libs/armeabi/libApplicationMain.so" for w
riting, do you have correct access permissions?

This happens randomly, but once it happens, you can build and it recurs every time.

The work-around is to delete the entire export/android directory, which is quite expensive to rebuild. I think deleting libApplicationMain.so and libApplicationMain-v7.so also fixes the problem.

Edit: And I just had my first instance of deleting export/android and I get the same problem. This is bad.

FYI, the so file(s) don’t exist.

Turns out DropBox was the culprit. I think it was locking my files. I re-excluded the export directory and the problem disappeared.