Mysterious ANT error prevents build from Android Tutorial

Sysprogs forums Forums VisualGDB Mysterious ANT error prevents build from Android Tutorial

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #663
    Anonymous
    Participant

    I am unable to build the project created in the Android “getting started” tutorial. I consistently get these errors:

    1> BUILD FAILED
    1> C:Androidandroidsdktoolsantbuild.xml:892: The following error occurred while executing this line:
    1> C:Androidandroidsdktoolsantbuild.xml:894: The following error occurred while executing this line:
    1> C:Androidandroidsdktoolsantbuild.xml:906: The following error occurred while executing this line:
    1> C:Androidandroidsdktoolsantbuild.xml:284: null returned: 1

    I have looked online and the I am not doing the things that others have found as causes (using spaces in the directories where the Android SDK and NDK are placed, or failing to download the full SDK). Since there is no actual error given, I am at a loss as to how to diagnose the problem. I have looked at the lines in build.xml and they do not provide any meaningful clues either.

    #2694
    ket
    Participant

    Hi,

    It still looks to be a tool related error as it is the build.xml that comes with Android SDK that reports errors. What versions of Java JDK, Android SDK, Android NDK, ANT do you have installed and what are their installation directories?

    You can also try to run ant with verbose mode to get more details on the error. In Visual Studio go to the Output window and find the build line that runs ant.bat in your project directory. Run the same command in your project directory but also add -v to it.

    #2695
    Anonymous
    Participant

    Thanks for the reply!
    The SDK, NDK and ANT are all located in a directory called “Android” at the root of C:. I have listed them with their locations and version numbers as:
    C :/Android/androidndk – release r9
    C :/Android/androidsdk – version 22.2.1
    C :/Android/apacheant – version 1.9.2
    My JDK is 1.7.0_11. It is located in:
    C:Program Files (x86)Javajdk1.7.0_11
    I ran the verbose version of ANT as you specified and here is the output — it is quite long — I apologize:

    c:CodingAndroidAndroidTestProjectAndroidTestProject>C:Androidapacheantbin
    ant.bat debug -v
    Unable to locate tools.jar. Expected to find it in C:Program Files (x86)Javaj
    re7libtools.jar
    Apache Ant(TM) version 1.9.2 compiled on July 8 2013
    Trying the default build file: build.xml
    Buildfile: c:CodingAndroidAndroidTestProjectAndroidTestProjectbuild.xml
    Detected Java version: 1.7 in: C:Program Files (x86)Javajre7
    Detected OS: Windows 8
    parsing buildfile c:CodingAndroidAndroidTestProjectAndroidTestProjectbuild.
    xml with URI = file:/c:/Coding/Android/AndroidTestProject/AndroidTestProject/bui
    ld.xml
    Project base dir set to: c:CodingAndroidAndroidTestProjectAndroidTestProject

    parsing buildfile jar:file:/C:/Android/apacheant/lib/ant.jar!/org/apache/tools/a
    nt/antlib.xml with URI = jar:file:/C:/Android/apacheant/lib/ant.jar!/org/apache/
    tools/ant/antlib.xml from a zip file
    [property] Loading c:CodingAndroidAndroidTestProjectAndroidTestProjectloca
    l.properties
    [property] Loading c:CodingAndroidAndroidTestProjectAndroidTestProjectant.
    properties
    [property] Unable to find property file: c:CodingAndroidAndroidTestProjectA
    ndroidTestProjectant.properties
    [property] Loading Environment env.
    Property “env.ANDROID_HOME” has not been set
    Importing file c:CodingAndroidAndroidTestProjectAndroidTestProjectcustom_ru
    les.xml from c:CodingAndroidAndroidTestProjectAndroidTestProjectbuild.xml
    Cannot find c:CodingAndroidAndroidTestProjectAndroidTestProjectcustom_rules
    .xml imported from c:CodingAndroidAndroidTestProjectAndroidTestProjectbuild
    .xml
    Importing file C:Androidandroidsdktoolsantbuild.xml from c:CodingAndroid
    AndroidTestProjectAndroidTestProjectbuild.xml
    Overriding previous definition of reference to ant.projectHelper
    parsing buildfile C:Androidandroidsdktoolsantbuild.xml with URI = file:/C:/
    Android/androidsdk/tools/ant/build.xml
    Property “key.store” has not been set
    [macrodef] creating macro do-only-if-not-library
    [macrodef] creating macro do-only-if-manifest-hasCode
    [macrodef] creating macro dex-helper
    [macrodef] creating macro package-helper
    [macrodef] creating macro zipalign-helper
    [macrodef] creating macro run-tests-helper
    [macrodef] creating macro record-build-key
    [macrodef] creating macro record-build-info
    [macrodef] creating macro uninstall-helper
    Overriding previous definition of reference to ant.projectHelper
    Build sequence for target(s) `debug’ is [-set-mode-check, -set-debug-files, -che
    ck-env, -setup, -set-debug-mode, -debug-obfuscation-check, -pre-build, -build-se
    tup, -code-gen, -pre-compile, -compile, -post-compile, -obfuscate, -dex, -crunch
    , -package-resources, -package, -post-package, -do-debug, -post-build, debug]
    Complete build sequence is [-set-mode-check, -set-debug-files, -check-env, -setu
    p, -set-debug-mode, -debug-obfuscation-check, -pre-build, -build-setup, -code-ge
    n, -pre-compile, -compile, -post-compile, -obfuscate, -dex, -crunch, -package-re
    sources, -package, -post-package, -do-debug, -post-build, debug, -set-instrument
    ed-mode, instrument, emma, android_rules.-pre-build, android_rules.-release-obfu
    scation-check, android_rules.-setup, lint, android_rules.-release-sign, -test-pr
    oject-check, android_rules.nodeps, android_rules.-set-debug-files, android_rules
    .-set-debug-mode, -pre-clean, -release-nosign, install, installd, android_rules.
    installt, android_rules.-dex, -set-release-mode, android_rules.installr, android
    _rules.emma, android_rules.-release-nosign, android_rules.-pre-compile, android_
    rules.instrument, android_rules.uninstall, android_rules.installi, android_rules
    .lint, android_rules.-obfuscate, android_rules.clean, android_rules.installd, an
    droid_rules.-post-build, android_rules.-debug-obfuscation-check, android_rules.-
    compile, installt, help, -release-obfuscation-check, -release-prompt-for-passwor
    d, -release-sign, android_rules.release, installr, release, android_rules.-pre-c
    lean, android_rules.-post-compile, installi, android_rules.-code-gen, android_ru
    les.-release-prompt-for-password, android_rules.-package-resources, android_rule
    s.-set-mode-check, android_rules.-test-project-check, test, android_rules.help,
    android_rules.install, clean, android_rules.-do-debug, android_rules.-check-env,
    android_rules.-package, android_rules.-set-instrumented-mode, android_rules.-po
    st-package, android_rules.test, android_rules.debug, uninstall, android_rules.-b
    uild-setup, nodeps, android_rules.-crunch, , android_rules.-set-release-mode]

    -set-mode-check:

    -set-debug-files:

    -check-env:
    [checkenv] Android SDK Tools Revision 22.2.1
    [checkenv] Installed at C:Androidandroidsdk

    -setup:
    [echo] Project Name: AndroidTestProject
    [gettype] Project Type: Application

    -set-debug-mode:
    Property “emma.enabled” has not been set

    -debug-obfuscation-check:

    -pre-build:

    -build-setup:
    [getbuildtools] Using latest Build Tools: 18.1.1
    [property] Loading C:CodingAndroidAndroidTestProjectAndroidTestProjectbin
    build.prop
    [property] Unable to find property file: C:CodingAndroidAndroidTestProjectA
    ndroidTestProjectbinbuild.prop
    [echo] Resolving Build Target for AndroidTestProject…
    [gettarget] Project Target: Android 3.0
    [gettarget] API level: 11
    [echo]

    [echo] Creating output directories if needed…
    [mkdir] Skipping C:CodingAndroidAndroidTestProjectAndroidTestProjectres
    because it already exists.
    [mkdir] Skipping C:CodingAndroidAndroidTestProjectAndroidTestProjectlib
    s because it already exists.
    [mkdir] Skipping C:CodingAndroidAndroidTestProjectAndroidTestProjectbin
    because it already exists.
    [mkdir] Skipping C:CodingAndroidAndroidTestProjectAndroidTestProjectbin
    res because it already exists.
    [mkdir] Created dir: C:CodingAndroidAndroidTestProjectAndroidTestProject
    binrsObj
    [mkdir] Created dir: C:CodingAndroidAndroidTestProjectAndroidTestProject
    binrsLibs
    [mkdir] Skipping C:CodingAndroidAndroidTestProjectAndroidTestProjectgen
    because it already exists.
    [mkdir] Skipping C:CodingAndroidAndroidTestProjectAndroidTestProjectbin
    classes because it already exists.
    [mkdir] Skipping C:CodingAndroidAndroidTestProjectAndroidTestProjectbin
    dexedLibs because it already exists.
    [echo]

    [echo] Resolving Dependencies for AndroidTestProject…
    [dependency] Library dependencies:
    [dependency] No Libraries
    [dependency]
    [dependency]

    [dependency] API<=15: Adding annotations.jar to the classpath.
    [echo]

    [echo] Building Libraries with ‘debug’…
    [subant] No sub-builds to iterate on

    -code-gen:
    [mergemanifest] Found Deleted Target File
    [mergemanifest] Merging AndroidManifest files into one.
    [mergemanifest] Manifest merger disabled. Using project manifest only.
    [echo] Handling aidl files…
    [aidl] No AIDL files to compile.
    [echo]

    [echo] Handling RenderScript files…
    [echo]

    [echo] Handling Resources…
    Property “android.library” has not been set
    [aapt] Found Deleted Target File
    [aapt] Generating resource IDs…
    [aapt] Current OS is Windows 8
    [aapt] Executing ‘C:Androidandroidsdkbuild-tools18.1.1aapt.exe’ with a
    rguments:
    [aapt] ‘package’
    [aapt] ‘-f’
    [aapt] ‘-m’
    [aapt] ‘-M’
    [aapt] ‘C:CodingAndroidAndroidTestProjectAndroidTestProjectbinAndroid
    Manifest.xml’
    [aapt] ‘-S’
    [aapt] ‘C:CodingAndroidAndroidTestProjectAndroidTestProjectbinres’
    [aapt] ‘-S’
    [aapt] ‘C:CodingAndroidAndroidTestProjectAndroidTestProjectres’
    [aapt] ‘-I’
    [aapt] ‘C:Androidandroidsdkplatformsandroid-11android.jar’
    [aapt] ‘-J’
    [aapt] ‘C:CodingAndroidAndroidTestProjectAndroidTestProjectgen’
    [aapt] ‘–generate-dependencies’
    [aapt] ‘-G’
    [aapt] ‘C:CodingAndroidAndroidTestProjectAndroidTestProjectbinproguar
    d.txt’
    [aapt]
    [aapt] The ‘ characters around the executable and arguments are
    [aapt] not part of the command.
    [echo]

    [echo] Handling BuildConfig class…
    [buildconfig] Generating BuildConfig class.

    -pre-compile:

    -compile:
    [javac] comvisualgdbexampleAndroidTestProjectAndroidTestProject.java omi
    tted as C:CodingAndroidAndroidTestProjectAndroidTestProjectbinclassescom
    visualgdbexampleAndroidTestProjectAndroidTestProject.class is up to date.
    [javac] C:CodingAndroidAndroidTestProjectAndroidTestProjectgenR.java.d
    skipped – don’t know how to handle it
    [javac] comvisualgdbexampleAndroidTestProjectBuildConfig.java added as c
    omvisualgdbexampleAndroidTestProjectBuildConfig.class is outdated.
    [javac] comvisualgdbexampleAndroidTestProjectR.java added as comvisualg
    dbexampleAndroidTestProjectR.class is outdated.
    [javac] Compiling 2 source files to C:CodingAndroidAndroidTestProjectAnd
    roidTestProjectbinclasses
    [javac] Using modern compiler
    [javac] Compilation arguments:
    [javac] ‘-d’
    [javac] ‘C:CodingAndroidAndroidTestProjectAndroidTestProjectbinclasses

    [javac] ‘-classpath’
    [javac] ‘C:CodingAndroidAndroidTestProjectAndroidTestProjectbinclasses
    ;C:Androidandroidsdktoolssupportannotations.jar’
    [javac] ‘-sourcepath’
    [javac] ‘C:CodingAndroidAndroidTestProjectAndroidTestProjectsrc;C:Codi
    ngAndroidAndroidTestProjectAndroidTestProjectgen’
    [javac] ‘-target’
    [javac] ‘1.5’
    [javac] ‘-bootclasspath’
    [javac] ‘C:Androidandroidsdkplatformsandroid-11android.jar’
    [javac] ‘-encoding’
    [javac] ‘UTF-8’
    [javac] ‘-g’
    [javac] ‘-source’
    [javac] ‘1.5’
    [javac]
    [javac] The ‘ characters around the executable and arguments are
    [javac] not part of the command.
    [javac] Files to be compiled:
    [javac] C:CodingAndroidAndroidTestProjectAndroidTestProjectgencom
    visualgdbexampleAndroidTestProjectBuildConfig.java
    [javac] C:CodingAndroidAndroidTestProjectAndroidTestProjectgencom
    visualgdbexampleAndroidTestProjectR.java

    -post-compile:

    -obfuscate:

    -dex:
    [dex] input: C:CodingAndroidAndroidTestProjectAndroidTestProjectbinc
    lasses
    [dex] input: C:Androidandroidsdktoolssupportannotations.jar
    [dex] Pre-Dexing C:Androidandroidsdktoolssupportannotations.jar -> an
    notations-228aad0ce656144a82ee23e0eb535178.jar
    [dx] Current OS is Windows 8
    [dx] Executing ‘C:Androidandroidsdkbuild-tools18.1.1dx.bat’ with arg
    uments:
    [dx] ‘–dex’
    [dx] ‘–output’
    [dx] ‘C:CodingAndroidAndroidTestProjectAndroidTestProjectbindexedLi
    bsannotations-228aad0ce656144a82ee23e0eb535178.jar’
    [dx] ‘C:Androidandroidsdktoolssupportannotations.jar’
    [dx]
    [dx] The ‘ characters around the executable and arguments are
    [dx] not part of the command.
    [dx] ‘C:Program’ is not recognized as an internal or external command,
    [dx] operable program or batch file.

    BUILD FAILED
    C:Androidandroidsdktoolsantbuild.xml:892: The following error occurred whil
    e executing this line:
    C:Androidandroidsdktoolsantbuild.xml:894: The following error occurred whil
    e executing this line:
    C:Androidandroidsdktoolsantbuild.xml:906: The following error occurred whil
    e executing this line:
    C:Androidandroidsdktoolsantbuild.xml:284: null returned: 1
    at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:643)
    at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:669)
    at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:495)
    at com.android.ant.DexExecTask.runDx(DexExecTask.java:271)
    at com.android.ant.DexExecTask.runDx(DexExecTask.java:234)
    at com.android.ant.DexExecTask.preDexLibraries(DexExecTask.java:153)
    at com.android.ant.DexExecTask.execute(DexExecTask.java:209)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
    a:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
    a:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.jav
    a:396)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
    a:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
    at com.android.ant.IfElseTask.execute(IfElseTask.java:124)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
    a:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
    at com.android.ant.IfElseTask.execute(IfElseTask.java:124)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
    a:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
    a:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.jav
    a:396)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
    a:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
    at com.android.ant.IfElseTask.execute(IfElseTask.java:120)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
    a:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
    a:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.jav
    a:396)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
    a:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:435)
    at org.apache.tools.ant.Target.performTasks(Target.java:456)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
    cutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
    at org.apache.tools.ant.Main.runBuild(Main.java:851)
    at org.apache.tools.ant.Main.startAnt(Main.java:235)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

    Total time: 1 second

    #2697
    ket
    Participant

    Hi,

    The strange line in the output is the following:

    [dx] 'C:Program' is not recognized as an internal or external command,

    As the only tool installed in Program Files is JDK and it is the only tool that is not up to date, try downloading and installing the latest JDK (32-bit version as Android requires it). Make sure you reference it also in VisualGDB Android settings. Check that you do not have any conflicting JAVA_HOME environmental variables set in your system. Then try rebuilding your project, clean it first, manually delete the build.xml and local.properties from the project’s directory if cleaning does not do that.

    If this does not help, try running Visual Studio as an admin as it could also be a user access rights issue.

    #2696
    Anonymous
    Participant

    I’m afraid that the problem does not appear to be resolved, however. Should I uninstall and reinstall the new JDK in a directory other than “Program Files (x86)”? I’m a little concerned to do this because I do a lot of Java development and I’m a little worried that programs like NetBeans and Eclipse may not like the move.

    I also noticed that when you upgrade the JDK, you must then manually edit the PATH variable to point it to the JDK bin (it defaults to the JRE bin and this messes up ANT).

    Anyway, here is the output from the ANT run and it basically looks the same.

    C:CodingAndroidAndroidTestProjectAndroidTestProject>C:Androidapacheantbin
    ant.bat debug -v
    Unable to locate tools.jar. Expected to find it in C:Program Files (x86)Javaj
    re7libtools.jar
    Apache Ant(TM) version 1.9.2 compiled on July 8 2013
    Trying the default build file: build.xml
    Buildfile: C:CodingAndroidAndroidTestProjectAndroidTestProjectbuild.xml
    Detected Java version: 1.7 in: C:Program Files (x86)Javajre7
    Detected OS: Windows 8
    parsing buildfile C:CodingAndroidAndroidTestProjectAndroidTestProjectbuild.
    xml with URI = file:/C:/Coding/Android/AndroidTestProject/AndroidTestProject/bui
    ld.xml
    Project base dir set to: C:CodingAndroidAndroidTestProjectAndroidTestProject

    parsing buildfile jar:file:/C:/Android/apacheant/lib/ant.jar!/org/apache/tools/a
    nt/antlib.xml with URI = jar:file:/C:/Android/apacheant/lib/ant.jar!/org/apache/
    tools/ant/antlib.xml from a zip file
    [property] Loading C:CodingAndroidAndroidTestProjectAndroidTestProjectloca
    l.properties
    [property] Loading C:CodingAndroidAndroidTestProjectAndroidTestProjectant.
    properties
    [property] Unable to find property file: C:CodingAndroidAndroidTestProjectA
    ndroidTestProjectant.properties
    [property] Loading Environment env.
    Property “env.ANDROID_HOME” has not been set
    Importing file C:CodingAndroidAndroidTestProjectAndroidTestProjectcustom_ru
    les.xml from C:CodingAndroidAndroidTestProjectAndroidTestProjectbuild.xml
    Cannot find C:CodingAndroidAndroidTestProjectAndroidTestProjectcustom_rules
    .xml imported from C:CodingAndroidAndroidTestProjectAndroidTestProjectbuild
    .xml
    Importing file C:Androidandroidsdktoolsantbuild.xml from C:CodingAndroid
    AndroidTestProjectAndroidTestProjectbuild.xml
    Overriding previous definition of reference to ant.projectHelper
    parsing buildfile C:Androidandroidsdktoolsantbuild.xml with URI = file:/C:/
    Android/androidsdk/tools/ant/build.xml
    Property “key.store” has not been set
    [macrodef] creating macro do-only-if-not-library
    [macrodef] creating macro do-only-if-manifest-hasCode
    [macrodef] creating macro dex-helper
    [macrodef] creating macro package-helper
    [macrodef] creating macro zipalign-helper
    [macrodef] creating macro run-tests-helper
    [macrodef] creating macro record-build-key
    [macrodef] creating macro record-build-info
    [macrodef] creating macro uninstall-helper
    Overriding previous definition of reference to ant.projectHelper
    Build sequence for target(s) `debug’ is [-set-mode-check, -set-debug-files, -che
    ck-env, -setup, -set-debug-mode, -debug-obfuscation-check, -pre-build, -build-se
    tup, -code-gen, -pre-compile, -compile, -post-compile, -obfuscate, -dex, -crunch
    , -package-resources, -package, -post-package, -do-debug, -post-build, debug]
    Complete build sequence is [-set-mode-check, -set-debug-files, -check-env, -setu
    p, -set-debug-mode, -debug-obfuscation-check, -pre-build, -build-setup, -code-ge
    n, -pre-compile, -compile, -post-compile, -obfuscate, -dex, -crunch, -package-re
    sources, -package, -post-package, -do-debug, -post-build, debug, -set-instrument
    ed-mode, instrument, emma, android_rules.-pre-build, android_rules.-release-obfu
    scation-check, android_rules.-setup, lint, android_rules.-release-sign, -test-pr
    oject-check, android_rules.nodeps, android_rules.-set-debug-files, android_rules
    .-set-debug-mode, -pre-clean, -release-nosign, install, installd, android_rules.
    installt, android_rules.-dex, -set-release-mode, android_rules.installr, android
    _rules.emma, android_rules.-release-nosign, android_rules.-pre-compile, android_
    rules.instrument, android_rules.uninstall, android_rules.installi, android_rules
    .lint, android_rules.-obfuscate, android_rules.clean, android_rules.installd, an
    droid_rules.-post-build, android_rules.-debug-obfuscation-check, android_rules.-
    compile, installt, help, -release-obfuscation-check, -release-prompt-for-passwor
    d, -release-sign, android_rules.release, installr, release, android_rules.-pre-c
    lean, android_rules.-post-compile, installi, android_rules.-code-gen, android_ru
    les.-release-prompt-for-password, android_rules.-package-resources, android_rule
    s.-set-mode-check, android_rules.-test-project-check, test, android_rules.help,
    android_rules.install, clean, android_rules.-do-debug, android_rules.-check-env,
    android_rules.-package, android_rules.-set-instrumented-mode, android_rules.-po
    st-package, android_rules.test, android_rules.debug, uninstall, android_rules.-b
    uild-setup, nodeps, android_rules.-crunch, , android_rules.-set-release-mode]

    -set-mode-check:

    -set-debug-files:

    -check-env:
    [checkenv] Android SDK Tools Revision 22.2.1
    [checkenv] Installed at C:Androidandroidsdk

    -setup:
    [echo] Project Name: AndroidTestProject
    [gettype] Project Type: Application

    -set-debug-mode:
    Property “emma.enabled” has not been set

    -debug-obfuscation-check:

    -pre-build:

    -build-setup:
    [getbuildtools] Using latest Build Tools: 18.1.1
    [property] Loading C:CodingAndroidAndroidTestProjectAndroidTestProjectbin
    build.prop
    [property] Unable to find property file: C:CodingAndroidAndroidTestProjectA
    ndroidTestProjectbinbuild.prop
    [echo] Resolving Build Target for AndroidTestProject…
    [gettarget] Project Target: Android 3.0
    [gettarget] API level: 11
    [echo]

    [echo] Creating output directories if needed…
    [mkdir] Skipping C:CodingAndroidAndroidTestProjectAndroidTestProjectres
    because it already exists.
    [mkdir] Skipping C:CodingAndroidAndroidTestProjectAndroidTestProjectlib
    s because it already exists.
    [mkdir] Skipping C:CodingAndroidAndroidTestProjectAndroidTestProjectbin
    because it already exists.
    [mkdir] Skipping C:CodingAndroidAndroidTestProjectAndroidTestProjectbin
    res because it already exists.
    [mkdir] Created dir: C:CodingAndroidAndroidTestProjectAndroidTestProject
    binrsObj
    [mkdir] Created dir: C:CodingAndroidAndroidTestProjectAndroidTestProject
    binrsLibs
    [mkdir] Skipping C:CodingAndroidAndroidTestProjectAndroidTestProjectgen
    because it already exists.
    [mkdir] Skipping C:CodingAndroidAndroidTestProjectAndroidTestProjectbin
    classes because it already exists.
    [mkdir] Skipping C:CodingAndroidAndroidTestProjectAndroidTestProjectbin
    dexedLibs because it already exists.
    [echo]

    [echo] Resolving Dependencies for AndroidTestProject…
    [dependency] Library dependencies:
    [dependency] No Libraries
    [dependency]
    [dependency]

    [dependency] API<=15: Adding annotations.jar to the classpath.
    [echo]

    [echo] Building Libraries with ‘debug’…
    [subant] No sub-builds to iterate on

    -code-gen:
    [mergemanifest] Found Deleted Target File
    [mergemanifest] Merging AndroidManifest files into one.
    [mergemanifest] Manifest merger disabled. Using project manifest only.
    [echo] Handling aidl files…
    [aidl] No AIDL files to compile.
    [echo]

    [echo] Handling RenderScript files…
    [echo]

    [echo] Handling Resources…
    Property “android.library” has not been set
    [aapt] Found Deleted Target File
    [aapt] Generating resource IDs…
    [aapt] Current OS is Windows 8
    [aapt] Executing ‘C:Androidandroidsdkbuild-tools18.1.1aapt.exe’ with a
    rguments:
    [aapt] ‘package’
    [aapt] ‘-f’
    [aapt] ‘-m’
    [aapt] ‘-M’
    [aapt] ‘C:CodingAndroidAndroidTestProjectAndroidTestProjectbinAndroid
    Manifest.xml’
    [aapt] ‘-S’
    [aapt] ‘C:CodingAndroidAndroidTestProjectAndroidTestProjectbinres’
    [aapt] ‘-S’
    [aapt] ‘C:CodingAndroidAndroidTestProjectAndroidTestProjectres’
    [aapt] ‘-I’
    [aapt] ‘C:Androidandroidsdkplatformsandroid-11android.jar’
    [aapt] ‘-J’
    [aapt] ‘C:CodingAndroidAndroidTestProjectAndroidTestProjectgen’
    [aapt] ‘–generate-dependencies’
    [aapt] ‘-G’
    [aapt] ‘C:CodingAndroidAndroidTestProjectAndroidTestProjectbinproguar
    d.txt’
    [aapt]
    [aapt] The ‘ characters around the executable and arguments are
    [aapt] not part of the command.
    [echo]

    [echo] Handling BuildConfig class…
    [buildconfig] Generating BuildConfig class.

    -pre-compile:

    -compile:
    [javac] comvisualgdbexampleAndroidTestProjectAndroidTestProject.java omi
    tted as C:CodingAndroidAndroidTestProjectAndroidTestProjectbinclassescom
    visualgdbexampleAndroidTestProjectAndroidTestProject.class is up to date.
    [javac] C:CodingAndroidAndroidTestProjectAndroidTestProjectgenR.java.d
    skipped – don’t know how to handle it
    [javac] comvisualgdbexampleAndroidTestProjectBuildConfig.java added as c
    omvisualgdbexampleAndroidTestProjectBuildConfig.class is outdated.
    [javac] comvisualgdbexampleAndroidTestProjectR.java added as comvisualg
    dbexampleAndroidTestProjectR.class is outdated.
    [javac] Compiling 2 source files to C:CodingAndroidAndroidTestProjectAnd
    roidTestProjectbinclasses
    [javac] Using modern compiler
    [javac] Compilation arguments:
    [javac] ‘-d’
    [javac] ‘C:CodingAndroidAndroidTestProjectAndroidTestProjectbinclasses

    [javac] ‘-classpath’
    [javac] ‘C:CodingAndroidAndroidTestProjectAndroidTestProjectbinclasses
    ;C:Androidandroidsdktoolssupportannotations.jar’
    [javac] ‘-sourcepath’
    [javac] ‘C:CodingAndroidAndroidTestProjectAndroidTestProjectsrc;C:Codi
    ngAndroidAndroidTestProjectAndroidTestProjectgen’
    [javac] ‘-target’
    [javac] ‘1.5’
    [javac] ‘-bootclasspath’
    [javac] ‘C:Androidandroidsdkplatformsandroid-11android.jar’
    [javac] ‘-encoding’
    [javac] ‘UTF-8’
    [javac] ‘-g’
    [javac] ‘-source’
    [javac] ‘1.5’
    [javac]
    [javac] The ‘ characters around the executable and arguments are
    [javac] not part of the command.
    [javac] Files to be compiled:
    [javac] C:CodingAndroidAndroidTestProjectAndroidTestProjectgencom
    visualgdbexampleAndroidTestProjectBuildConfig.java
    [javac] C:CodingAndroidAndroidTestProjectAndroidTestProjectgencom
    visualgdbexampleAndroidTestProjectR.java

    -post-compile:

    -obfuscate:

    -dex:
    [dex] input: C:CodingAndroidAndroidTestProjectAndroidTestProjectbinc
    lasses
    [dex] input: C:Androidandroidsdktoolssupportannotations.jar
    [dex] Pre-Dexing C:Androidandroidsdktoolssupportannotations.jar -> an
    notations-228aad0ce656144a82ee23e0eb535178.jar
    [dx] Current OS is Windows 8
    [dx] Executing ‘C:Androidandroidsdkbuild-tools18.1.1dx.bat’ with arg
    uments:
    [dx] ‘–dex’
    [dx] ‘–output’
    [dx] ‘C:CodingAndroidAndroidTestProjectAndroidTestProjectbindexedLi
    bsannotations-228aad0ce656144a82ee23e0eb535178.jar’
    [dx] ‘C:Androidandroidsdktoolssupportannotations.jar’
    [dx]
    [dx] The ‘ characters around the executable and arguments are
    [dx] not part of the command.
    [dx] ‘C:Program’ is not recognized as an internal or external command,
    [dx] operable program or batch file.

    BUILD FAILED
    C:Androidandroidsdktoolsantbuild.xml:892: The following error occurred whil
    e executing this line:
    C:Androidandroidsdktoolsantbuild.xml:894: The following error occurred whil
    e executing this line:
    C:Androidandroidsdktoolsantbuild.xml:906: The following error occurred whil
    e executing this line:
    C:Androidandroidsdktoolsantbuild.xml:284: null returned: 1
    at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:643)
    at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:669)
    at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:495)
    at com.android.ant.DexExecTask.runDx(DexExecTask.java:271)
    at com.android.ant.DexExecTask.runDx(DexExecTask.java:234)
    at com.android.ant.DexExecTask.preDexLibraries(DexExecTask.java:153)
    at com.android.ant.DexExecTask.execute(DexExecTask.java:209)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
    a:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
    a:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.jav
    a:396)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
    a:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
    at com.android.ant.IfElseTask.execute(IfElseTask.java:124)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
    a:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
    at com.android.ant.IfElseTask.execute(IfElseTask.java:124)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
    a:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
    a:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.jav
    a:396)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
    a:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
    at com.android.ant.IfElseTask.execute(IfElseTask.java:120)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
    a:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
    a:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.jav
    a:396)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
    a:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:435)
    at org.apache.tools.ant.Target.performTasks(Target.java:456)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
    cutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
    at org.apache.tools.ant.Main.runBuild(Main.java:851)
    at org.apache.tools.ant.Main.startAnt(Main.java:235)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

    Total time: 2 seconds

    #2698
    Anonymous
    Participant

    I have now found and fixed the problem. Apparently, the JDK must also be placed in a directory with no spaces. I copied the JDK into the directory C:/Android/jdk and it worked. I’m having some issues with the Android emulator, but the example works fine on a real device via a USB port. You might want to suggest to users that they install all dependencies in non-space directories. Is there a fix to VisualGDB for this?

    #2699
    ket
    Participant

    Hi,

    Normally it is no problem to have JDK installed in Program Files (x86). It should give no issues as Java based tools are fine with spaces in paths. It would take a special set of circumstances for the errors you have experienced to appear.
    You could try to have JDK still in Program Files but specify the JDK path in VisualGDB using %PROGRAMFILES(x86)% . Does that work?
    What exact fix in VisualGDB would you like to have?

    #2700
    Anonymous
    Participant

    I tried your suggestion of using %PROGRAMFILES(x86)%, and it will not accept it unless I then press “Detect”, at which point it simply expands the variable to “Program Files(x86)”. Then the code will no longer build. The change I was suggesting was simply something that would pass the variables to ANT in some intact manner so that these error do not come up. Otherwise, I would simply suggest that the tutorial explain that all 4 of the dependencies (SDK, NDK, ANT, and JDK) must be installed in non-space directories, even if this requires re-installation. This might save potential users a lot of time. Thanks for the help!

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.