导入xUtils_3 工程到Android Studio

来源:互联网 发布:淘宝店铺封面象数多少 编辑:程序博客网 时间:2024/05/29 15:59

下载地址如下:

https://github.com/wyouflf/xUtils3/tree/master

㈠将下载的工程复制到Project目录下:

㈡添加到settings.gradle文件:

include ‘:app’,':xutils’

㈢编译到工程中

dependencies {    compile fileTree(dir: 'libs', include: ['*.jar'])    compile 'com.android.support:appcompat-v7:23.0.1'    compile project(':xutils')}

㈣将xutils文件夹下的build.gradle中的版本与最低版本调整到与创建工程一致

compileSdkVersion 23buildToolsVersion "23.0.1"defaultConfig {    minSdkVersion 15    targetSdkVersion 23    versionCode 20151224    versionName version}

㈤添加如下代码到build.gradle(Project:XutilsDemo)中

dependencies {    classpath 'com.android.tools.build:gradle:1.3.0'    classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'    classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'    // NOTE: Do not place your application dependencies here; they belong    // in the individual module build.gradle files}

其中红色标记为添加的代码。

点击Sync now就可以使用xUtils了。

2 0
原创粉丝点击