build failing on play-services:11.8.x with pro guard parser error
Solution 1:
It seems the default shrinker has changed. Adding the configuration to turn on ProGuard seemed to work.
buildTypes {
release {
debuggable false
minifyEnabled true
useProguard true
...
}
debug {
debuggable true
minifyEnabled true
useProguard true
...
}
}
Solution 2:
In addition to the above solution (which works): the issue seems related to Instant Run as well. If you disable Instant Run, you can build your app without changing your build.gradle. Probably, the default shrinker has changed only when building for Instant Run.
Solution 3:
This solution helped me:
First, in app/build.gradle change useProguard to 'true'
Second, in proguard rules add line '-dontobfuscate'
buildTypes {
release {
debuggable false
minifyEnabled true
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
...
}
debug {
debuggable true
minifyEnabled true
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
...
}
}
proguard-rules.pro
-dontobfuscate
So, minify would be work, but code wouldn't obfuscate.
Solution 4:
I am noticing that if you disable Instant Run the build still fails with the same error (if you have minify enabled but Proguard disabled to shrink your code to avoid multi-dex in the debug build). If you follow Brill Pappin answer you must enable Instant Run(and install libraries as prompted) to hit any breakpoints while debugging.
It seems enabling the shrinker as described in the Google docs now only works if you are using Instant Run with the Google Play Play Services.