The alignment/output does not depend on the IDE but on your gradle config. Both IntelliJ and AndroidStudio just run Gradle in background.
By default, the autogenerated Gradle file build.gradle
does not run the zipAlign
task, i.e. the one aligning the apk. So you end up with an unaligned apk.
You can easily change it by adding the zipAlignEnabled true
property, like this:
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
zipAlignEnabled true
}
But let me remind you that archive alignment is just an optimization, it does not change your app.
Also, from the docs:
Caution: zipalign must only be performed after the .apk file has been signed with your private key. If you perform zipalign before signing, then the signing procedure will undo the alignment.
For further information, please have a look at this thread, this thread and the docs.