I updated Android studio from Preview 2 to Preview 3 and now I get this error when I try to generate a release APK:
Error:A problem was found with the configuration of task ':app:packageProdRelease'.
> File '/Users/jay/repositories/test/app/build/intermediatesError:A problem was found with the configuration of task ':app:packageProdRelease'.
> File '/Users/jay/repositories/test/app/build/intermediates/res/resources-prod-release-stripped.ap_' specified for property 'resourceFile' does not exist.
I've read that it might be related to instant run feature so I disabled it and still the same error. And then, I tried to set shrinkResources
attribute to false
and then It works. BUT when I tried uploading the apk in Google Developper Console, it says my apk is not Zipaligned...
Wherever you are Google Developper, Help me out! :O
This problem occurs to me if I am using gradle 2.2.0-alpha3. I found a workaround to this problem. You can solve this by disabling shrinkResources and zipalign in gradle and then run zipalign using command line.
build.gradle:
shrinkResources false
zipAlignEnabled false
Run the zipalign
command manually:
<your-android-sdk-path>/sdk/build-tools/23.0.3$
./zipalign -v 4 <your-input>.apk <your-output>.apk
Edit:
I just have a try on using older version of gradle 2.1.0, it works without this problem. zipalign problem in gradle 2.2.0-alpha3 is mentioned in this SO thread as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With