This is all very interesting because that's not what I see. :)

When I build & deploy a debug APK using Android Studio:
1) If I connect a API 19 device with minSdk=17, then 
:collectXXXDebugMultiDexComponents is executed.
2) If I connect a API 21 device with minSdk=17, then 
:collectXXXDebugMultiDexComponents is NOT executed.
3) If I connect a API 21 device with minSdk=21, then 
:collectXXXDebugMultiDexComponents is NOT executed.
The build time is similar between 2) and 3). As such, I challenge Reto 
Meier's advice to create an minSdk=21 flavor to speed up the build in 
Android Studio.

I'll be at Google I/O next week. Hopefully I can show you my build log to 
make sense of all of this. :)

tdr

On Tuesday, May 10, 2016 at 12:33:44 PM UTC-4, Jerome Dochez wrote:
>
> Setting the minSdkVersion to 21 or above will automatically switches on 
> native multidex which is faster to build, especially in incremental modes, 
> the connected device is irrelevant.
>
> Only InstantRun uses the connected devices to make decision about how to 
> deliver the application, and as Kiran noted, it's a lot more efficient to 
> target 21+ devices where we can slice the application in various dex files 
> and only redeliver one slice at a time. 
>
>
>
> On Mon, May 9, 2016 at 11:25 PM, Kiran Rao <[email protected] 
> <javascript:>> wrote:
>
>> I think there is also the point about InstantRun. Certain types of cold 
>> swap can better be performed on devices targeting API21. Details here - 
>> http://developer.android.com/tools/building/building-studio.html#instant-run
>>
>>
>> On Monday, 9 May 2016 12:30:33 UTC+2, Anatoly Korniltsev wrote:
>>>
>>> Hi.
>>>
>>> You can check it by unzipping the result apk.
>>> If you configured everything correctly, there will be a lot of dex files 
>>> (one dex file for each library)
>>> Else there will be one dex file (or a few if you are using multidex 
>>> anyway)
>>>
>>> On Friday, 6 May 2016 22:32:34 UTC+3, thierryd wrote:
>>>>
>>>> My point is that I don't see any speed improvement when I target SDK 
>>>> 21. I think AS detect my device as API 21 and bypass the multidex phase. I 
>>>> just want to confirm with the tool team that this is indeed the case. :)
>>>>
>>>>
>>>>
>>>> On Friday, May 6, 2016 at 1:38:09 PM UTC-4, Gonçalo Silva wrote:
>>>>>
>>>>> There's a better way. You can get faster compile times while keeping 
>>>>> AS's lint checks for your real minimum SDK.
>>>>>
>>>>> Define your minSdk as a function in your project's build.gradle and 
>>>>> then use it when compiling: 
>>>>> https://gist.github.com/goncalossilva/a68cc0cc46b9ae015bc1b956bfa8d9ab
>>>>>
>>>>> Hope this helps!
>>>>>
>>>>> On Fri, May 6, 2016 at 6:29 PM thierryd <[email protected]> wrote:
>>>>>
>>>>>> Hi,
>>>>>> In his recent article/video (
>>>>>> https://medium.com/google-developers/instant-run-how-does-it-work-294a1633367f#.n0d4idmri),
>>>>>>  
>>>>>> Reto says that creating a flavor that targets API 21 can make the build 
>>>>>> faster.
>>>>>>
>>>>>> I thought that the recent improvement in Android Studio already made 
>>>>>> this unnecessary. I thought that when AS ask the user to select the 
>>>>>> device 
>>>>>> to deploy on, if the device is API 21 or greater, the multidex phase is 
>>>>>> not 
>>>>>> executed. 
>>>>>>
>>>>>> I have a large app targeting API 17. When I run it on API 21, the 
>>>>>> instant run build/deploy cycle is 13s. It's the same if I use a flavor 
>>>>>> that 
>>>>>> targets API 21.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> -- 
>>>>>> You received this message because you are subscribed to the Google 
>>>>>> Groups "adt-dev" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it, 
>>>>>> send an email to [email protected].
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "adt-dev" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to