Android Studio 2.0稳定,降低了应用启动速度

Android Studio 2.0稳定,降低了应用启动速度,第1张

概述我正在使用运行良好的AndroidStudio1.5(不是很快).今天我将其更新为2.0稳定版本,现在启动需要2-3分钟才能启动.第一次启动后,我立即查看了应用信息屏幕,发现第一个缓存中有41MB(因不同设备而异)缓存开始.我不知道发生了什么.这是我的gradle文件applyplugin:'com.android.appl

我正在使用运行良好的Android Studio 1.5(不是很快).今天我将其更新为2.0稳定版本,现在启动需要2-3分钟才能启动.第一次启动后,我立即查看了应用信息屏幕,发现第一个缓存中有41MB(因不同设备而异)缓存开始.我不知道发生了什么.这是我的gradle文件

apply plugin: 'com.androID.application'androID {    compileSdkVersion 23    buildToolsversion "23.0.2"    packagingOptions {        exclude 'meta-inf/NOTICE'        exclude 'meta-inf/liCENSE'        exclude 'meta-inf/DEPENDENCIES'        exclude 'meta-inf/DEPENDENCIES.txt'        exclude 'meta-inf/liCENSE.txt'        exclude 'meta-inf/NOTICE.txt'    }    sourceSets {        main.jnilibs.srcDirs = ['libs']    }    defaultConfig {        applicationID "com.my.app"        minSdkVersion 17        targetSdkVersion 21        multIDexEnabled true    }    buildTypes {        release {            MinifyEnabled false;            proguardfiles getDefaultProguardfile('proguard-androID.txt'), 'proguard-rules.pro'        }    }    dexOptions {        preDexlibrarIEs = false        javaMaxHeapSize "2g"    }}dependencIEs {    compile filetree(dir: 'libs', include: ['*.jar'])    compile project(':volley')    compile project(':androID-country-picker-master')    compile project(':vIEwPagerIndicator')    compile ('com.androID.support:design:23.1.1') {        exclude module: 'support-v4'    }    compile ('com.Google.code.gson:gson:2.5'){        exclude module: 'support-v4'    }    compile ('com.squareup.picasso:picasso:2.5.0'){        exclude module: 'support-v4'    }    compile ('pl.droIDsonroIDs.gif:androID-gif-drawable:1.1.10'){        exclude module: 'support-v4'    }    compile ('javax.annotation:javax.annotation-API:1.2'){        exclude module: 'support-v4'    }    compile ('com.Google.androID.gms:play-services:8.4.0') {        exclude module: 'support-v4'    }    compile ('com.squareup.retrofit:retrofit:1.9.0'){        exclude module: 'support-v4'    }    compile ('com.squareup.okhttp:okhttp:2.4.0'){        exclude module: 'support-v4'    }    compile 'org.apache.httpcomponents:httpclIEnt:4.5.1'    compile 'org.apache.httpcomponents:httpmime:4.3.6'    compile ('com.Google.guava:guava:18.0') {        exclude module: 'support-v4'    }    compile ('org.apache.commons:commons-lang3:3.4'){        exclude module: 'support-v4'    }}

任何帮助,将不胜感激,谢谢

解决方法:

如此处所述:http://tools.android.com/tech-docs/instant-run

When using Instant Run with a project configured for Legacy MultIDex—that is, when build.gradle is configured withmultIDexEnabled true and minSdkVersion 20 or lower—build performance may decrease when deploying a clean build to target devices running AndroID 5.0 (API level 21) or higher.

[..] To improve clean build performance during development, consIDer
creating a product flavor withminSdkVersion 21.

尝试在gradle中实现

androID {productFlavors {    // define separate dev and prod product flavors.    dev {        // dev utilizes minSDKVersion = 21 to allow the AndroID gradle plugin        // to pre-dex each module and produce an APK that can be tested on        // AndroID Lollipop without time consuming dex merging processes.        minSdkVersion 21    }    prod {        // The actual minSdkVersion for the application.        minSdkVersion 14    }}      ...buildTypes {    release {        runProguard true        proguardfiles getDefaultProguardfile('proguard-androID.txt'),                                             'proguard-rules.pro'    }}}dependencIEs {  compile 'com.androID.support:multIDex:1.0.0'}
总结

以上是内存溢出为你收集整理的Android Studio 2.0稳定,降低了应用启动速度全部内容,希望文章能够帮你解决Android Studio 2.0稳定,降低了应用启动速度所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1120692.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存