-1

Recently I've decided to migrate my android project to Jack and Jill build chain. But now I'm facing multi-dex problem that was not present in the previous build chain, so my questions arise.

What is the equivalent of "minifyEnabled true" when using Jack&Jill for debug build and whether the new chain provides any way of automatic removal of unused libraries code?

Below I provide my current code which cause dex problems:

   defaultConfig {
    applicationId "xxx"
    minSdkVersion 16
    targetSdkVersion 25
    versionCode getVersionCode()
    versionName getVersionName()
    jackOptions{
        enabled true
   }
} 

buildTypes {
    release {
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt')
        signingConfig signingConfigs.release
    }
    debug {
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt')
        useProguard true
    }
}

I'll be thankful for any help, thanks!

Jan Stoltman
  • 394
  • 3
  • 15
  • Did you try leaving `minifyEnabled true` in there? AFAIK it's the same flag. – weston Feb 09 '17 at 13:01
  • Yes, it effects in: "Error:A problem occurred configuring project ':app'. > Minifying the variant used for tests is not supported when using Jack." – Jan Stoltman Feb 09 '17 at 13:13

1 Answers1

0

Nothing I have read suggests that there is any change needed with regard to minifyEnabled true. And that Jack does support it and works with multidex.

From: http://tools.android.com/tech-docs/jackandjill#TOC-Overview

...Jack also handles any requested code minification (shrinking and/or obfuscation). The output is then assembled into an APK file as normal. Including support for multiple dex files if you have enabled that support.

Jack's Shrinking and Obfuscation does not support all of proguard's options however. There is a list here:

http://tools.android.com/tech-docs/jackandjill#TOC-Shrinking-and-Obfuscation-support

weston
  • 54,145
  • 21
  • 145
  • 203
  • debug { proguardFiles getDefaultProguardFile('proguard-android-optimize.txt') useProguard true minifyEnabled true } Results in: "Error:A problem occurred configuring project ':app'. > Minifying the variant used for tests is not supported when using Jack." – Jan Stoltman Feb 09 '17 at 13:14
  • Right, you can't put it in the `defaultConfig` apparently. http://stackoverflow.com/questions/37314760/android-how-to-perform-obfuscation-with-the-jack-compiler – weston Feb 09 '17 at 13:18