malkomich malkomich - 1 month ago 38
Android Question

Android Studio appcompat drawable-hdpi-v4 resources not found

Error:java.io.FileNotFoundException:
...\app\build\intermediates\res\merged\debug\drawable-hdpi-v4\abc_scrubber_control_to_pressed_mtrl_005.png
(The requested operation cannot be performed on a file with a user-mapped section open)


It is happenning randomly, one of each two times the project is built.
And the missed file is not only
abc_scrubber_control_to_pressed_mtrl_005.png
, but always is a drawable resource used in AppCompat styles.

android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
...
}
dependencies {
...
compile 'com.android.support:appcompat-v7:24.2.1'
}


I have also tried with older SDK versions & older appcompat library version cause a possible bug in new releases, but the error keeps showing up :(

Answer

The missing resource drawable-hdpi-v4\abc_scrubber_control_to_pressed_mtrl_005.png is from v4

So, add this dependency:

compile 'com.android.support:support-v4:23.1.1'

Add the support design library as well

compile 'com.android.support:design:24.2.1'