What are all the changes to apk by AGP 7.1.0? - android-studio

I have just upgraded Android Studio from Arctic Fox to Bumblebee and AGP from 7.0.4 to 7.1.0
The project currently has:
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.

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.

Related

Android Studio 4.1 Canary 9 201.6466190-linux distribution corrupted?

At first I've tried to update Android Studio 4.1 Canary 8 to Canary 9 as usual through update dialog. At the first start Canary 9 have thrown error:
Missing essential plugin:
org.jetbrains.android
Please reinstall Android Studio from scratch.
So I downloaded Canary 9 distribution from official source (https://developer.android.com/studio/preview). Deleted Canary 8 catalog and extracted tar.gz with Canary 9. Then launched android-studio/bin/studio.sh with the same error.
I renamed ~/.AndroidStudioPreview4.1 catalog and started studio once more. Same error.
Now I rolled back to Canary 8 from my backup.
Any help how to move from Canary 8 to 9?
Basically this issue mentioned in release notes
In Android Studio 4.1 Canary 9, you may see the following error when
first launching Android Studio after upgrading:
missing essential plugin org.jetbrains.android
This can happen when you import your settings from a previous version
of Android Studio. Typically, this means you have a locally installed
Kotlin plugin that is not compatible with the new IDE.
To fix this issue, remove the Kotlin directory from the following
locations:
Linux: ~/.local/share/Google/AndroidStudioPreview4.1
Windows:
C:\Users\YourUserName\AppData\Roaming\Google\AndroidStudioPreview4.1
MacOS: ~/Library/Application Support/Google/AndroidStudioPreview4.1
Because there is no Kotlin plugin compatible with Canary 9 currently
available from JetBrains, we have bundled our own Kotlin plugin with
the Canary 9 update, so you don't need to manually install a Kotlin
plugin.
source
At the same time by path ~/.local/share/Google/AndroidStudioPreview4.1 no such file or directory. The only catalog named AndroidStudioPreview4.1 founded by ./.cache/Google/AndroidStudioPreview4.1. So I deleted it without any effect on subject issue.
Then I completely removed ~/.AndroidStudioPreview4.1 instead of renaming which I'd done before. And resolved the issue.
I believe Google bundle Kotlin plugin in a different way JetBrains do. So paths differ. Maybe path for Windows to. I believe paths should be corrected in release notes.
Solution:
rm -r ~/.AndroidStudioPreview4.1
Solved this problem by using terminal in Ubuntu 18.04.5 LTS
toumbou#toumbou-Aspire-V3-471:~$ cd ~/.AndroidStudio4.0/config
toumbou#toumbou-Aspire-V3-471:~/.AndroidStudio4.0/config$ ls
codestyles disabled_plugins.txt inspection plugins tasks user.token
colors disabled_update.txt options port.lock terminal workspace
toumbou#toumbou-Aspire-V3-471:~/.AndroidStudio4.0/config$
and open the file via nautilus
toumbou#toumbou-Aspire-V3-471:~/.AndroidStudio4.0$ nautilus config
Then move the config folder and remove also the kotlinRefractoring.xml and also I removed the caches of my previous project so now I got it running fine again with some tweaks all things ares fine.

How to use downloaded patch file of android studio again?

I was downloading an update for android studio. After the download was finished, there was some issue and the patch was not applied. Is there a way to use that downloaded file again? I don't want to download again because it will take a lot of time.
PS I'm using ubuntu.
To solve the “failed to apply patch” Android Studio problem you can follow these steps:
Move the Android SDK folder out of the Android Studio folder (quit Android Studio first).
Redo the Android Studio update process.
Once the update is complete, you will be prompted to enter the new location of the Android SDK.
If these steps do not work for you, update your Java runtime engine (JRE) and development kit (JDK) to the latest version. Alternatively, you could also just download the latest Android Studio build, install it (after renaming the folder of the previous build), and import your projects from the old buggy build.

Flutter in Android Studio: Build Bundle/APK greyed out

I installed Flutter and Android Studio following this link here:
https://flutter.dev/docs/get-started/editor
I've been coding in flutter for two months now and can run my app in simulator or on a connected device no problem.
But when I try to actually build an apk via "Build" --> "Build Bundle(s) / APK", this option is greyed out.
Android Studio: 3.3.2
You can't build apk using Build option in Android Studio if you are running your Flutter project.
There are 2 solutions to build it.
In terminal, write flutter build apk (this will build apk for release version not the debug version)
Open your module in Android Studio and you can use Build option of the Android studio to build the debug apk.
For option 2, you can go to build.gradle file and you should see an option in Android Studio asking you to open the module separately (see the screenshot) Tap on this option and you can then build your apk in both debug and release mode.
I realize this might have already been answered, but I have another solution to this issue. I was having the same problem after modifying my pubspec.yaml file, so after trying to build within terminal nothing would happen. Apparently, you have to open the .yaml file within Android Studio from your project directory in order to for AS to realize that there's been a change to the file. After I opened the file from the project folder, the option for Build > flutter > Build Bundle(s) /APK > Build App Bundle finally reappeared again. Just sharing my experience and hope it can help someone else who may come across this rather strange issue.
Reopen the project from your projects directory, not from recent projects option. This solved for me
Please follow these steps:-
Go To Project Structure>Project>NOSDK
Change NOSDK to the latest
ANDROID API PLATFORM
Then go to MODULE and DO THE SAME

How to import a android project into android studio?

I want to study the source code of android-smspopup .But when I download the source code and import this into android studio, the android studio pop up a dialog with a title"Import Gradle Project" and a blank to fill named Gradle home. Does any one know why this happens? And what to fill in Gradle home?
The source code doesn't include the Gradle wrapper files, which it should; the Gradle wrapper is responsible for automatically downloading the correct version of Gradle so you don't have to go through this trouble. I would recommend that you copy the Gradle wrapper over from another project into this source tree and use it. In another project that you've created with the New Project wizard, copy these files to the root directory of the project:
gradlew
gradlew.bat
gradle (directory)
When you open up the project in Android Studio it's likely to complain about the version of the Android Gradle plugin and offer to fix it for you; let it do that. If you're running the latest version of Android Studio (0.4.6 as of this writing), it's fairly smart about getting the versions of Gradle and the plug-in right, but in older versions it could get a little confused and have to ask you multiple times.
NOTE: instead of copying the wrapper files over, you can instead install a compatible version of Gradle and put the installation directory in when it asks for Gradle home. That will work, but be aware that Android Studio is very finicky about what version of Gradle it's compatible with; usually it requires a specific version that isn't forward-compatible, so for example, if it wants 1.10, 1.11 won't work. As you upgrade Android Studio you'll have to upgrade Gradle as well and it will be a bit of a drag; if you use the wrapper it's easier to make that change.
By the time Android Studio hits 1.0, it will sort out the version issues with Gradle, and it won't be so picky about version numbers, but in the short term, it's a limitation.

Migrate project to Gradle

I've got a project that used to be in Eclipse. I've since moved it from there into Android Studio, though it's not using the Gradle build system yet.
I've setup my gradle files so that I can do gradlew build from the command-line and it will generate an APK for me.
My question now is how do I get Android studio to build using the gradle files that I've got setup instead of the using the "old" way?
For what it's worth, I'm on Windows 7.
Not sure how you are compiling the project with Android Studio without actually using Gradle because AFAIK Android Studio always uses Gradle under the hoods to build sources.
Anyway, if you have your Gradle config file ready you only have to import it to a new project in Android Studio (File > Import Project... and then select the build.gradle or settings.gradle)

Resources