修补 AndroidManifest.xml 不适用于 Apache Cordova 的 Visual Studio 工具
Patching AndroidManifest.xml is not working on Visual Studio Tools for Apache Cordova
我们正在升级 Google Play 商店中已经发布的原生 Android 应用程序,新版本使用 Visual Studio 工具开发阿帕奇科尔多瓦.
为了能够在商店中升级应用程序,我们需要重新发布它并指定正确的版本和包 ID。
因为我们有针对 iOS、Android 和 WP8 的单一解决方案,我们需要能够编译它并指定一个自定义 manifest/plist,我们将在其中设置正确的版本和包。
看了available documentation,好像也可以指定平台特定的配置文件:
Android
Place the custom AndroidManifest.xml file in
the res/native/android folder to configure settings such as custom
intents. Use the generated version of the file in the
bld/Debug/platforms/android folder after building a Debug
configuration of the project for Android.
按照建议,我们尝试在res/native/android
文件夹中添加一个不同的AndroidManifest.xml,但是内置的apk
仍然包含并使用默认的AndroidManifest.xml
。
有什么提示吗?
注意: 跟进 问题。
http://developer.android.com/guide/topics/manifest/manifest-intro.html
Every application must have an AndroidManifest.xml file (with
precisely that name) in its root directory. The manifest file presents
essential information about your app to the Android system,
information the system must have before it can run any of the app's
code.
所以我认为在构建应用程序期间,Cordova 需要用您的设备特定版本替换主清单文件。
另外,config.xml 文件有帮助吗?
http://cordova.apache.org/docs/en/edge/config_ref_index.md.html#The%20config.xml%20File
某些字段被插件和 Cordova 构建过程本身覆盖。这个更新后的清单成为 Cordova 随后扩充的基础。
不幸的是,包 ID 和版本是 Cordova 覆盖的两个字段。这些字段应在 config.xml 中修改。您可以使用设计器或查看代码,修改widget元素下的这两个属性。
id="my.applicaiton.id" version="1.0.0"
附带说明一下,查看您的自定义清单是否被提取的一种简单方法是将 AndroidManifest.xml 中的 android:name 更新为不同的内容。然后构建生成的 apk 时应该反映这个新名称。
我们正在升级 Google Play 商店中已经发布的原生 Android 应用程序,新版本使用 Visual Studio 工具开发阿帕奇科尔多瓦.
为了能够在商店中升级应用程序,我们需要重新发布它并指定正确的版本和包 ID。
因为我们有针对 iOS、Android 和 WP8 的单一解决方案,我们需要能够编译它并指定一个自定义 manifest/plist,我们将在其中设置正确的版本和包。
看了available documentation,好像也可以指定平台特定的配置文件:
Android
Place the custom AndroidManifest.xml file in the res/native/android folder to configure settings such as custom intents. Use the generated version of the file in the bld/Debug/platforms/android folder after building a Debug configuration of the project for Android.
按照建议,我们尝试在res/native/android
文件夹中添加一个不同的AndroidManifest.xml,但是内置的apk
仍然包含并使用默认的AndroidManifest.xml
。
有什么提示吗?
注意: 跟进
http://developer.android.com/guide/topics/manifest/manifest-intro.html
Every application must have an AndroidManifest.xml file (with precisely that name) in its root directory. The manifest file presents essential information about your app to the Android system, information the system must have before it can run any of the app's code.
所以我认为在构建应用程序期间,Cordova 需要用您的设备特定版本替换主清单文件。
另外,config.xml 文件有帮助吗?
http://cordova.apache.org/docs/en/edge/config_ref_index.md.html#The%20config.xml%20File
某些字段被插件和 Cordova 构建过程本身覆盖。这个更新后的清单成为 Cordova 随后扩充的基础。
不幸的是,包 ID 和版本是 Cordova 覆盖的两个字段。这些字段应在 config.xml 中修改。您可以使用设计器或查看代码,修改widget元素下的这两个属性。
id="my.applicaiton.id" version="1.0.0"
附带说明一下,查看您的自定义清单是否被提取的一种简单方法是将 AndroidManifest.xml 中的 android:name 更新为不同的内容。然后构建生成的 apk 时应该反映这个新名称。