Order
In an efficient build up robust Android app-maven Android Development article mentions that Maven in Android sounds great, and you don't want to get a helloworld right away, but you might be annoyed because you're going to hit project build right away. Error:unknown Packaging:apk's mistake, and then stopped here, I had to stop because of this problem, and then I want to curse, especially the one who tempted you to try (like me), OK. This is the source of this article. This article will also be a summary of the problems encountered, you have special problems can also be put forward, I can summarize.
Problem set
-
Project build Error:unknown packaging:apk,
installation source :http :// Rgladwell . Github.com/m2e-android/updates/installation method :help , Install new software -In dialog box, click Add , Name :m2e-android location :http ://rgladwell . github.com/m2e-android/updates/and then the next step, you know. You can also use the : Preferences -- Maven , Discovery and click "Open Catalog" . Then choose M2E Android Connector The problem will be solved after installing it.
-
Maven-resources-plugin prior to 2.4 are not supported by M2E. Use Maven-resources-plugin version 2.4 or later.
Modify the version number of your org.apache.maven.plugins in the pom.xml of the project to copy the following update < Plugin ; < groupId ; org.apache.maven.plugins< Span style= "color: #89BDFF;" ></ groupId , < artifactid ; Maven-resources-plugin</ artifactid ; < version ; 2.5</ Version ; < configuration ; < encoding ; ${project.build.sourceencoding}</ encoding ; </ configuration ; </ plugin ;
Dependency=[com.actionbarsherlock:library:apklib:4.1.0:compile] not found in
Workspace
Com.actionbarsherlock.library changed the Artifactid, is Actionbarsherlock, and uses the version of 4.4.0.
Plugin execution not covered by lifecycle Configuration:com.jayway.maven.plugins.android.generation2: android-maven-plugin:3.8.0:consume-
AAR (Execution:default-consume-aar, Phase:compile)
Refer to 1 Reference 2
OK, in your MAVEN configuration, add the following paragraph to resolve:
Org.eclipse.m2e
Lifecycle-mapping
1.0.0
Com.jayway.maven.plugins.android.generation2
Android-maven-plugin
3.5.0
Manifest-update
-
No Android SDK path could be found.
Add in Settings.xml (if you don't even have settings.xml, please click here)
<profiles> <profile > <ID>Android</ID> <properties> <android.sdk.path>/users/lily/android-sdk-macosx<!--here for your SDK path-- </android.sdk.path> </Properties> </profile > </Profiles> <activeprofiles> <!-- make the profiles active all the time- <activeprofile>Android</activeprofile> </activeprofiles>
-
All @Override codes are in error.
The Java version in default maven is 1.5, just modify it to 1.6.<plugin> <groupId>Org.apache.maven.plugins</groupId> <artifactid>Maven-compiler-plugin</artifactid> <version>2.1</version> <configuration> <source>1.6</Source> <target>1.6</target> </configuration> </plugin>
-
Java.lang.ClassNotFoundException:org.sonatype.aether.RepositorySystem
See Bug Issue 395 on Maven Android plugin
Using the latest version of Maven3.1.1, use the 3.8 android-maven-plugin<plugin> <groupId>Com.jayway.maven.plugins.android.generation2</groupId> <artifactid>Android-maven-plugin</artifactid> <version>${android.plugin.version}</version> <extensions>True</Extensions> <configuration> <SDK> <platform>16</Platform> </SDK> </configuration> </plugin>
Maven and Android-maven-plugin versions do not match, often error (just in the question)
Http://stackoverflow.com/questions/19174392/failed-to-execute-goal-com-jayway-maven-plugins-android-generation2
Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.6.0:generate-sources ( default-generate-sources) on Project My-android-application:execution Default-generate-sources of goal Com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.6.0:generate-sources Failed:a Required Class was missing while executing com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.6.0: Generate-sources:lorg/sonatype/aether/repositorysystem;
At last
Feeling MAVEN is a big hole, I hope you read this article no longer be pits.
Maven Development FAQs for Android