10

I have just upgraded Android Studio from Arctic Fox to Bumblebee and AGP from 7.0.4 to 7.1.0 enter image description here

The project currently has: enter image description here

The apk generated by gradle task assembleOfficialRelease for flavor "official" was in the following directory for many years:

..app/build/outputs/apk/official/release/app-official-release.apk

I assume it is the new AGP that has changed the location to:

..app/build/intermediates/apk/official/release/app-official-release.apk

I am trying to find out what else AGP has done to the apk but could not find any in the release notes.

I wonder if anyone with insights could tell me what changes the new AGP has done to the apk before I release it to users.

Update(2022-05-09)

Android Studio Chipmunk has put the apk file back to the folder ..app/build/outputs/apk/official/release/ without any notification. It killed me a lot of time again before I realized this.

Hong
  • 17,643
  • 21
  • 81
  • 142
  • 2
    Yes it is strange. The final release has the same behaviour. Interestingly app bundles still reside under outputs folder. – Martin Price Jan 27 '22 at 11:51
  • The change is fine as long as they have not changed anything of the apk and the only change is file location. I know they have been pushing the bundles but we have good reasons to shun them. – Hong Jan 27 '22 at 13:56
  • @Hong This is my guess only.. but when you run the app to install on device. This is not a full app, it only generates APK with ABI of connected device… So it does make sense not to keep it in outputs.. as it is confusing for some devs – Sylwek845 Feb 03 '22 at 11:59
  • @Sylwek845 I was talking about apk generated by gradle task assembleOfficialRelease, so the apk is not for debugging, but for production deployment. I have not seen any problems so far after publishing them. – Hong Feb 03 '22 at 16:47
  • 1
    The APK did get a little bit smaller for me when compiled with this gradle version. Hopefully nothing is missing. – vgergo Apr 12 '22 at 11:48

1 Answers1

6

I also observed this weird behavior. It seems like if you run the gradle task in Android studio, it will put the apk files in intermediates, while if you run the gradle task on command line (at least for bash on Linux), it will put the files in outputs.

The canary build of android studio with android gradle plugin 7.3.0-alpha05 seems to solve this issue.

Adrian Lai
  • 71
  • 3