package
specified in AndroidManifest.xml identify one application installed on the device. The name of the property itself is misleading because one may think that refactoring java classes may require renaming package
property as well. package
property can be any string respecting limitation described in javadoc.
Because this confusion Google guys decided to rename package
to applicationId
. However, this change apply to gradle file only. Changing manifest property name would break compatibility with previous versions, that's my guess.
So when you build your APK, gradle replaces manifest's package
property value with applicationId
value specified in gradle script.
If you would like to test it yourself. Just set applicationId
with different value that your manifest's package
and build APK. Then go to folder /build/intermediates/manifests/dev/debug and open AndroidManifest.xml. You will find there applicationId
value.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…