Android Ant Pack Note

Source: Internet
Author: User

Documents in this document (Word version): http://download.csdn.net/detail/yangwei19680827/7250711


Android Ant Pack

Finding ant packaging information on the internet seems to be too complicated. In fact, Android is ready for us. In addition to multi-channel packaging

1. Precautions

There are several folders in this article don't make mistakes

SDK folder. This article is in F:\android-sdk-windows

Ant folder, this article in E:\apache-ant-1.9.2

The code path, the folder that points to your code. A folder of items in workspace, such as D:workspace\androidapp

2. Configure the Ant

Download Ant

http://ant.apache.org/

Download good after extracting to the e-drive, can also extract to other disks, assuming this article extracted to the E:\apache-ant-1.9.2 folder structure such as the following:


Configure environment variables, create new in user variables


The new path is assumed to have the editor add the following code to the last face

%ant_home%\bin;

Execute cmd


Indicates that Ant has been successfully configured

3. Generate Build.xml

CMD into the SDK folder F:\android-sdk-windows\tools for example to:

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvd2lrzxjfew9uzw==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast ">

The project path in the diagram is changed to your own path

The following two files will be generated in your project path, for example

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvd2lrzxjfew9uzw==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast ">

These two files can be changed without any modification.

Then create a new ant.properties under this folder

The contents are as follows:

Key.store= Signature File

Key.alias= Signature Alias

key.store.password= Signature Password

Key.alias.password=alias Password

Save

CMD enter this folder to run the ant command

Ant Debug

In this way, two files are generated, a non-signed apk and an APK file signed with Debug.

(Generated under the Bin folder)

Ant Release

The release form of packaging only generates an unsigned apk file, but it's confusing. (The premise of confusion is that your project has been added to proguard confusion).

4. Problems that may arise

Assume that you perform an ant occurrence such as the following error:

BUILD FAILED

F:\android-sdk-windows\tools\ant\build.xml:653:the following error occurred while executing the line:

F:\android-sdk-windows\tools\ant\build.xml:698:null returned:1

The solution is to clear all the files under the Bin folder, assuming that you clean the current project in eclipse

Android Ant Pack Note

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.