Currrently i am using android 3.1.4 and when i try to generate signed apk using Build->Generate signed apk the apk file stores in
/app/release/app-release.apk
And i also configured the build process to automatically sign your APK using Open Module Settings. plz refer here . And according to this document the location is
/build/app/outputs/apk/app-release.apk
So which apk file is correct/perfect for the play store publication?
/build/app/outputs/apk/app-release.apk
Or
/app/release/app-release.apk
tl;dr = Both are correct
let me Explain how
There is three types of APK
An unsigned APK
A signed Apk = Unsigned APK + Signing certificate key
A debug Apk = Unsigned APK + Debug certificate key
The automatic build process generate the same APK as you manually generate, if you configured it to automatically sign your APK.
so
If we don't want to sign our APK again and again then we can configure to get signed apk every time we build and the generated APK will go into
/build/app/outputs/apk/app-release.apk
and if we use Generate Signed APK
then the default path. (path can be changed)
/app/release/app-release.apk
Even you can generate an unsigned APK and later sign it and release. its also the same
here is the official documentation where it showing how you can sign an unsigned apk
and the last line of this documentation clearly saying
An APK signed with your private key is ready for distribution
Generally developer's find Generate Signed APK manually is better because maybe you made a change and forgot to build/run your code and picked older app-release.apk
so generating manually means you are 100% sure that this one is latest
but if you just build and pick auto created release file then it's also correct and latest one