简体   繁体   中英

How to manually build an Android project containing a Android library project using Ant?

I seem to have hit a snag while building my project using Ant. The resources of the QR code Scanner android library and my project resources don't seem to merge into one.arsc file. Here is the snippet of the aapt part of my script.

<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> 

My console error log looks like this:-

android-package-resources:
     [echo] Packaging Android resources into C:\Praveen\Eclipse\eclipse-SDK-3.7.
1-win32-x86_64\workspace\HH3_Standard Mode Application/bin/resources.ap_ ...
     [exec] C:\Praveen\Eclipse\eclipse-SDK-3.7.1-win32-x86_64\workspace\QRcode S
canner\res\values\colors.xml:18: error: Resource at contents_text appears in ove
rlay but not in the base package; use <add-resource> to add.
     [exec] C:\Praveen\Eclipse\eclipse-SDK-3.7.1-win32-x86_64\workspace\QRcode S
canner\res\values\colors.xml:19: error: Resource at encode_view appears in overl
ay but not in the base package; use <add-resource> to add.
     [exec] C:\Praveen\Eclipse\eclipse-SDK-3.7.1-win32-x86_64\workspace\QRcode S
canner\res\values\colors.xml:20: error: Resource at help_button_view appears in
overlay but not in the base package; use <add-resource> to add.
     [exec] C:\Praveen\Eclipse\eclipse-SDK-3.7.1-win32-x86_64\workspace\QRcode S
canner\res\values\colors.xml:21: error: Resource at help_view appears in overlay
 but not in the base package; use <add-resource> to add.
     [exec] C:\Praveen\Eclipse\eclipse-SDK-3.7.1-win32-x86_64\workspace\QRcode S
canner\res\values\colors.xml:22: error: Resource at possible_result_points appea
rs in overlay but not in the base package; use <add-resource> to add.

Try using this one:

<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> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM