I-jetty compilation in Android using Maven

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.