第一步
导入module file -> new -> import module
打开文件直接导入
第二步
更改module的 build.gradle
apply plugin: 'com.android.application’更改为apply plugin: ‘com.android.library’
删除 applicationId
android {
defaultConfig {
// applicationId "com.test.xxxx"
}
}
最后一步
更改AndroidManifest.xml 文件
删除module < intent-filter > 只保留主APP程序入口
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.MAIN" />-->
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
<!-- </intent-filter>-->