gpt4 book ai didi

生成版本 APK : release-stripped. ap_ 时 Android Studio Preview 3 错误 ap_ 不存在

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:30:19 38 4
gpt4 key购买 nike

我将 Android Studio 从 Preview 2 更新到 Preview 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.

我读到它可能与即时运行功能有关,所以我禁用了它,但仍然出现同样的错误。然后,我尝试将 shr​​inkResources 属性设置为 false 然后它起作用了。但是当我尝试在 Google Developper Console 中上传 apk 时,它说我的 apk 不是Zipaligned...

无论您是 Google 开发人员,请帮帮我! :O

最佳答案

如果我使用的是 gradle 2.2.0-alpha3,我就会遇到这个问题。我找到了解决此问题的方法。您可以通过在 gradle 中禁用 shrinkResources 和 zipalign 来解决这个问题,然后使用命令行运行 zipalign。

build.gradle:

shrinkResources false
zipAlignEnabled false

手动运行 zipalign 命令:

<your-android-sdk-path>/sdk/build-tools/23.0.3$ 
./zipalign -v 4 <your-input>.apk <your-output>.apk

编辑:

我刚刚尝试使用旧版本的 gradle 2.1.0,它没有这个问题。 this SO thread 中提到了 gradle 2.2.0-alpha3 中的 zipalign 问题

关于生成版本 APK : release-stripped. ap_ 时 Android Studio Preview 3 错误 ap_ 不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37734577/

38 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com