Samir Kumar
Samir Kumar

Reputation: 150

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.

Upvotes: 0

Views: 1528

Answers (1)

goroncy
goroncy

Reputation: 2091

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> 

Upvotes: 1

Related Questions