Fix failed to write manifest in AGP 4.1. #1583
Open
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