AndroidStudio创建Module

来源:互联网 发布:shell编程for循环 编辑:程序博客网 时间:2024/04/27 23:50

操作步骤

  创建Module项目,但是我用的是1.5 版本as,创建的module 需要修改几个地方

 修改Module的build.gradle

打开,修改后的样子是:


apply plugin:'android-library'android {    compileSdkVersion 23    buildToolsVersion "23.0.2"    defaultConfig {       /* applicationId "yao.com.rontest001"*/        minSdkVersion 18        targetSdkVersion 23        versionCode 1        versionName "1.0"    }    buildTypes {        release {            minifyEnabled false            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'        }    }}

    




另外我创建的Module包含了Activity之类的,必须要清理一下(我的方法是注释掉一些配置文件)


<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android"    package="yao.com.mymodule">    <application        android:allowBackup="true"        android:icon="@mipmap/ic_launcher"        android:label="@string/app_name"        android:supportsRtl="true"        android:theme="@style/AppTheme">       <!-- <activity            android:name=".MainActivity"            android:label="@string/app_name"            android:theme="@style/AppTheme.NoActionBar">            <intent-filter>                <action android:name="android.intent.action.MAIN" />                <category android:name="android.intent.category.LAUNCHER" />            </intent-filter>        </activity>-->    </application></manifest>


0 0
原创粉丝点击