关于github上的项目导入as加载慢的改善

来源:互联网 发布:淘宝运营绩效考核表 编辑:程序博客网 时间:2024/06/04 23:46

1.android studio2.1环境配置

(1)第一个文件:PagerSlidingTabStrip-master\build.gradle

改成自己的版本如:gradle:2.1.0'

(2)第二个文件:D:\PagerSlidingTabStrip-master\gradle\wrapper\gradle-wrapper.properties

改成自己的库:gradle-2.14.1-all.zip

(3)build.gradle里修改成自己有的版本

compileSdkVersion23

buildToolsVersion "23.0.3"

defaultConfig {

    applicationId ""
   
minSdkVersion 21
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"
}

testCompile 'junit:junit:4.12'

compile 'com.android.support:appcompat-v7:24.1.1'

2.android studio 2.3环境配置

()根目录build.gradle
buildscript {    repositories {        jcenter()        maven {            url 'https://maven.google.com/'            name 'Google'        }    }    dependencies {        classpath 'com.android.tools.build:gradle:2.3.0'        classpath 'com.jakewharton:butterknife-gradle-plugin:8.5.1'        // NOTE: Do not place your application dependencies here; they belong        // in the individual module build.gradle files    }}allprojects {    repositories {        jcenter()        maven { url "https://jitpack.io"}        maven {            url 'https://oss.sonatype.org/content/repositories/snapshots'        }        maven {            url 'https://maven.google.com/'            name 'Google'        }    }}task clean(type: Delete) {    delete rootProject.buildDir}ext {    // Sdk and tools    minSdkVersion = 12    targetSdkVersion = 25    compileSdkVersion = 25    buildToolsVersion = '25.0.2'    // App dependencies    supportLibraryVersion = '25.2.0'    constraintVersion = '1.0.0-beta5'    junitVersion = '4.12'    retrofitVersion = '2.2.0'    okhttpVersion = '3.6.0'    rxjavaVersion = '2.0.6'    rxandroidVersion = '2.0.1'    rxCacheVersion = '1.8.0-2.x'    rxCacheGsonVersion = '0.0.3'    espressoVersion = '2.2.2'    gsonVersion = '2.8.0'    daggerVersion = '2.9'    butterKnifeVersion = '8.5.1'    frescoVersion = '1.2.0'    arouterVersion = '1.2.0'    arouterCompilerVersion = '1.1.1'    easypermissionVersion = '0.3.1'    autoScrollViewPagerVersion = '2.1.7'}
(2)gradle/wrapper/gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip

3.android studio3.1 canary2 的环境配置

主目录:build.gradle
buildscript {    repositories {        jcenter()        maven {            url 'https://maven.google.com/'            name 'Google'        }    }    dependencies {        classpath 'com.android.tools.build:gradle:3.0.0'        // NOTE: Do not place your application dependencies here; they belong        // in the individual module build.gradle files    }}allprojects {    repositories {        jcenter()        maven {            url 'https://maven.google.com/'            name 'Google'        }    }}task clean(type: Delete) {    delete rootProject.buildDir}

app下的build.gradle

apply plugin: 'com.android.application'android {    compileSdkVersion 25   对应sdk\platforms    buildToolsVersion '26.0.2'  对应D:\Android\sdk\build-tools    defaultConfig {        applicationId "lynash.com.myapplication"        minSdkVersion 23        targetSdkVersion 25        versionCode 1        versionName "1.0"    }    buildTypes {        release {            minifyEnabled false            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'        }    }}dependencies {    compile fileTree(dir: 'libs', include: ['*.jar'])    testCompile 'junit:junit:4.12'    compile 'com.android.support:appcompat-v7:25.4.0'   对应.gradle\caches\modules-2\files-2.1\com.android.support\appcompat-v7\25.4.0    compile project(':mylibrary')}

gradle/wrapper/gradle-wrapper.properties

distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip


原创粉丝点击