当前位置:   article > 正文

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

android studio哪个版本稳定 csdn

我正在使用运行良好的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'

}

}

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

解决方法:

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,android

来源: https://codeday.me/bug/20191118/2031142.html

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/blog/article/detail/99415
推荐阅读
相关标签
  

闽ICP备14008679号