Using the SDK to bring your own ant package build apk

Source: Internet
Author: User

Because you want to implement a platform that edits from the front end and then automatically produces the APK, you first need to take care of the auto-generate APK feature. After studying the 7 steps of the APK generation, it was found that a slightly more complicated program, especially the Res folder with subfolders, could not be implemented directly with the SDK commands, so the ant implementation was chosen, and the first was intended to use native ant, That is, you need to write build.xml, after trying several times found inside there are several temporary unresolved bugs: one is that at compile time will be reported android.support.annotation not find the package, the second is to generate Dex file will be reported already added error, The first error can be resolved by modifying the program, but the second error is the problem of repeatedly referencing the package, and attempting to remove the jar package is temporarily unresolved.

Accidentally found an ant folder in the SDK, and then search the Internet to use the SDK ant packaging apk, the steps are as follows:

1.android Update Project--name XXXX--target 4--path.

(xxxx is the project name, 4 is listed by Android list targets the applicable targets, then choose a suitable one.) )

After executing this command, the following files are updated and generated under the Programs folder:

Generally will be project.properties inside the Proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt This line before the # is removed.

2.ant Debug

After that, you can find xxxx-debug.apk in the Bin folder.

The steps are simple, because the vast majority of things have been done by Ant. But it takes time and effort to start researching apk generation steps and manually writing build.xml, especially debugging bugs ...

This is just a debug version, and it's still a distance from fully automated compilation and package generation.

Using the SDK to bring your own ant package build apk

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.