Android Studio 打包错误 \build\intermediates\res\resources-anzhi-debug-stripped.ap_' specified for property 'resourceFile' does not exist

最近升级了Android Studio 2.2版本,总算把Instant Run功能给打开了, 确实比之前好不少,解决了不少问题, 虽然首次build速度并不快,但是总体效率提升了,还是不错。

但是打包时候出了些小问题:

报错:

    \build\intermediates\res\resources-anzhi-debug-stripped.ap_' specified for property 'resourceFile' does not exist

错误产生是由于之前习惯性的加上了:

    shrinkResources true

修改为:

    shrinkResources false

就可解决问题;

如果需要设置shrinkResources 为true, 那么, 必须同时开启混淆即可, 即如下minifyEnabled 设置为true:

    shrinkResources true
    zipAlignEnabled true
    minifyEnabled true
    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容