如何使用 Ant 手动构建包含 Android 库项目的 Android 项目



我似乎在使用 Ant 构建项目时遇到了障碍。二维码扫描仪安卓库的资源和我的项目资源似乎没有合并到一个 .arsc 文件中。这是我脚本的aapt部分的片段。

<exec executable="${aapt}" failonerror="true">
      <arg value="package" />
      <arg value="-M" />
      <arg path="AndroidManifest.xml" />
      <arg value="-A" />
      <arg path="assets" />
      <arg value="-S" />
      <arg path="./res" /> 
      <arg value="-S" />
      <arg path="../QRcode Scanner/res" />
      <arg value="-I" />
      <arg path="${android-platform-jar}" />
      <arg value="-f" />
      <arg value="-F" />
      <arg value="${resources.file}" />
    </exec> 

我的控制台错误日志如下所示:-

android-package-resources:
     [echo] Packaging Android resources into C:PraveenEclipseeclipse-SDK-3.7.
1-win32-x86_64workspaceHH3_Standard Mode Application/bin/resources.ap_ ...
     [exec] C:PraveenEclipseeclipse-SDK-3.7.1-win32-x86_64workspaceQRcode S
cannerresvaluescolors.xml:18: error: Resource at contents_text appears in ove
rlay but not in the base package; use <add-resource> to add.
     [exec] C:PraveenEclipseeclipse-SDK-3.7.1-win32-x86_64workspaceQRcode S
cannerresvaluescolors.xml:19: error: Resource at encode_view appears in overl
ay but not in the base package; use <add-resource> to add.
     [exec] C:PraveenEclipseeclipse-SDK-3.7.1-win32-x86_64workspaceQRcode S
cannerresvaluescolors.xml:20: error: Resource at help_button_view appears in
overlay but not in the base package; use <add-resource> to add.
     [exec] C:PraveenEclipseeclipse-SDK-3.7.1-win32-x86_64workspaceQRcode S
cannerresvaluescolors.xml:21: error: Resource at help_view appears in overlay
 but not in the base package; use <add-resource> to add.
     [exec] C:PraveenEclipseeclipse-SDK-3.7.1-win32-x86_64workspaceQRcode S
cannerresvaluescolors.xml:22: error: Resource at possible_result_points appea
rs in overlay but not in the base package; use <add-resource> to add.

尝试使用这个:

<exec executable="${aapt}" failonerror="true">
  <arg value="package" />
  <arg value="-M" />
  <arg path="AndroidManifest.xml" />
  <arg value="-A" />
  <arg path="assets" />
  <arg value="-S" />
  <arg path="./res" /> 
  <arg value="-S" />
  <arg path="../QRcode Scanner/res" />
  <arg value="-I" />
  <arg path="${android-platform-jar}" />
  <arg value="-f" />
  <arg value="-F" />
  <arg value="${resources.file}" />
  <arg value="--auto-add-overlay" />
</exec> 

相关内容

  • 没有找到相关文章

最新更新