Closed GoogleCodeExporter closed 9 years ago
I get the same error if I create an android project without eclipse as
described in
http://developer.android.com/guide/developing/other-ide.html
Original comment by kostya...@gmail.com
on 23 Jun 2009 at 4:54
Thank you for the bug report. I am looking in to it.
Original comment by hugo.josefson.old@gmail.com
on 23 Jun 2009 at 5:54
[deleted comment]
[deleted comment]
[deleted comment]
I can confirm that it works for me in Windows XP with the clean pom you
attached before.
If this problem appears when you add for example dependencies to your Maven
project, the Maven Android Plugin should not give this
strange error message. It should understand the problem and have a better error
message, so that people are actually helped by the
error message.
I would very much like to understand this problem, so that the plugin can be
updated with better error messages when these things
happen.
Would you please attach a pom.xml which causes the Maven build to break and
give the error message above?
Original comment by hugo.josefson.old@gmail.com
on 23 Jun 2009 at 6:12
I've carrefully analysed my project and I've found that this error can happen
because
a number of reasons. E.g. if I add in my pom some dependencies. My project
depends
from my own dependencies, so it has no sense these to mention here. In attached
pom
there aren't my dependencies.
I've implemented my application with these dependencies. And it works. And now
I want
make it for Android. In eclipse android-project works too. But because these
errors I
cannot build my project with maven.
Original comment by kostya...@gmail.com
on 23 Jun 2009 at 6:18
>>Would you please attach a pom.xml which causes the Maven build to break and
give
the error message above?
I've already explained, that I've set in the pom file dependencies from my own
libraries. These have in their turn their own dependencies. I'm using relative
much
libraries, so that has no sense pom with all these dependencies.
I can build my projects with maven, but I cannot build my ANDROID project.
Sorry that
it is so happens.
Original comment by kostya...@gmail.com
on 23 Jun 2009 at 6:27
But I try to get it in some way and I notify you as soon as possible. (I mean
pom
with this error at building with dependency from some library of 3rd party open
provider.)
Original comment by kostya...@gmail.com
on 23 Jun 2009 at 6:35
Looking more closely at the error message above, I notice that it says:
"trouble processing: class name (Queens) does not match path
(bprolog/plc/Queens.class)"
If the Queens class is this one:
http://www.probp.com/examples/java_interface/Queens.java
...then I believe the problem is that the class file is in directory
bprolog/plc/, but the class itself is not declared in
its Java code to be in "package bprolog.plc;", which would be required.
Could this be it?
Original comment by hugo.josefson.old@gmail.com
on 23 Jun 2009 at 8:06
Thank you. I am looking forward to it!
Original comment by hugo.josefson.old@gmail.com
on 23 Jun 2009 at 10:03
[deleted comment]
>>Could this be it?
I cannot say it at once, I must think about it. I answer you later.
Original comment by kostya...@gmail.com
on 24 Jun 2009 at 9:00
I don't know. Probably this helps. I've not reported this error since I thought
that
it will be induced by earlier error.
[ERROR] warning: Ignoring InnerClasses attribute for an anonymous inner class
that
doesn't come with an associated EnclosingMethod attribute. (This cl
ass was probably produced by a broken compiler.)
[ERROR]
[ERROR] UNEXPECTED TOP-LEVEL ERROR:
[ERROR] java.lang.OutOfMemoryError: Java heap space
[ERROR] at java.util.Collections.unmodifiableList(Unknown Source)
[ERROR] at com.android.dx.ssa.SsaMethod.buildUseList(SsaMethod.java:462)
[ERROR] at
com.android.dx.ssa.SsaMethod.getUseListForRegister(SsaMethod.java:614)
[ERROR] at com.android.dx.ssa.SCCP.addUsersToWorklist(SCCP.java:105)
[ERROR] at com.android.dx.ssa.SCCP.simulateStmt(SCCP.java:387)
[ERROR] at com.android.dx.ssa.SCCP.simulateBlock(SCCP.java:201)
[ERROR] at com.android.dx.ssa.SCCP.run(SCCP.java:402)
[ERROR] at com.android.dx.ssa.SCCP.process(SCCP.java:84)
[ERROR] at
com.android.dx.ssa.Optimizer.runSsaFormSteps(Optimizer.java:161)
[ERROR] at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:101)
[ERROR] at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:74)
[ERROR] at
com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:269)
[ERROR] at
com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:131)
[ERROR] at
com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:85)
[ERROR] at com.android.dx.command.dexer.Main.processClass(Main.java:297)
[ERROR] at
com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)
[ERROR] at com.android.dx.command.dexer.Main.access$100(Main.java:56)
[ERROR] at
com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)
[ERROR] at
com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:134)
[ERROR] at
com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:1
90)
[ERROR] at
com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122)
[ERROR] at
com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:1
90)
[ERROR] at
com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122)
[ERROR] at
com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:1
90)
[ERROR] at
com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122)
[ERROR] at
com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:1
90)
[ERROR] at
com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122)
[ERROR] at
com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:1
90)
[ERROR] at
com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122)
[ERROR] at
com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:1
90)
[ERROR] at
com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122)
[ERROR] at
com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
Original comment by kostya...@gmail.com
on 24 Jun 2009 at 9:22
I think the OutOfMemoryError is unrelated.
If you run out of memory, it might help to increase the maximum amount of RAM
given to the
dex tool. Add this configuration to your plugin declaration, and see if it
helps:
<configuration>
<jvmArguments>
<jvmArgument>-Xmx256</jvmArgument>
</jvmArguments>
</configuration>
Original comment by hugo.josefson.old@gmail.com
on 24 Jun 2009 at 2:13
Hi Ben, thanks for contributing! I'm glad you posted this amount of detail, and
that
your pom has scm and repository tags which I can follow.
The effective error message in your log seems to be this:
[ERROR] trouble processing "javax/crypto/ExemptionMechanismException.class":
After digging a bit deeper into this, I would say that the likely culprit is the
<scope> of the android:android:1.5 dependency in your pom.
In any pom, a dependency is assumed to be in <scope>compile</scope> if not
specified
with a different scope, which means they are unpacked and included in your
resulting
apk. This is not what you want with that dependency. The classes in android.jar
and
in android-maps.jar are already provided by the device, so those dependencies
should
be of <scope>provided</scope>, which means they will not be packaged into the
apk
(because their classes are assumed to be provided by the environment in which
the apk
is run).
If you set <scope>provided</scope> on both the android dependency, and the
android:maps:1.5 dependency, it should work. If not, please let me know.
Come to think of it, please also let me know if this solves your problem :)
Thanks,
/Hugo
Original comment by hugo.josefson.old@gmail.com
on 15 Jul 2009 at 8:58
Hey Hugo,
Thanks for the quick reply. I actually originally had <scope>provided</scope>
set on
both and removed it to see if it fixed the error. (I think in the example
pom.xml
it's not included?)
Here's the POM/error with the scope set to provided.
Original comment by bjdod...@gmail.com
on 15 Jul 2009 at 9:19
Attachments:
I see the same error message in that file.
One thing you could try, which is quick but probably won't help, is to do a "mvn
clean" first. Maybe the target directory had some old stuff in it...(?)
Other than that, a likely candidate is the pom of this dependency:
<dependency>
<groupId>edu.stanford.prpl.core</groupId>
<artifactId>main</artifactId>
<version>0.2-SNAPSHOT</version>
</dependency>
I found it here:
http://prpl.stanford.edu:8081/nexus/content/repositories/public/edu/stanford/prp
l/core/main/0.2-SNAPSHOT/main-0.2-20090714.233114-2.pom
It contains MANY other dependencies, all of which will be pulled into your poor
little apk.. ;-\
For example, commons http-client is built into the android device, so that must
not
be part of your apk. Probably most of the dependencies listed in the core main
pom
should not be included for your Android app, or are perhaps not even needed at
all at
that level(?).
I think you should consider the dependencies in core main; see if any of them
have
incorrect scope. You might also want to consider splitting up core main into
smaller
parts, so that the part(s) which your apk pom will depend on doesn't pull
things in
which are not used or needed in/by the Android apk.
Original comment by hugo.josefson.old@gmail.com
on 15 Jul 2009 at 9:35
Haha.. yeah... the core/main project is a fat one :) We wanted to split it into
pieces but have a huge pile of spaghetti dependencies. I've been fighting to
switch
to Maven and am spearheading that effort, and it's been a bit of a pain. (But
we're a
research group and not a group geared towards top-notch development, so I guess
we
get a little slack...?)
If I list the httpclient as a provided dependency, should that mean it doesn't
get
pulled into the .apk as a transitive dependency?
(and I had done an mvn clean before that build..)
Original comment by bjdod...@gmail.com
on 15 Jul 2009 at 9:40
I know how you feel... Maven tends to bring up bad dependency structures to the
surface... ;)
Yes, if you list httpclient as provided in core/main, it should not get pulled
in,
unless there is some other (possibly transitive) dependency pulling it in.
There is a nice plugin called "Maven Dependency Plugin". Try doing "mvn
dependency:tree" in directory where your apk pom is.
More stuff you can do with that plugin:
http://maven.apache.org/plugins/maven-dependency-plugin/
(dependency:analyze and dependency:analyze-dep-mgt should also be instresting)
Hope that helps a little.
/Hugo
Original comment by hugo.josefson.old@gmail.com
on 15 Jul 2009 at 9:56
I'll have to look into the httpclient stuff closer. It probably isn't included
everywhere, but the bigger question is if I specify "provided" for a higher
level
project, is Maven smart enough to know not to bring it in for a lower level
dependency? I'll look into that separately..
The big problem in debugging this is the following error shows up without
referencing
any specific code/jars/anything:
[ERROR] warning: Ignoring InnerClasses attribute for an anonymous inner class
that
doesn't come with an associated EnclosingMethod attribute. (This class was
probably
produced by a broken compiler.)
I also have an android-classes folder full (and I mean Full!) of class files,
and a
built PrplManager.jar file. I wonder if there's a way to check for conflicting
.class
files between that directory and the SDK?
Original comment by bjdod...@gmail.com
on 15 Jul 2009 at 10:15
Regarding the android-classes folder, that's where Maven Android Plugin copies
your
classes and also unpacks all dependency jars, before converting all classes in
that
directory to the Davlik DEX format.
I would suggest you look for conflicting package names (directories) first. An
easy
way to do it semi-automatically, is to use the GNU find command. Like this:
cd target/android-classes
find . -type d | sort > sorted-list-of-packages.txt
Then unpack the SDK's android.jar into a separate empty directory and run the
command
there too. Then compare the two text files. If there are any lines which are the
same, you probably have conflicts. You can then look at the class filenames
inside
the directories if you like, but I'd say that if package directories match you
have a
problem.
Original comment by hugo.josefson.old@gmail.com
on 16 Jul 2009 at 3:13
Yeah, good thinking, thanks for the tip. I think we may have actually
double-included
some dependencies under that massive core dependency. I'll spend some time
checking
that out first and I'll keep you posted.. So are the errors coming out being
piped
directly from dx? Is there a way to use dx to get more information (IE what
class is
being worked on when the error occurs)
Thanks again.
Original comment by bjdod...@gmail.com
on 16 Jul 2009 at 3:39
Maven Android Plugin prints to the log on screen every external command line it
executes, for example the one which executes dx. It looks a little weird
though, with
commas between each of the parameters. I think you can figure it out though.
What I usually do when debugging error messages like that, is to run the
command line
myself (without the commas!) to see more specifically what happens. It might
help to
add --verbose to the dx command line when you run it yourself.
Original comment by hugo.josefson.old@gmail.com
on 16 Jul 2009 at 4:00
Yep, --verbose is just what I needed. The output looks nasty though and this
will
definitely take me some time to pick through.. My first step will be to just
clean
what I know needs cleaning, and probably try building up a new project piece by
piece.
This project is fairly big (in terms of what it requires) but it was working on
Android before we tried cutting over with Maven. There might be something
broken in a
transitive dependency that was not included before, but that we never used at
runtime
and so never saw issues for. XStream, for example, is used by another module in
the
spaghetti dependencies but isn't touched by this Android project.
I'll also look into whether or not I can ignore transitive dependencies (else
I'll
just list them all as provided)
Original comment by bjdod...@gmail.com
on 16 Jul 2009 at 5:28
Attachments:
Wow! That output log was big :D
You can add <exclusions> inside one <dependency> declaration.
See here for documentation:
http://bit.ly/transitive-dependency-exclusion
Original comment by hugo.josefson.old@gmail.com
on 16 Jul 2009 at 5:34
I can trigger the Ignoring InnerClasses message by using .class files with <=
1.4
compatibility. Something in the older .class format confuses dex.
Original comment by joe.bowb...@gmail.com
on 7 Dec 2009 at 7:15
I'm running into the same problem. Did you guys sort this out eventually?
Original comment by m.kaepp...@gmail.com
on 28 Jun 2010 at 12:53
Hi Matthias!
Have you tried my suggestions from Comment 21, Comment 23 and Comment 27?
Please open a fresh issue with complete instructions on how to reproduce your
specific problem, with at least a pom.xml which I can build (or even better: a
small example project).
Thanks,
Hugo
Original comment by hugo.josefson.old@gmail.com
on 28 Jun 2010 at 1:01
I have the same problem,when run "mvn install".
Embedded error: ANDROID-040-001: Could not execute: Command = cmd.exe /X /C
"E:\workspace_1\android\android-sdk-windows\tools\apkbuilder "E:\Program
Files\continuum-1.0.3-bin_1080\continuum-1.0.3\apps\continuum\working-directory\
76\target\android_conference-1.0.0.0-SNAPSHOT.apk" -z "E:\Program
Files\continuum-1.0.3-bin_1080\continuum-1.0.3\apps\continuum\working-directory\
76\target\android_conference-1.0.0.0-SNAPSHOT.ap_" -f "E:\Program
Files\continuum-1.0.3-bin_1080\continuum-1.0.3\apps\continuum\working-directory\
76\target\classes.dex" -rf "E:\Program
Files\continuum-1.0.3-bin_1080\continuum-1.0.3\apps\continuum\working-directory\
76\target\classes" -nf "E:\Program
Files\continuum-1.0.3-bin_1080\continuum-1.0.3\apps\continuum\working-directory\
76\libs" -rj
f:\.m2\repository\mysql\mysql-connector-java\3.1.12\mysql-connector-java-3.1.12.
jar -rj
f:\.m2\repository\com\mycom\platform-common\1.0.3\platform-common-1.0.3.jar",
Result = 1
Original comment by codyzhang.work@gmail.com
on 3 Dec 2010 at 7:44
I had the same error and could solve it by following Comment 21 (mvn
dependency:tree) that showed a flaw in my dependencies:
I used different android dependencies (version and groupId) inside some of my
modules.
Original comment by m.sc...@iplabs.de
on 3 Mar 2011 at 4:17
I had the same problem when I followed the instructions for maven integration
with android : Embedded error: ANDROID-040-001: Could not execute: Command =
cmd.exe /X /C ""C:\Program Files\Android\android-sdk\platform-tools\dx.bat"
--dex "--output=C:\Users\proRock\Desktop\Birthday Scheduler\target\classes.dex"
"C:\Users\proRock\Desktop\Birthday Scheduler\target\android-classes"", Result =
255.
In my case I manage to solve it by removing the spaces within the name of the
application.
Original comment by gheorghi...@gmail.com
on 4 Jul 2011 at 5:59
I have meet as following issue:
Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.google.code.rome.android.repackaged.com.sun.syndication.feed.impl.ToStringB
ean$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2011-11-17 17:01:46 - TestAndroidProject] Dx
UNEXPECTED TOP-LEVEL EXCEPTION:
java.util.zip.ZipException: invalid LOC header (bad signature)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
java.util.zip.ZipFile.read(Native Method)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
java.util.zip.ZipFile.access$1200(ZipFile.java:29)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:447)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
java.util.zip.ZipFile$1.fill(ZipFile.java:230)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
java.util.zip.InflaterInputStream.read(InflaterInputStream.java:141)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
java.io.FilterInputStream.read(FilterInputStream.java:90)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:234
)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
com.android.dx.command.dexer.Main.processOne(Main.java:418)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
com.android.dx.command.dexer.Main.processAllFiles(Main.java:329)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
com.android.dx.command.dexer.Main.run(Main.java:206)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
java.lang.reflect.Method.invoke(Method.java:597)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
com.android.ide.eclipse.adt.internal.build.DexWrapper.run(DexWrapper.java:179)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(BuildHelper.jav
a:729)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.build(Po
stCompilerBuilder.java:602)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:321)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:396)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
org.eclipse.core.internal.resources.Project$1.run(Project.java:618)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
org.eclipse.core.internal.resources.Project.build(Project.java:124)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
com.android.ide.eclipse.adt.internal.project.ProjectHelper.build(ProjectHelper.j
ava:869)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(LaunchCo
nfigDelegate.java:146)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.j
ava:854)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.j
ava:703)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:92
8)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1132)
[2011-11-17 17:01:46 - TestAndroidProject] Dx at
org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
[2011-11-17 17:01:46 - TestAndroidProject] Dx 1 error; aborting
[2011-11-17 17:01:46 - TestAndroidProject] Conversion to Dalvik format failed
with error 1
I found when I add android-rome-feed-reader.jar as dependency in pom.xml and
run as Android project, appear the above log, but when I add the jar from
properties->java build path -> libraries, the project work normally.
Original comment by muzili...@gmail.com
on 17 Nov 2011 at 9:08
For me the same problem as in comment #34 occurs when switching from jars to
m2e for a custom project. No warnings about inner classes though
Original comment by david.ds...@gmail.com
on 2 Jan 2013 at 4:31
We are no longer using the issue tracking system on Google Code. Please refile
this issue on https://github.com/jayway/maven-android-plugin/issues if you
still have this problem with the latest release of the Android Maven Plugin
Original comment by mosa...@gmail.com
on 19 May 2014 at 4:18
Original issue reported on code.google.com by
kostya...@gmail.com
on 23 Jun 2009 at 4:38Attachments: