views:

118

answers:

1

So I created my build.xml from scratch using the android utility:

$ /opt/android-sdk-linux_86/tools/android create project --target android-6 --name Dash --path . --activity Main --package com.gtosoft.dash

Then I try to kick off a compile, but it fails!

$ ant release
Buildfile: build.xml
    [setup] Android SDK Tools Revision 6
    [setup] Project Target: Android 2.0.1
    [setup] API level: 6
    [setup] WARNING: Attribute minSdkVersion in AndroidManifest.xml (5) is lower than the project target API level (6)
    [setup] Importing rules file: platforms/android-6/templates/android_rules.xml

-dirs:
     [echo] Creating output directories if needed...

-resource-src:
     [echo] Generating R.java / Manifest.java from the resources...

-aidl:
     [echo] Compiling aidl files into Java classes...

compile:
    [javac] Compiling 1 source file to /home/brad/Desktop/android/eclipse/Dash/bin/classes

-dex:
     [echo] Converting compiled files and external libraries into /home/brad/Desktop/android/eclipse/Dash/bin/classes.dex...
     [echo]          

-package-resources:
     [echo] Packaging resources
 [aaptexec] Creating full resource package...

-package-no-sign:
[apkbuilder] Creating Dash-unsigned.apk for release...

BUILD FAILED
/opt/android-sdk-linux_86/platforms/android-6/templates/android_rules.xml:286: The following error occurred while executing this line:
/opt/android-sdk-linux_86/platforms/android-6/templates/android_rules.xml:152: java.lang.NoClassDefFoundError: com.android.jarutils.SignedJarBuilder

Total time: 16 seconds

I'm at a loss for why it's complaining about com.android.jarutils.SignedJarBuilder

EDIT: After re-installing the SDK I have the same problem :(

$ ant -v release:

BUILD FAILED
/opt/android-sdk-linux_86/platforms/android-7/ant/ant_rules_r2.xml:301: The following error occurred while executing this line:
/opt/android-sdk-linux_86/platforms/android-7/ant/ant_rules_r2.xml:156: java.lang.NoClassDefFoundError: com.android.jarutils.SignedJarBuilder
   at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ant-1.7.1.jar.so)
   at org.apache.tools.ant.taskdefs.MacroInstance.execute(ant-1.7.1.jar.so)
   at org.apache.tools.ant.UnknownElement.execute(ant-1.7.1.jar.so)
   at java.lang.reflect.Method.invoke(libgcj.so.9)
   at org.apache.tools.ant.dispatch.DispatchUtils.execute(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Task.perform(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Target.execute(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Target.performTasks(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Project.executeSortedTargets(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Project.executeTarget(ant-1.7.1.jar.so)
   at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Project.executeTargets(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Main.runBuild(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Main.startAnt(ant-1.7.1.jar.so)
   at org.apache.tools.ant.launch.Launcher.run(ant-launcher-1.7.1.jar.so)
   at org.apache.tools.ant.launch.Launcher.main(ant-launcher-1.7.1.jar.so)
Caused by: /opt/android-sdk-linux_86/platforms/android-7/ant/ant_rules_r2.xml:156: java.lang.NoClassDefFoundError: com.android.jarutils.SignedJarBuilder
   at org.apache.tools.ant.dispatch.DispatchUtils.execute(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Task.perform(ant-1.7.1.jar.so)
   at org.apache.tools.ant.taskdefs.Sequential.execute(ant-1.7.1.jar.so)
   at org.apache.tools.ant.UnknownElement.execute(ant-1.7.1.jar.so)
   at java.lang.reflect.Method.invoke(libgcj.so.9)
   at org.apache.tools.ant.dispatch.DispatchUtils.execute(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Task.perform(ant-1.7.1.jar.so)
   ...15 more
Caused by: java.lang.NoClassDefFoundError: com.android.jarutils.SignedJarBuilder
   at java.lang.Class.initializeClass(libgcj.so.9)
   at com.android.apkbuilder.internal.ApkBuilderImpl.createPackage(ApkBuilderImpl.java:397)
   at com.android.ant.ApkBuilderTask.createApk(ApkBuilderTask.java:342)
   at com.android.ant.ApkBuilderTask.execute(ApkBuilderTask.java:238)
   at org.apache.tools.ant.UnknownElement.execute(ant-1.7.1.jar.so)
   at java.lang.reflect.Method.invoke(libgcj.so.9)
   at org.apache.tools.ant.dispatch.DispatchUtils.execute(ant-1.7.1.jar.so)
   ...21 more
Caused by: java.lang.ClassNotFoundException: sun.security.x509.AlgorithmId
   at org.apache.tools.ant.AntClassLoader.findClassInComponents(ant-1.7.1.jar.so)
   at org.apache.tools.ant.AntClassLoader.findClass(ant-1.7.1.jar.so)
   at org.apache.tools.ant.AntClassLoader.loadClass(ant-1.7.1.jar.so)
   at java.lang.ClassLoader.loadClass(libgcj.so.9)
   at java.lang.Class.initializeClass(libgcj.so.9)
   ...27 more
--- Nested Exception ---
/opt/android-sdk-linux_86/platforms/android-7/ant/ant_rules_r2.xml:156: java.lang.NoClassDefFoundError: com.android.jarutils.SignedJarBuilder
   at org.apache.tools.ant.dispatch.DispatchUtils.execute(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Task.perform(ant-1.7.1.jar.so)
   at org.apache.tools.ant.taskdefs.Sequential.execute(ant-1.7.1.jar.so)
   at org.apache.tools.ant.UnknownElement.execute(ant-1.7.1.jar.so)
   at java.lang.reflect.Method.invoke(libgcj.so.9)
   at org.apache.tools.ant.dispatch.DispatchUtils.execute(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Task.perform(ant-1.7.1.jar.so)
   at org.apache.tools.ant.taskdefs.MacroInstance.execute(ant-1.7.1.jar.so)
   at org.apache.tools.ant.UnknownElement.execute(ant-1.7.1.jar.so)
   at java.lang.reflect.Method.invoke(libgcj.so.9)
   at org.apache.tools.ant.dispatch.DispatchUtils.execute(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Task.perform(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Target.execute(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Target.performTasks(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Project.executeSortedTargets(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Project.executeTarget(ant-1.7.1.jar.so)
   at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Project.executeTargets(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Main.runBuild(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Main.startAnt(ant-1.7.1.jar.so)
   at org.apache.tools.ant.launch.Launcher.run(ant-launcher-1.7.1.jar.so)
   at org.apache.tools.ant.launch.Launcher.main(ant-launcher-1.7.1.jar.so)
Caused by: java.lang.NoClassDefFoundError: com.android.jarutils.SignedJarBuilder
   at java.lang.Class.initializeClass(libgcj.so.9)
   at com.android.apkbuilder.internal.ApkBuilderImpl.createPackage(ApkBuilderImpl.java:397)
   at com.android.ant.ApkBuilderTask.createApk(ApkBuilderTask.java:342)
   at com.android.ant.ApkBuilderTask.execute(ApkBuilderTask.java:238)
   at org.apache.tools.ant.UnknownElement.execute(ant-1.7.1.jar.so)
   at java.lang.reflect.Method.invoke(libgcj.so.9)
   at org.apache.tools.ant.dispatch.DispatchUtils.execute(ant-1.7.1.jar.so)
   ...21 more
Caused by: java.lang.ClassNotFoundException: sun.security.x509.AlgorithmId
   at org.apache.tools.ant.AntClassLoader.findClassInComponents(ant-1.7.1.jar.so)
   at org.apache.tools.ant.AntClassLoader.findClass(ant-1.7.1.jar.so)
   at org.apache.tools.ant.AntClassLoader.loadClass(ant-1.7.1.jar.so)
   at java.lang.ClassLoader.loadClass(libgcj.so.9)
   at java.lang.Class.initializeClass(libgcj.so.9)
   ...27 more
--- Nested Exception ---
java.lang.NoClassDefFoundError: com.android.jarutils.SignedJarBuilder
   at java.lang.Class.initializeClass(libgcj.so.9)
   at com.android.apkbuilder.internal.ApkBuilderImpl.createPackage(ApkBuilderImpl.java:397)
   at com.android.ant.ApkBuilderTask.createApk(ApkBuilderTask.java:342)
   at com.android.ant.ApkBuilderTask.execute(ApkBuilderTask.java:238)
   at org.apache.tools.ant.UnknownElement.execute(ant-1.7.1.jar.so)
   at java.lang.reflect.Method.invoke(libgcj.so.9)
   at org.apache.tools.ant.dispatch.DispatchUtils.execute(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Task.perform(ant-1.7.1.jar.so)
   at org.apache.tools.ant.taskdefs.Sequential.execute(ant-1.7.1.jar.so)
   at org.apache.tools.ant.UnknownElement.execute(ant-1.7.1.jar.so)
   at java.lang.reflect.Method.invoke(libgcj.so.9)
   at org.apache.tools.ant.dispatch.DispatchUtils.execute(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Task.perform(ant-1.7.1.jar.so)
   at org.apache.tools.ant.taskdefs.MacroInstance.execute(ant-1.7.1.jar.so)
   at org.apache.tools.ant.UnknownElement.execute(ant-1.7.1.jar.so)
   at java.lang.reflect.Method.invoke(libgcj.so.9)
   at org.apache.tools.ant.dispatch.DispatchUtils.execute(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Task.perform(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Target.execute(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Target.performTasks(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Project.executeSortedTargets(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Project.executeTarget(ant-1.7.1.jar.so)
   at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Project.executeTargets(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Main.runBuild(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Main.startAnt(ant-1.7.1.jar.so)
   at org.apache.tools.ant.launch.Launcher.run(ant-launcher-1.7.1.jar.so)
   at org.apache.tools.ant.launch.Launcher.main(ant-launcher-1.7.1.jar.so)
Caused by: java.lang.ClassNotFoundException: sun.security.x509.AlgorithmId
   at org.apache.tools.ant.AntClassLoader.findClassInComponents(ant-1.7.1.jar.so)
   at org.apache.tools.ant.AntClassLoader.findClass(ant-1.7.1.jar.so)
   at org.apache.tools.ant.AntClassLoader.loadClass(ant-1.7.1.jar.so)
   at java.lang.ClassLoader.loadClass(libgcj.so.9)
   at java.lang.Class.initializeClass(libgcj.so.9)
   ...27 more
A: 

It sounds like (possibly) a corrupt SDK. Have you tried downloading it again?

Another alternative is to run ant -v instead of ant. That will produce a great deal of diagnostic output and may well help you to figure out what's going on .

Dominic Mitchell
Thank you for the comment. I followed your recommendations (took a while to re-download everything) and I am at the same spot :( I have SDK r07 (2.1) now so everything is clean and up to date on the SDK side. Could this be a classpath or Java system problem?
Brad Hein
What does `ant -v` say? If a class can't be found, it's usually a classpath issue. Ant may tell you which classpath it's actually using in verbose mode.
Dominic Mitchell
I've just noticed you're using gcj. Try the sun JDK instead, that may work.
Dominic Mitchell
Dominic - Excellent suggestion, that was the solution. I compared package lists (`rpm -qa`) my working PC with nonworking, and discovered the working PC had the JDK packages installed. I installed the following packages and it fixed the problem: java-1.6.0-openjdk-demo, java-1.6.0-openjdk-devel, java-1.6.0-openjdk-javadoc, java-1.6.0-openjdk-plugin, java-1.6.0-openjdk-src.
Brad Hein