简体   繁体   English

AndroidManifest.xml中 <manifest> package属性没有命名空间

[英]AndroidManifest.xml <manifest> package attribute has no namespace

From the O'Reilly book "Android Application Development " by Rick Rogers, John Lombardo, Zigurd Mednieks & Blake Meike, page 44: 来自Rick Rogers的O'Reilly着作“Android应用程序开发”,John Lombardo,Zigurd Mednieks和Blake Meike,第44页:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.microjobsinc.mjandroid" android:versionCode="1"
    android:versionName="1.0">

The XML code above has the package attribute. 上面的XML代码具有package属性。 However, in the rest of the XML, the remaining attributes all have a namespace. 但是,在XML的其余部分中,其余属性都具有命名空间。

Why do all of the attributes have a namespace except package ? 为什么除了package之外,所有属性都有一个命名空间?

I think it may be because the package attribute is the full Java package name for the application and so is a Java concept not something specific to Android. 我认为这可能是因为package属性是应用程序的完整Java包名称,所以Java概念不是特定于Android的东西。 It does stick out as unusual though but it is the correct way according to http://d.android.com/guide/topics/manifest/manifest-element.html 虽然它确实很突出,但根据http://d.android.com/guide/topics/manifest/manifest-element.html这是正确的方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AndroidManifest.xml文件 <manifest> versionCode属性 - AndroidManifest.xml file <manifest> versionCode attribute AndroidManifest.xml中的“属性缺少Android名称空间前缀” - “Attribute is missing the Android namespace prefix” in AndroidManifest.xml AndroidManifest.xml 中的包声明 - Package declaration in AndroidManifest.xml AndroidManifest.xml中的Label属性 - Label attribute in AndroidManifest.xml Android清单(AndroidManifest.xml)无法正常工作 - Android manifest (AndroidManifest.xml) not working as expected 清单合并错误:Package name 'uninitialized.application.id' used in:AndroidManifest.xml - Manifest merger error: Package name 'uninitialized.application.id' used in: AndroidManifest.xml 错误:覆盖清单:package 在 AndroidManifest.xml:2:5-34 声明的属性。 Flutter - Error: Overlay manifest:package atribute declared at AndroidManifest.xml:2:5-34. Flutter 错误:验证失败,在 AndroidManifest.xml 中退出主清单和属性 uses-feature#20000@glEsVersion - Error:Validation failed, exiting main manifest and Attribute uses-feature#20000@glEsVersion at AndroidManifest.xml 清单合并失败:属性 application@usesCleartextTraffic value=(true) from AndroidManifest.xml:29:9-44 - Manifest merger failed : Attribute application@usesCleartextTraffic value=(true) from AndroidManifest.xml:29:9-44 AndroidManifest.xml 中没有指定目标包 - Target package is not specified in AndroidManifest.xml
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM