Fix failed to write manifest in AGP 4.1.#1583
Open
xjy2061 wants to merge 1 commit intoTencent:devfrom
Open
Conversation
Member
|
已解决! 感谢! |
|
两种解决方案 :
|
|
亲测,使用这篇的配置,打包就没有问题了: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tinker 在
process${variant.name.capitalize()}Manifest任务的产物build/intermediates/merged_manifests目录中的AndroidManifest.xml文件中写入了tinker_id等信息,而 AGP 4.1 新增了在process${variant.name.capitalize()}Manifest任务之后执行的任务process${variant.name.capitalize()}ManifestForPackage,该任务的产物在build/intermediates/packaged_manifests目录中。如果这 2 个任务命中了 gradle 缓存,执行状态都是
FROM-CACHE,那么最终 APK 中 manifest 文件中的tinker_id等信息是以前编译写入的旧信息。因此,对于 AGP 4.1,向 manifest 写入信息的时机应该改为process${variant.name.capitalize()}ManifestForPackage执行后,且目标文件应该改为build/intermediates/packaged_manifests目录中的AndroidManifest.xml文件。@tomystang