有没有办法在 AndroidManifest 文件中获取当前产品风味的 applicationId?
is there a way to get the applicationId of current product flavor in AndroidManifest file?
我有 4 个产品 falvors,每个产品在 build.gradle 中显然有 4 个不同的 applicationIds。我需要将它们放入我的清单文件中。
有办法得到吗?
您可以在清单中使用 ${applicationId} 作为 documentation 提到的:
By default, the build tools also provide your app's application ID in
the ${applicationId} placeholder. The value always matches the final
application ID for the current build (including changes by build
variants. This is useful when you want to use a unique namespace for
identifiers such as an intent action, even between your build
variants.
我有 4 个产品 falvors,每个产品在 build.gradle 中显然有 4 个不同的 applicationIds。我需要将它们放入我的清单文件中。
有办法得到吗?
您可以在清单中使用 ${applicationId} 作为 documentation 提到的:
By default, the build tools also provide your app's application ID in the ${applicationId} placeholder. The value always matches the final application ID for the current build (including changes by build variants. This is useful when you want to use a unique namespace for identifiers such as an intent action, even between your build variants.