AS a project into another project

Requirements: items A, B. Needs to be integrated into the A, B, A, as a module.

method:

B 1. The following engineering app build.gradle text apply plugin: 'com.android.application' to apply plugin: 'com.android.library', meaning that as the B library.

2. Then continue to build.gradle in, defaultConfig {} in applicationId "xxxx" commented out because a project can only have one applicationId.

3. Import Module in A, B, select the path. Check Import, and a module to change its name because usually app, will be the same name

4. Bmodule imported, to find its AndroidManifest.xml file, delete the <intent-filter> configuration of the start page of the original, because B generally also have the original start page, if you do not delete the two icons will start

The introduction of B in A, but there is no dependency in A

6. According to friends, said that if there is switch, or butterknife B in, will complain, to be replaced ifelse. butterknife should be changed to R2. I have not experimented with this.

Guess you like

Origin www.cnblogs.com/jdhdevelop/p/12021115.html