My Environment:
Android Studio 2.1.2
Android Gradle Plugin v2.1.2
Mac OSX v10.11.5
Up until now, I have turned off Instant Run when calling "Build=>clean Project" and running my project. The reason I have turned off Instant Run is because of this and this issue. However, recently, I started running into this problem every time I try to clean my project:
Error:Could not read path
<path/to/app/module>/build/intermediates/classes/release/com/<package/name>/R$layout.class'.
The interesting thing about this is that the specific file path that it can't find appears to be random. For example, if I call Gradle sync and then clean again, it will fail with this error:
Error:Could not read path
<path/to/app/module>/build/intermediates/classes/release/com/<different/package/name>$ProductCategoryAdapter$1.class'.`
Steps to Reproduce:
- Preferences=> Build,Exec,Deploy => Instant Run
- uncheck "enable Instant Run...", "Restart activity....", "Show instant run...."
- Tap "Apply", then "OK", then do a Gradle Sync by tapping gradle sync icon in AStudio
- "Build=>clean Project"
Workaround
The current workaround is to re-enable Instant Run. However, that will also bring back the reason for turning it off.
Questions
1) Has anyone else encountered this problem?
2) Are there any other possible workarounds or even better yet, a solution to this problem?