packaging options based on product flavor in gradle <p>I m using packaging options to exclude some libs. Is it possible to have packaging options based on product flavor. For example -</p> <pre><code>android { productFlavors { flavorDimensions 'models' S2 { flavorDimension 'models' minSdkVersion 22 .... } S6 { flavorDimension 'models' minsdkversion 22 .... } } packagingOptions { exclude 'lib/armeabi/libs2.so' exclude 'lib/arm64-v8a/libs6.so } } </code></pre> <p>Now in above code, I want to exclude only <code>'lib/armeabi/libs2.so'</code> in apk generated for <code>s6</code> flavor and want to exclude only <code>'lib/arm64-v8a/libs6.so'</code> in apk generated for <code>s2</code> flavor</p> <p>How can we achieve this. </p>