Hi
I've recently done some updates through SDK Manager which included
moving up to ADT 16.
I also noticed the newer android-maven-plugin (3.0.2) was available
including the artifactId renaming.
I'm having problems compiling through Eclipse (Indigo), i.e. Run As
Android Application.
I hit this problem in my actual project but when I couldn't figure out
why thought of starting a new basic project using the following to see
if it still occurred, but I still don't know why and what can be done
to resolve, anyone help my understanding please, would be much
appreciated?
If I start a new Maven project in Eclipse and choose archetype;
de.akquinet.android.archetypes
android-quickstart
1.0.6
then;
platform = 8
emulator = not-specified (am using my phone instead)
android-plugin-version = 3.0.2 (changed the artifactId manually in the
pom after creation to 'andriod-maven-plugin')
Save pom, but now it gives a 'Plugin execution not covered by
lifecycle configuration: com.jayway.maven.plugin (Click for Details)'
2 quick fixes available;
Discover new m2e connectors (Doesn't find any)
Permanently mark goal proguard in pom.xml as ignored in Eclipse build
(I choose this for the time being)
I would eventually like to use proguard but the android-quickstart
archetype doesn't include it, so would be curious to know how to add
that to my project and then I presume remove the ignore entry from the
pom.
I then right click my new project in the Eclipse Package Explorer pane
on the left of the Eclipse window and choose Maven > Update Project
Configuration.
It builds the basic hello world type project framework which runs :-))
However, as soon as I add dependencies into the pom, such as adding
the latest Google API's Client Library for Java (v. 1.6.0-beta) I get
the following compile errors.
http://code.google.com/p/google-api-java-client/
This is how my pom looks after adding some dependencies...
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="
http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://
www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.testtech1</groupId>
<artifactId>testtech1</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>apk</packaging>
<name>testtech1</name>
<repositories>
<repository>
<id>google-api-services</id>
<url>
http://mavenrepo.google-api-java-client.googlecode.com/
hg</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>2.2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-tasks</artifactId>
<version>v1-1.3.0-beta</version>
</dependency>
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>1.6.0-beta</version>
</dependency>
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client-extensions</artifactId>
<version>1.6.0-beta</version>
</dependency>
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client-extensions-android2</
artifactId>
<version>1.6.0-beta</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</
groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<androidManifestFile>${project.basedir}/
AndroidManifest.xml</androidManifestFile>
<assetsDirectory>${project.basedir}/assets</
assetsDirectory>
<resourceDirectory>${project.basedir}/res</
resourceDirectory>
<nativeLibrariesDirectory>${project.basedir}/src/
main/native</nativeLibrariesDirectory>
<sdk>
<platform>8</platform>
</sdk>
<deleteConflictingFiles>true</
deleteConflictingFiles>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e
settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
com.jayway.maven.plugins.android.generation2
</groupId>
<artifactId>
android-maven-plugin
</artifactId>
<versionRange>
[3.0.2,)
</versionRange>
<goals>
<goal>proguard</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
My Project folder structure looks like this after saving the pom with
the above dependencies:
testtech1
+JRE System Library [JavaSE-1.6]
+Maven Dependencies
+Android 2.2
+gen [Generated Java Files]
+src/main/java
assets
+bin
+res
+src
+target
AndroidManifest.xml
pom.xml
project.properties
Eclipse Console output:
[2012-01-30 12:21:57 - testtech1] Dx warning: Ignoring InnerClasses
attribute for an anonymous inner class
(org.apache.commons.logging.impl.LogFactoryImpl$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.
[2012-01-30 12:21:57 - testtech1] Dx warning: Ignoring InnerClasses
attribute for an anonymous inner class
(org.apache.commons.logging.impl.LogFactoryImpl$2) 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.
[2012-01-30 12:21:57 - testtech1] Dx warning: Ignoring InnerClasses
attribute for an anonymous inner class
(org.apache.commons.logging.impl.LogFactoryImpl$3) 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.
[2012-01-30 12:21:58 - testtech1] Dx warning: Ignoring InnerClasses
attribute for an anonymous inner class
(org.apache.commons.logging.impl.SimpleLog$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.
[2012-01-30 12:21:59 - testtech1] Dx warning: Ignoring InnerClasses
attribute for an anonymous inner class
(org.apache.commons.logging.impl.WeakHashtable$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.
[2012-01-30 12:21:59 - testtech1] Dx warning: Ignoring InnerClasses
attribute for an anonymous inner class
(org.apache.commons.logging.LogFactory$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.
[2012-01-30 12:21:59 - testtech1] Dx warning: Ignoring InnerClasses
attribute for an anonymous inner class
(org.apache.commons.logging.LogFactory$2) 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.
[2012-01-30 12:21:59 - testtech1] Dx warning: Ignoring InnerClasses
attribute for an anonymous inner class
(org.apache.commons.logging.LogFactory$3) 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.
[2012-01-30 12:21:59 - testtech1] Dx warning: Ignoring InnerClasses
attribute for an anonymous inner class
(org.apache.commons.logging.LogFactory$4) 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.
[2012-01-30 12:21:59 - testtech1] Dx warning: Ignoring InnerClasses
attribute for an anonymous inner class
(org.apache.commons.logging.LogFactory$5) 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.
[2012-01-30 12:21:59 - testtech1] Dx warning: Ignoring InnerClasses
attribute for an anonymous inner class
(org.apache.commons.logging.LogFactory$6) 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.
[2012-01-30 12:22:15 - testtech1] Dx
trouble processing "javax/xml/namespace/QName.class":
Ill-advised or mistaken usage of a core class (java.* or javax.*)
when not building a core library.
This is often due to inadvertently including a core library file
in your application's project, when using an IDE (such as
Eclipse). If you are sure you're not intentionally defining a
core class, then this is the most likely explanation of what's
going on.
However, you might actually be trying to define a class in a core
namespace, the source of which you may have taken, for example,
from a non-Android virtual machine project. This will most
assuredly not work. At a minimum, it jeopardizes the
compatibility of your app with future versions of the platform.
It is also often of questionable legality.
If you really intend to build a core library -- which is only
appropriate as part of creating a full virtual machine
distribution, as opposed to compiling an application -- then use
the "--core-library" option to suppress this error message.
If you go ahead and use "--core-library" but are in fact
building an application, then be forewarned that your application
will still fail to build or run, at some point. Please be
prepared for angry customers who find, for example, that your
application ceases to function once they upgrade their operating
system. You will be to blame for this problem.
If you are legitimately using some code that happens to be in a
core package, then the easiest safe alternative you have is to
repackage that code. That is, move the classes in question into
your own package namespace. This means that they will never be in
conflict with core system classes. JarJar is a tool that may help
you in this endeavor. If you find that you cannot do this, then
that is an indication that the path you are on will ultimately
lead to pain, suffering, grief, and lamentation.
[2012-01-30 12:22:15 - testtech1] Dx 1 error; aborting
[2012-01-30 12:22:15 - testtech1] Conversion to Dalvik format failed
with error 1