After update android studio and plugins, new built apk meets puzzling native problem when launch, I found armeabi/armeabi-v7a so files compressed from 200KB to 10KB. While old android studio can't do this.
Android Studio Version:2.2(windows 64bit) Gradle Version:2.14.1 Android Plugin Version:2.2.0
I read the Android Plugin for Gradle Release Notes:
Improves build performance by adopting a new default packaging pipeline which handles zipping, signing, and zipaligning in one task. You can revert to using the older packaging tools by adding android.useOldPackaging=true to your gradle.properties file. While using the new packaging tool, the zipalignDebug task is not available. However, you can create one yourself by calling the createZipAlignTask(String taskName, File inputFile, File outputFile) method.
I used android.useOldPackaging=true, but it doesn't work, and I found the optimization happens in stripDebugSymbol:
raw libs:
+---armeabi | libsecuritysdk-3.1.27.so 210KB | +---armeabi-v7a | libsecuritysdk-3.1.27.so 233KB | ---x86 libsecuritysdk-3.1.27.so 195KB
intermediates&apk: YourProject\example\build\intermediates\transforms\stripDebugSymbol\debug\folders\2000\1f\main +---armeabi | libsecuritysdk-3.1.27.so 9.06KB | +---armeabi-v7a | libsecuritysdk-3.1.27.so 9.07KB | ---x86 libsecuritysdk-3.1.27.so 9.06KB
I try 'assembleDebug --exclude-task transformNative_libsWithStripDebugSymbolForDebug',this will lead to no so in apk.
So how to prevent gradle plugin optimize this?