androidandroid-studiogradleandroid-gradle-pluginandroid-gradle-7.0

Android gradle plugin update to version 7.0


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?


Solution

  • 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...).

    prompt

    pop up

    preview 0

    preview 1

    preview 2

    When you select Show Usages button:

    preview 3

    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.