Jay*_*ing 5 android apk android-studio build.gradle android-gradle-plugin
我将Android工作室从预览2更新为预览3,现在当我尝试生成发布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.
Run Code Online (Sandbox Code Playgroud)
我已经读过它可能与即时运行功能有关所以我禁用它仍然是同样的错误.然后,我尝试将shrinkResources属性设置为false然后它工作.但是当我尝试在Google Developper Console中上传apk时,它说我的apk不是Zipaligned ...
无论您是Google Developper,请帮帮我!:o
如果我使用gradle 2.2.0-alpha3,则会出现此问题.我找到了解决这个问题的方法.您可以通过在gradle中禁用shrinkResources和zipalign然后使用命令行运行zipalign来解决此问题.
的build.gradle:
shrinkResources false
zipAlignEnabled false
Run Code Online (Sandbox Code Playgroud)
zipalign手动运行命令:
<your-android-sdk-path>/sdk/build-tools/23.0.3$
./zipalign -v 4 <your-input>.apk <your-output>.apk
Run Code Online (Sandbox Code Playgroud)
编辑:
我只是尝试使用旧版本的gradle 2.1.0,它没有这个问题.gradle 2.2.0-alpha3中的zipalign问题也在此SO线程中提到.
| 归档时间: |
|
| 查看次数: |
3444 次 |
| 最近记录: |