我正在研究
Android Studio中的“即时运行”功能.但看起来它与proguard不兼容.有没有人知道为什么以及如何让他们一起工作?
我的环境:Android Studio 2.0 Beta 4
我的顶级build.gradle
buildscript { repositories { mavenCentral() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.0.0-beta4' } } allprojects { repositories { maven { url "http://dl.bintray.com/populov/maven" } mavenCentral() jcenter() } }
模块的build.gradle:
apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { minSdkVersion 17 targetSdkVersion 23 } buildTypes { debug { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro' } } } dependencies { compile 'com.android.support:appcompat-v7:23.1.1' }
我可以通过上面的设置在gradle控制台中看到一些“instatn run”任务.运行按钮出现黄色霹雳.
:TestIR:transformClassesWithInstantRunVerifierForDebug :TestIR:transformClassesWithInstantRunForDebug :TestIR:transformClasses_enhancedWithInstant+reloadDexForDebug :TestIR:generateDebugInstantRunAppInfo :TestIR:transformClassesWithInstantRunSlicerForDebug Dexing C:\git\android\TestIR\build\intermediates\transforms\instantRunSlicer\debug\folders\1\5\slice_1 took 328 Dexing C:\git\android\TestIR\build\intermediates\transforms\instantRunSlicer\debug\folders\1\5\slice_0 took 340 Dexing C:\git\android\TestIR\build\intermediates\transforms\instantRunSlicer\debug\folders\1\5\slice_2 took 331 Dexing C:\git\android\TestIR\build\intermediates\transforms\instantRunSlicer\debug\folders\1\5\slice_5 took 321 Dexing C:\git\android\TestIR\build\intermediates\transforms\instantRunSlicer\debug\folders\1\5\slice_3 took 456
但是如果我将“minifyEnabled”设置为true,则Gradle控制台中不再有“即时运行”任务,要么是黄色霹雳按钮.
无论如何让他们一起工作?