If you have installed eclipse, Adt, and Android SDK, you must configure the following:
1. m2eclipse
Eclipse plug-in address: http://m2eclipse.sonatype.org/sites/m2e
If you do not know, search for how to install the Eclipse plug-in online.
2. MAVEN
In fact, m2eclipse has built-in Maven. To use external Maven, use the address below to download the http://maven.apache.org/
After downloading and decompressing the package, you must add and use the maven installation path in eclipse> WINDOW> preferences> Maven> installations> Add.
3. Configure Environment Variables
Window: % maven_home % android_home %
Linux: $ maven_home $ android_home
If not, add % maven_home % \ bin and % android_home % \ tools to the PATH variable.
4. I-jetty download and import eclipse
Source Code address: http://code.google.com/p/i-jetty/downloads/list
Use import-> Maven-> existing Maven projects to import Maven projects of I-Jetty
5. Compile the maven project ijetty-parent in eclipse
Run as-> Maven clean-> Maven install.
6. Problems Encountered
1
2 |
Cannot find required Method
Java. Lang. nosuchmethodexception: COM. Android. sdklib. Build. apkbuilder. addnativelibraries (Java. Io. file,
Java. Lang. String) |
This is mainly because the android SDK version is relatively new, and the maven-Android-plugin version is older.
Solution:
1
2
3 |
<Groupid> com. jayway. Maven. plugins. Android. generation2 </groupid>
<Artifactid> Maven-Android-plugin </artifactid>
<Version> 2.9.0-beta-5 </version> |
Find the above position in POM. xml and change Maven-Android-plugin to Android-Maven-plugin, and change 2.9.0-beta-5 to 3.0.0.
When executing dx. jar, the following error is reported:
| 1 |
Java. Lang. outofmemoryerror: Java heap Space |
Obviously, the DEX conversion in the android SDK requires more memory.
Solution:
1
2
3
4
5
6 |
<Dex>
<Jvmarguments>
<Jvmargument>-xms256m </jvmargument>
<Jvmargument>-xmx512m </jvmargument>
</Jvmarguments>
</DEX> |
Add the above Code under/In Maven-Android-plugin in POM. xml.