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

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


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值