ANT build failure

444 views
Skip to first unread message

Juyong

unread,
Apr 9, 2010, 5:41:11 PM4/9/10
to zxing
Hi,

I'm facing a compile error as show below (Windows, Ant). Where should
I point android-jar? /Core is compiled well but /Android is not with
this error. Pls, help me. thanks.

resource-src:
[echo] Generating R.java / Manifest.java from the resources...
[exec] W/asset (26080): Asset path C:\CV\ZXing\ZXing-1.5\android
\${android-jar} is neither a directory nor file (type=1).
[exec] ERROR: Asset package include 'C:\CV\ZXing\ZXing-1.5\android
\${android-jar}' not found.

BUILD FAILED
C:\CV\ZXing\ZXing-1.5\android\build.xml:147: exec returned: 1

Sean Owen

unread,
Apr 10, 2010, 6:26:21 AM4/10/10
to zxing
I suspect android-home in build.properties (top-level one) isn't set
properly? It should point to the Android SDK root.

Juyong Do

unread,
Apr 10, 2010, 2:01:12 PM4/10/10
to zx...@googlegroups.com
well, it is pointing SDK. Just for test, i changed it to something else and it fails in earlier steps.
android-home=C:\\CV\\android\\android-sdk-windows

here is the compile log. can you guess anything from this? To me, android-jar seems to be problem but not sure where to point it. "android\${android-jar}' not found."

Buildfile: C:\CV\ZXing\ZXing-1.5\android\build.xml
    [setup] Project Target: Android 2.1
    [setup] API level: 7
    [setup] WARNING: Attribute minSdkVersion in AndroidManifest.xml (3) is lower than the project target API level (7)
clean:
   [delete] Deleting directory C:\CV\ZXing\ZXing-1.5\android\bin
   [delete] Deleting directory C:\CV\ZXing\ZXing-1.5\android\gen
dirs:
     [echo] Creating output directories if needed...
    [mkdir] Created dir: C:\CV\ZXing\ZXing-1.5\android\gen
    [mkdir] Created dir: C:\CV\ZXing\ZXing-1.5\android\bin
    [mkdir] Created dir: C:\CV\ZXing\ZXing-1.5\android\bin\classes
resource-src:
     [echo] Generating R.java / Manifest.java from the resources...
     [exec] W/asset   (10084): Asset path C:\CV\ZXing\ZXing-1.5\android\${android-jar} is neither a directory nor file (type=1).
     [exec] ERROR: Asset package include 'C:\CV\ZXing\ZXing-1.5\android\${android-jar}' not found.

BUILD FAILED
C:\CV\ZXing\ZXing-1.5\android\build.xml:147: exec returned: 1

Total time: 2 seconds

And a little bit more from debug log...

resource-src:
     [echo] Generating R.java / Manifest.java from the resources...
Property "android-jar" has not been set
     [exec] Current OS is Windows XP
     [exec] Executing 'C:\CV\android\android-sdk-windows\platforms\android-7\too
ls\aapt.exe' with arguments:
     [exec] 'package'
     [exec] '-m'
     [exec] '-J'
     [exec] 'C:\CV\ZXing\ZXing-1.5\android\gen'
     [exec] '-M'
     [exec] 'C:\CV\ZXing\ZXing-1.5\android\AndroidManifest.xml'
     [exec] '-S'
     [exec] 'C:\CV\ZXing\ZXing-1.5\android\res'
     [exec] '-I'
     [exec] 'C:\CV\ZXing\ZXing-1.5\android\${android-jar}'
     [exec]
     [exec] The ' characters around the executable and arguments are
     [exec] not part of the command.
Execute:Java13CommandLauncher: Executing 'C:\CV\android\android-sdk-windows\plat
forms\android-7\tools\aapt.exe' with arguments:
'package'
'-m'
'-J'
'C:\CV\ZXing\ZXing-1.5\android\gen'
'-M'
'C:\CV\ZXing\ZXing-1.5\android\AndroidManifest.xml'
'-S'
'C:\CV\ZXing\ZXing-1.5\android\res'
'-I'
'C:\CV\ZXing\ZXing-1.5\android\${android-jar}'

The ' characters around the executable and arguments are
not part of the command.
     [exec] W/asset   (27820): Asset path C:\CV\ZXing\ZXing-1.5\android\${android-jar} is neither a directory nor file (type=1).
     [exec] ERROR: Asset package include 'C:\CV\ZXing\ZXing-1.5\android\${android-jar}' not found.
On Sat, Apr 10, 2010 at 3:26 AM, Sean Owen <sro...@gmail.com> wrote:
I suspect android-home in build.properties (top-level one) isn't set
properly? It should point to the Android SDK root.


--
To unsubscribe, reply using "remove me" as the subject.

Sean Owen

unread,
Apr 10, 2010, 3:18:54 PM4/10/10
to zxing
What do you have it set to? yes, a location including 'android-sdk-
windows' sounds right. I think this is a false alarm though. While a
path like 'C:\CV\ZXing\ZXing-1.5\android\${android-jar}' made me think
something was making it look up Android's libraries in your project
area, it is just that android-jar is not set, and '${android-jar}' is
being interpreted literally as a relative path.

android-jar ought to be set up by the build components from Android.
It should be pointing at the location of Android's android.jar. It
works for me and hadn't heard of issues here. Are you using the latest
SDK and all that?

Juyong Do

unread,
Apr 10, 2010, 5:36:59 PM4/10/10
to zx...@googlegroups.com
Yes, I believe so since I got it less than 2 weeks ago. I found android.jar and pointed to C:\CV\android\android-sdk-windows\platforms\android-7 (and \android-6, \android-5, ...). Now, the error list got longer as shown below. I haven't found anything from sdk installation procedure that i deviated. Would it be possible this is due to the fact that I'm building to Android 2.1? Pls, help me solve this puzzle. thanks. 

     [exec] C:\CV\ZXing\ZXing-1.5\android\res\values-fr\strings.xml:60: error: Apostrophe not preceded by \ (in Ce dispositif a connu des bugs qui causent les      [exec] C:\CV\ZXing\ZXing-1.5\android\res\layout\bookmark_picker_list_item.xml:17: error: No resource identifier found for attribute 'orientation' in package 'android'
     [exec] C:\CV\ZXing\ZXing-1.5\android\res\layout\capture.xml:17: error: No resource identifier found for attribute 'layout_width' in package 'android'
     [exec] C:\CV\ZXing\ZXing-1.5\android\res\layout\capture.xml:17: error: No resource identifier found for attribute 'layout_height' in package 'android'
     [exec] C:\CV\ZXing\ZXing-1.5\android\res\layout\capture.xml:21: error: No resource identifier found for attribute 'id' in package 'android'




--

Sean Owen

unread,
Apr 10, 2010, 5:42:35 PM4/10/10
to zxing
Wow, never seen those. It is not able to parse many of the XML
resources, which certainly exist and are correct. The error seems to
be that it doesn't understand the schema of these docs, which again
vaguely suggests the Android installation isn't being found.

Windows is always a little tricker to develop on. What's your android-
home set to? it's definitely correct, and you escaped the \ characters?

Juyong Do

unread,
Apr 10, 2010, 5:54:47 PM4/10/10
to zx...@googlegroups.com
android-home is set as follows. Is there other place to set android-home except build.properties? should i re-install sdk? i just tried to update it but no effect. puzzling...

android-home=C:\\CV\\android\\android-sdk-windows

here is a copy of build.properties.  
----------------------------------------------------------------------
version=1.5

# If you are building the J2ME client:
#
# Set this to a location where Sun's Wireless Toolkit, version 2.5.2 or later, has been installed
# Location on Linux varies but is typically under /usr/local or /usr/lib
# On Windows the default install directory is C:\WTK2.5.2
# Mac users: there is no WTK for Mac at the moment. The installer for Linux may work on Intel-based
# Macs (haven't tried it) but I believe the preverify binary will not run.
#
# If you are buildling the Android client or optimized Java client:
# Just create a 'WTK' directory wherever you like and add its location here. Proguard's
# proguard.jar will still be expected at this location as bin/proguard.jar for historical reasons.

# Uncomment or set appropriately:
WTK-home=C:\\CV\\android\\WTK
#WTK-home=/usr/local/WTK2.5.2

# Set this to the location where you have installed RIM's BlackBerry JDE in order to
# create the 'rim' client. There is no Mac or Linux version, but, these platforms can still
# build by obtaining a copy of net_rim_api.jar and rapc.jar from a Windows installation,
# and creating a fake mini installation home somewhere with the following files:
# [your home]/
#   bin/
#     rapc.jar
#   lib/
#     net_rim_api.jar

# Uncomment and set appropriately
#BB-JDK-home=C:\\Program Files\\Research In Motion\\Blackberry JDE 4.3.0
BB-JDK-home=/usr/local/bb-home

# Set this to the location where you installed the Android SDK.
android-home=C:\\CV\\android\\android-sdk-windows
#android-home=C:\\Program Files\\android-sdk-windows
#android-home=/usr/local/android

# Set this to the location of a Tomcat installation if you want to compile and run the zxing.org
# web site and web application
#tomcat-home=C:\\tomcat
tomcat-home=/usr/local/tomcat

# Uncomment and set this variable if building the zxing.appspot.com subdirectory. It points to the
# location of the Google Web Toolkit (GWT) which can be downloaded here:
# It builds against GWT 1.7 at the moment.
#GWT-home=/usr/local/gwt




--

Sean Owen

unread,
Apr 10, 2010, 5:59:02 PM4/10/10
to zxing
That looks just fine to me; it's set in just one place. I don't see
why this would not work. I don't have any other bright ideas; yes
perhaps you should try the brute-force option of reinstalling Android
and the project.

Juyong Do

unread,
Apr 10, 2010, 6:06:07 PM4/10/10
to zx...@googlegroups.com
thanks for the advice. that seems to be only remaining option. 

Juyong Do

unread,
Apr 11, 2010, 5:09:04 AM4/11/10
to zx...@googlegroups.com
Finally able to compile. Thanks for help. Here is the summary of changes needed for compile. Not sure why but anyhow these changes made it work.

targeted to android 2.0 instead of android 2.1

add <property name="android-jar" value="${sdk-location}/platforms/android-5/android.jar" /> to build.properties

change " ' " to " \' " in \android\res\values-fr\strings.xml

thanks!

Sean Owen

unread,
Apr 11, 2010, 6:10:01 AM4/11/10
to zxing
Glad it works for you, though we can't take the first change. The app
is targeted at 1.5 at the moment. I suspect targeting it at 2.x was
the source of the problem.

I can escape the quotes though, yes those should be. good catch.

Reply all
Reply to author
Forward
0 new messages