I want to update to android gradle plugin 7.0. Is there any way I could test what changes I will be required to do in my project or code? Is there any preview tool in android studio?

- 11,633
- 6
- 46
- 69

- 4,345
- 6
- 36
- 77
-
Why you don't just create a backup, or use version control? – Martin Zeitler Oct 12 '21 at 08:37
-
Is there any preview tool available ? thats my question read carefully before you answer is there anything mentioned related to version control? – amodkanthe Oct 12 '21 at 08:40
-
1Version control is your 'preview' tool. Not sure what else you need. – hardartcore Oct 12 '21 at 08:44
-
No I heard android studio has feature where you can preview changes before upgrading looking for it – amodkanthe Oct 12 '21 at 08:45
-
1The preview is rather pointless, without undo functionality (version control is being assumed). I mean, how would you determine if it breaks the build, by looking at the preview, without applying it? This migration merely depends on plugins/scripts being compatible with Gradle 7.2 ... – Martin Zeitler Oct 12 '21 at 09:00
-
Does this answer your question? [How to update gradle in android studio?](https://stackoverflow.com/questions/17727645/how-to-update-gradle-in-android-studio) – Mahozad Jan 23 '22 at 15:29
1 Answers
If 'preview tool' you saying is about the AGP Upgrade Assistant:
The assistant allows you to toggle the commands that will be executed on your project to upgrade to a higher version of AGP, preview exactly which files will be affected by the AGP upgrade, and lastly globally update deprecated configurations.
The assistant is automatically prompted when you open a project which is using an older gradle version (or select it manually from Tools > AGP Upgrade Assistant...
).
When you select Show Usages button:
And for actual preview purpose, I would back up the project folder (e.g. simply compress to a zip or ideally using a VCS as @MartinZeitler suggests) and then execute update with AGP Upgrade Assistant by submitting Run selected steps button.
If I encounter a problem by upgrade, just delete the project folder and extract from the zip or rollback with VCS.

- 11,633
- 6
- 46
- 69