Buildozer: ERROR: /home/ubuntu/.buildozer/android/platform/apache-ant-1.9.4/bin/ant failed!

Created on 25 Feb 2018  路  8Comments  路  Source: kivy/buildozer

I get this error running the buildozer --verbose android debug command.

image

Compiling /home/ubuntu/github/alterx/android_deployment/.buildozer/android/platform/build/dists/AlterX/private/lib/python2.7/xml/sax/xmlreader.py ...
[INFO]:    Selecting java build tool:
[INFO]:    Detected highest available build tools version to be 19.1.0
[INFO]:        Building with ant, as the highest build-tools-version is only 19.1.0
[DEBUG]:   -> running ant debug
[DEBUG]:        Buildfile: /home/ubuntu/github/alterx/android_deployment/.buildozer/android/platform/build/dists/AlterX/build.xml
[DEBUG]:
[DEBUG]:        -set-mode-check:
[DEBUG]:
[DEBUG]:        -set-debug-files:
[DEBUG]:
[DEBUG]:        -check-env:
[DEBUG]:         [checkenv] Android SDK Tools Revision 22.6.2
[DEBUG]:         [checkenv] Installed at /home/ubuntu/.buildozer/android/platform/android-sdk-20
[DEBUG]:
[DEBUG]:        -setup:
[DEBUG]:             [echo] Project Name: AlterX-1.10.1
[DEBUG]:          [gettype] Project Type: Application
[DEBUG]:
[DEBUG]:        -set-debug-mode:
[DEBUG]:
[DEBUG]:        -debug-obfuscation-check:
[DEBUG]:
[DEBUG]:        -pre-build:
[DEBUG]:             [copy] Copying 25 files to /home/ubuntu/github/alterx/android_deployment/.buildozer/android/platform/build/dists/AlterX/tmp-src
[DEBUG]:
[DEBUG]:        -build-setup:
[DEBUG]:        [getbuildtools] Using latest Build Tools: 19.1.0
[DEBUG]:             [echo] Resolving Build Target for AlterX-1.10.1...
[DEBUG]:        [gettarget] Project Target:   Android 4.4.2
[DEBUG]:        [gettarget] API level:        19
[DEBUG]:             [echo] ----------
[DEBUG]:             [echo] Creating output directories if needed...
[DEBUG]:            [mkdir] Created dir: /home/ubuntu/github/alterx/android_deployment/.buildozer/android/platform/build/dists/AlterX/bin
[DEBUG]:            [mkdir] Created dir: /home/ubuntu/github/alterx/android_deployment/.buildozer/android/platform/build/dists/AlterX/bin/res
[DEBUG]:            [mkdir] Created dir: /home/ubuntu/github/alterx/android_deployment/.buildozer/android/platform/build/dists/AlterX/bin/rsObj
[DEBUG]:            [mkdir] Created dir: /home/ubuntu/github/alterx/android_deployment/.buildozer/android/platform/build/dists/AlterX/bin/rsLibs
[DEBUG]:            [mkdir] Created dir: /home/ubuntu/github/alterx/android_deployment/.buildozer/android/platform/build/dists/AlterX/gen
[DEBUG]:            [mkdir] Created dir: /home/ubuntu/github/alterx/android_deployment/.buildozer/android/platform/build/dists/AlterX/bin/classes
[DEBUG]:            [mkdir] Created dir: /home/ubuntu/github/alterx/android_deployment/.buildozer/android/platform/build/dists/AlterX/bin/dexedLibs
[DEBUG]:             [echo] ----------
[DEBUG]:             [echo] Resolving Dependencies for AlterX-1.10.1...
[DEBUG]:        [dependency] Library dependencies:
[DEBUG]:        [dependency] No Libraries
[DEBUG]:        [dependency]
[DEBUG]:        [dependency] ------------------
[DEBUG]:             [echo] ----------
[DEBUG]:             [echo] Building Libraries with 'debug'...
[DEBUG]:           [subant] No sub-builds to iterate on
[DEBUG]:
[DEBUG]:        -code-gen:
[DEBUG]:        [mergemanifest] Merging AndroidManifest files into one.
[DEBUG]:        [mergemanifest] Manifest merger disabled. Using project manifest only.
[DEBUG]:             [echo] Handling aidl files...
[DEBUG]:             [aidl] No AIDL files to compile.
[DEBUG]:             [echo] ----------
[DEBUG]:             [echo] Handling RenderScript files...
[DEBUG]:             [echo] ----------
[DEBUG]:             [echo] Handling Resources...
[DEBUG]:             [aapt] Generating resource IDs...
[DEBUG]:             [aapt]     (skipping file '.gitkeep' due to ANDROID_AAPT_IGNORE pattern '.*')
[DEBUG]:             [echo] ----------
[DEBUG]:             [echo] Handling BuildConfig class...
[DEBUG]:        [buildconfig] Generating BuildConfig class.
[DEBUG]:
[DEBUG]:        -pre-compile:
[DEBUG]:
[DEBUG]:        -compile:
[DEBUG]:            [javac] Compiling 26 source files to /home/ubuntu/github/alterx/android_deployment/.buildozer/android/platform/build/dists/AlterX/bin/classes
[DEBUG]:            [javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
[DEBUG]:            [javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
[DEBUG]:            [javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
[DEBUG]:            [javac] /home/ubuntu/github/alterx/android_deployment/.buildozer/android/platform/build/dists/AlterX/tmp-src/org/kivy/android/PythonService.java:108: error: multi-catch statement is not supported in -source 1.5
[DEBUG]:            [javac]             } catch (NoSuchMethodException | IllegalAccessException |
[DEBUG]:            [javac]                                            ^
[DEBUG]:            [javac]   (use -source 7 or higher to enable multi-catch statement)
[DEBUG]:            [javac] 1 error
[DEBUG]:            [javac] 3 warnings
[DEBUG]:
[DEBUG]:        BUILD FAILED
[DEBUG]:        /home/ubuntu/.buildozer/android/platform/android-sdk-20/tools/ant/build.xml:720: The following error occurred while executing this line:
[DEBUG]:        /home/ubuntu/.buildozer/android/platform/android-sdk-20/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.
[DEBUG]:
[DEBUG]:        Total time: 1 second
Exception in thread background thread for pid 4825:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/local/lib/python2.7/dist-packages/sh.py", line 2170, in background_thread
    handle_exit_code(exit_code)
  File "/usr/local/lib/python2.7/dist-packages/sh.py", line 1929, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/usr/local/lib/python2.7/dist-packages/sh.py", line 672, in handle_command_exit_code
    raise exc
ErrorReturnCode_1:

  RAN: /home/ubuntu/.buildozer/android/platform/apache-ant-1.9.4/bin/ant debug

  STDOUT:
Buildfile: /home/ubuntu/github/alterx/android_deployment/.buildozer/android/platform/build/dists/AlterX/build.xml

-set-mode-check:

-set-debug-files:

-check-env:
 [checkenv] Android SDK Tools Revision 22.6.2
 [checkenv] Installed at /home/ubuntu/.buildozer/android/platform/android-sdk-20

-setup:
     [echo] Project Name: AlterX-1.10.1
  [gettype] Project Type: Application

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:
     [copy] Copying 25 files to /home/ubuntu/github/alterx/android_deployment/.buildozer/android/platform/build/dists/AlterX/tmp-src

-build-setup:
[getbuildtools] Using latest Build Tools: 19.1.0
     [echo] Resolving Build Target for AlterX-1.10.1...
[gettarget] Project Target:   Android 4.4.2
[gettarget] API level:        19
     [echo] ----------
     [echo] Creating output directories if needed...
    [mkdir] Created dir: /home/ubuntu/github/alterx/android_deployment/.buildozer/android/platform/build/dists/AlterX/bin
    [mkdir] Created dir: /home/ubuntu/github/alterx/android_deployment/.buildozer/android/platform/build/dists/AlterX/bin/res
    [mkdir] Created dir: /home/ubuntu/github/alterx/android_deployment/.buildozer/android/platform/build/dists/AlterX/bin/rsObj
    [mkdir] Created dir: /home/ubuntu/github/alterx/android_deployment/.buildozer/android/platform/build/dists/AlterX/bin/rsLibs
    [mkdir] Created dir: /home/ubuntu/github/alterx/android_deployment/.buildozer/android/platform/build/dists/AlterX/gen
    [mkdir] Created dir: /home/ubuntu/github/alterx/android_deployment/.buildozer/android/platform/build/dists/AlterX/bin/classes
    [mkdir] Created dir: /home/ubuntu/github/alterx/android_deployment/.buildozer/android/platform/build/dists/AlterX/bin/dexedLibs
     [echo] ----------
     [echo] Resolving Dependencies for AlterX-1.10.1...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
     [echo] ----------
     [echo] Building Libraries with 'debug'...
   [subant] No sub-builds to iterate on

-code-gen:
[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...
     [aapt] Generating resource IDs...
     [aapt]     (skipping file '.gitkeep' due to ANDROID_AAPT_IGNORE pattern '.*')
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.

-pre-compile:

-compile:
    [javac] Compiling 26 source files to /home/ubuntu/github/alterx/android_deployment/.buildozer/android/platform/build/dists/AlterX/bin/classes
    [javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
    [javac] /home/ubuntu/github/alterx/android_deployment/.buildozer/android/platform/build/dists/AlterX/tmp-src/org/kivy/android/PythonService.java:108: error: multi-catch statement is not supported in -source 1.5
    [javac]             } catch (NoSuchMethodException | IllegalAccessException |
    [javac]                                            ^
    [javac]   (use -source 7 or higher to enable multi-catch statement)
    [javac] 1 error
    [javac] 3 warnings

BUILD FAILED
/home/ubuntu/.buildozer/android/platform/android-sdk-20/tools/ant/build.xml:720: The following error occurred while executing this line:
/home/ubuntu/.buildozer/android/platform/android-sdk-20/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.

Total time: 1 second


  STDERR:


[INFO]:    STDOUT (last 20 lines of 79):

-pre-compile:

-compile:
    [javac] Compiling 26 source files to /home/ubuntu/github/alterx/android_deployment/.buildozer/android/platform/build/dists/AlterX/bin/classes
    [javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
    [javac] /home/ubuntu/github/alterx/android_deployment/.buildozer/android/platform/build/dists/AlterX/tmp-src/org/kivy/android/PythonService.java:108: error: multi-catch statement is not supported in -source 1.5
    [javac]             } catch (NoSuchMethodException | IllegalAccessException |
    [javac]                                            ^
    [javac]   (use -source 7 or higher to enable multi-catch statement)
    [javac] 1 error
    [javac] 3 warnings

BUILD FAILED
/home/ubuntu/.buildozer/android/platform/android-sdk-20/tools/ant/build.xml:720: The following error occurred while executing this line:
/home/ubuntu/.buildozer/android/platform/android-sdk-20/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.

Total time: 1 second
[INFO]:    STDERR:

[INFO]:    COMMAND:
cd /home/ubuntu/github/alterx/android_deployment/.buildozer/android/platform/build/dists/AlterX && /home/ubuntu/.buildozer/android/platform/apache-ant-1.9.4/bin/ant debug

[WARNING]: ERROR: /home/ubuntu/.buildozer/android/platform/apache-ant-1.9.4/bin/ant failed!
WARNING: Received a --sdk argument, but this argument is deprecated and does nothing.
# Command failed: /usr/bin/python -m pythonforandroid.toolchain apk --debug --bootstrap=sdl2 --dist_name AlterX --name AlterX --version 1.10.1 --package org.mobtech.alterx --android_api 19 --sdk 19 --minsdk 9 --private /home/ubuntu/github/alterx/android_deployment/.buildozer/android/app --permission INTERNET --presplash /home/ubuntu/github/alterx/android_deployment/../src/images/logo_earth.png --icon /home/ubuntu/github/alterx/android_deployment/../src/images/logo_earth.png --orientation landscape --copy-libs --arch armeabi-v7a --color=always --storage-dir=/home/ubuntu/github/alterx/android_deployment/.buildozer/android/platform/build
#
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2

Most helpful comment

I got same error but solved.

android-sdk-20/tools/ant/build.xml
android-sdk-20/tools/ant/uibuild.xml

    <property name="java.target" value="1.5" />
    <property name="java.source" value="1.5" />

to

    <property name="java.target" value="1.7" />
    <property name="java.source" value="1.7" />

All 8 comments

the same error in buildozer VM.

I got same error but solved.

android-sdk-20/tools/ant/build.xml
android-sdk-20/tools/ant/uibuild.xml

    <property name="java.target" value="1.5" />
    <property name="java.source" value="1.5" />

to

    <property name="java.target" value="1.7" />
    <property name="java.source" value="1.7" />

It didn't work

Changing to 1.7 worked for me.

Well the error says:

[DEBUG]:            [javac]   (use -source 7 or higher to enable multi-catch statement)

So change it to from 1.5 to 7 in ~/.buildozer/android/platform/android-sdk-20/tools/ant/build.xml or whatever file is complaining.

worked for me in ubuntu 18.04

Changing to 1.7 worked for me.

Closing as stale, ant is no longer used.

Was this page helpful?
0 / 5 - 0 ratings