【问题标题】:How to merge or override the build.xml for Android in phonegap / Cordova如何在 phonegap / Cordova 中合并或覆盖 Android 的 build.xml
【发布时间】:2015-01-23 12:09:39
【问题描述】:

我正在为 Visual Studio 2015 中的 Cordova 开发多设备混合应用解决方案。 由于某些原因,我正在使用 Grunt,所以我的解决方案中有一个“node-modules”文件夹,由于这个文件夹,我无法为 Android 构建。

解决方案是添加这个属性:

<property name="aapt.ignore.assets" value="<dir>node_*" />

在 Android 的 build.xml 中排除要内置的节点模块,但是 build.xml 文件是使用我的 Visual Studio 解决方案构建生成的,似乎无法在科尔多瓦 config.xml。

我也尝试在 /res/native/android/ 中创建一个 build.xml 文件(相当于之前 MDHA 的 CTP 中的 /res/cert/android/),但没有进行任何合并。

有什么想法吗?

【问题讨论】:

  • 您是否尝试将 build.xml 放在 merges/android 文件夹中?您可以使用 herePlatform Specific Content 下记录的合并文件夹将特定于平台的内容添加到项目中
  • 我试图在 merges/android 和 /merges/android/scripts 中创建我的 build.xml,但这不起作用。现在(没有我的 build.xml)我不知道为什么我可以构建,但显然我的 node_module 文件夹在构建中,我的 pkg 大了 5 个月。实际上,我正在尝试使用“custom_rules.xml”(构建前/构建后事件规则)来获得一些东西。

标签: android cordova node-modules multi-device-hybrid-apps visual-studio-2015


【解决方案1】:

尝试将此添加到 \res\native\android\ant.properties:

aapt.ignore.assets=<dir>node_*

此文件似乎已导入到 build.xml(生成的)中,因此它提供了一种在其中获取价值的迂回方式。

【讨论】:

  • 很好,这行得通!我觉得有点白痴,因为我以前没有考虑过。谢谢
猜你喜欢
  • 1970-01-01
  • 2022-10-03
  • 2016-11-09
  • 1970-01-01
  • 2012-04-04
  • 2013-10-31
  • 2014-09-01
  • 2013-10-22
相关资源
最近更新 更多