From time to time, I see my entire build artifacts directory populated with duplicate files whose names all contain " 2".
./testapp/build/generated/res/pngs/debug/drawable-xhdpi/ic_launcher_background 2.png
./testapp/build/generated/res/pngs/debug/drawable-xxhdpi/ic_launcher_background 2.png
./testapp/build/generated/res/pngs/debug/drawable-hdpi/ic_launcher_background 2.png
./testapp/build/generated/res/pngs/debug/drawable-ldpi/ic_launcher_background 2.png
./testapp/build/generated/res/pngs/debug/drawable-anydpi-v21/ic_launcher_background 2.xml
./testapp/build/generated/res/pngs/debug/drawable-mdpi/ic_launcher_background 2.png
./testapp/build/generated/res/pngs/debug/drawable-xxxhdpi/ic_launcher_background 2.png
./testapp/build/generated/source/buildConfig/debug/org/efalk/testapp/BuildConfig 2.java
./testapp/build/intermediates/symbol_list_with_package_name/debug/package-aware-r 2.txt
...
These look like the kinds of files that iCloud generates when it can't resolve differences between versions of files during sync, and my working directory is stored in iCloud ($HOME/Documents/Android/) but I'm not doing anything that should be causing out-of-sync files.
This causes my builds to fail with a complaint about "BuildConfig 2.java".
Is there something I should do, other than move my project out of iCloud?
Moving my development file out of the iCloud did the trick for me.