Android Studio + gradle multi-channel packaging

Source: Internet
Author: User

The Build->build Apk from the toolbar seems to only pack the first module (the concept of project in Eclipse), how to package it in multiple channels? At the moment it seems to be a one-shot

First, set a variable in the manifest file:

This variable can be obtained in application so that the app knows which channel it is in,

Then set the productflavors in the Build.gradle.

As Yingyongbao fills the Chanel_name variable inside the manifest file.

Find the Gradle Task Unit, enter the build unit, right click Run, you can produce the channel APK file, the file path is: App under the output folder ha
The final effect is:

The only regret is the need to manually execute the task, the toolbar's build only package the first one, here do not know what is going on ha.

Android Studio + gradle multi-channel packaging

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.