Issues needing attention in Android Studio multi-module development

Source: Internet
Author: User

Multi-module development, one of which is the portal module, and the other module is a standalone "application" (library)

1. In the original project to import another project module of the main project, that is, in a project to add a start B project portal

1) Right click on the module of Project B and select Copy path;

2) Right-click a project, New-module-import Gradle project, paste the path of the previous copy, until completed;

2.build.gradle file

1) The main module is configured to apply plugin: ' Com.android.application ', the second module for the Apply plugin: ' Com.android.library ';

2) Secondary module does not require ApplicationID

3) Dependencies dependencies need to be put into the secondary module

4) plus multidexenabled true

5) Main module import Secondary Module:compile project (path: ': Module2 ')

6). compilesdkversion buildtoolsversion minsdkversion targetsdkversion Unity set in Build.gradle

3.androidmanifest.xml file

1) The main module adds tools:replace= "Android:name,allowbackup,icon,theme,label" to the application.

At the same time add xmlns:tools= "Http://schemas.android.com/tools" to the top, mainly to avoid the name,icon,theme of multi-module and other conflicts

2) The second module to remove application under the Android:name,android:icon,android:label, or after installation, there will be more than one icon on the desktop;

3) The secondary module removes the activity's main filter

    <intent-filter>

    <action android:name= "Android.intent.action.MAIN"/>

<category android:name= "Android.intent.category.LAUNCHER"/>
</intent-filter>

4. Conflict of resource files
Jar package Conflict, check whether duplicate, in module all exist;
Class name, file name, etc., repeat to modify one, avoid duplication, resource index problems.

Basically is these, mainly is rebuild after the newspaper's what mistake, the concrete question concrete to analyze the processing.

Issues needing attention in Android Studio multi-module development

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.