How to Fix We recommend using a newer Android Gradle plugin to use compileSdk = 34 Warning?

Guide on how to fix We recommend using a newer Android Gradle plugin to use compileSdk = 34 Warning:

Are you getting the new build warning “We recommend using a newer Android Gradle plugin to use compileSdk = 34” in your Android studio? Then, you are in the right place! In this article, we will discuss the step-by-step solutions on how to resolve the warning.

WhatsApp Group Join Now
Telegram Group Join Now

So without any further ado, Let’s get started!

How to Fix We recommend using a newer Android Gradle plugin to use compileSdk = 34 Warning?

In this section, we will see the step-by-step solutions to fix the build warning. Before that, check whether your compileSdk is 34 in the modules build.gradle file.

Method 1: Suppress the Warning

Suppressing the warning is not recommended, as it may lead to tons of new issues during version upgrades.

If you still wish to suppress the warning, you can do so by adding the following line to the gradle.properties file.

android.suppressUnsupportedCompileSdk=34

And Click on “Sync Now” option to sync the gradle file.

Now select “Build” > “Rebuild Project” option to Rebuild the project.

If you have followed the above steps correctly, you should notice that the build is successful without any warnings.

Method 2: Updating Android Gradle Plugin (AGP) Version

You can check the minimum versions of tools for Android API level in AGP Release notes

For the API level 34, the minimum AGP version required is 8.1.1

Android API Level

To update your AGP version, Follow the steps below:

  1. Click on the “Settings” >> “Project Structure” >> “Project” and update your AGP version.
  2. If the option is disabled in the project tab, you can update AGP version from “AGP upgrade Assistant“.
  3. Now Click on “Tools” >> “AGP Upgrade Assistant
  4. Update your AGP dependency version to 8.1.1 or above.
    Android Gradle Plugin Manual Updation
  5. Select the version and Click on “Run Selected Steps” option to upgrade your Android Gradle Plugin to the selected version.
  6. Now, Select “Build” > “Rebuild Project” option to Rebuild the project.

Congrats! Now the warning has now been successfully removed.

Conclusion:

I hope this article has helped you to fix “We recommend using a newer Android Gradle plugin to use compileSdk = 34 Warning” in your Android studio. If you have any queries, please feel free to ask them in the comment section below.

Share on:
Vijaygopal Balasa

Vijaygopal Balasa is a blogger with a passion for writing about a variety of topics and Founder/CEO of Androidstrike. In addition to blogging, he is also a Full-stack blockchain engineer by profession and a tech enthusiast. He has a strong interest in new technologies and is always looking for ways to stay up-to-date with the latest developments in the field.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.