乱室佳人,coo8网,劳安简历
修改该项目中bulid.gradle文件中第一行代码
把
apply plugin: 'com.android.application'
修改为
apply plugin: 'com.android.library'
然后,修改AndroidManifiest.xml文件中配置信息,此处主要是把原来配置的项目Style等配置以及MainActivity配置删除,这样处理是为了防止重复。以下以一个我的Moudle文件的AndroidManifiest.xml代码作为对照(PS:如果以下代码示例不好对照,此处具体删除信息可以网上找其他相关文章参考):
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.loonggg.lib.alarmmanager.clock">
<uses-permission android:name="android.permission.VIBRATE"/>
<application
android:allowBackup="true"
android:label="@string/app_name"
android:supportsRtl="true"
>
<receiver android:name="com.loonggg.lib.alarmmanager.clock.LoongggAlarmReceiver">
<intent-filter>
<action android:name="com.loonggg.alarm.clock"/>
</intent-filter>
</receiver>
<activity
android:name=".ClockAlarmActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
></activity>
</application>
</manifest>
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile project(':mudle-name')
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:26.+'
compile 'com.android.support:support-v4:26.+'
testCompile 'junit:junit:4.12'
}
关键一行:
compile project(':mudle-name') //mudle-name即要导入成Mudle文件的项目名称
在setting.gradle文件中,添加新配置的Module的项目名,具体如下:
未改变之前代码:
include ':app'
改变之后:
include ':app', ':your module name'
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Android Manifest中meta-data扩展元素数据的配置与获取方式
Android实现获取meta-data和build.gradle的值
Android获取清单文件中的meta-data,解决碰到数值为null的问题
解决webview 第二次调用loadUrl页面不刷新的问题
解决Android WebView拦截url,视频播放加载失败的问题
Android webview加载https链接错误或无响应的解决
网友评论