I've been developing on an app for a while and testing against the debug build type with no build issues. Today, I tried building the release build type and I get the error
Error: Expected resource of type drawable [ResourceType]
This error occurs in a Butterknife-generated .java file. After quite a bit of trial and error (including doing a clean and invalidating caches) I discovered that the build succeeds if I add debuggable true to the release build type in my app build.gradle file, thus:
release {
debuggable true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
It also builds if I comment out the other properties thus:
release {
debuggable true
//minifyEnabled true
//proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
But the build fails as before if I also comment out debuggable true. So it appears that no matter what I need to have debuggable true in my release build type even though I don't want it there.
Any ideas what might be causing this? More importantly, any idea how I can get the error to go away without debuggable true and without suppressing lint warnings?
(I've tried suppressing the lint error ResourceType on the particular declaration in the hand-coded .java file but to no avail. TBH, I don't want to go into production with a solution like that.)