ARTICLE AD BOX
You are mixing two separate things:
Gradle Android Gradle Plugin (AGP)Gradle is the build tool that plugs everything together. Among others it retrieves all needed dependencies and runs the compiler to convert the source files you wrote into an executable application.
The Android Gradle Plugin (usually abbreviated to AGP) is a plugin for Gradle that adds a lot of aspects to the build process that are specific to creating an Android app.
There is a loose coupling between the two (see the compatibility matrix), but you always need both, and they both have different version numbers, although they look similar or even the same at first glance.
Now, your build files seem to run Gradle in version 8.14.3. This can be configured in the file gradle/wrapper/gradle-wrapper.properties. And you already discovered that the AGP version is specified in gradle/libs.versions.toml, which is your version catalog. You started out using AGP in version 8.6.0-alpha07.
The initial error message you got stated "Dependency [...] requires Android Gradle plugin 8.9.1 or higher". This means you should have set this in the version catalog (hold off for now, though, see below):
agp = "8.9.1"You instead set it to 8.14.3 which is not an existing AGP version, it is a Gradle version. That's what your second error message is all about.
There is one last caveat, though. AGP also requires support by the IDE. There is a compatibility matrix for that as well, although it only lists specific versions of Android Studio. You use IntelliJ IDEA, however. Android Studio is built upon IntelliJ IDEA, and AGP is also compatible with it, but I'm not aware of an official list of the specific versions which are supported for a given AGP version.
The AGP Upgrade Assistant however detects the latest AGP version your IDE supports, so it never recommends higher versions (they wouldn't work in that IDE). That's most likely the reason you don't get anything newer recommended than 8.6.0-alpha07.
The AGP Upgrade Assistant is usually the right way to upgrade your AGP version because it also takes care of updating everything else that is required, like the Gradle version. In your case, however, you need to either upgrade your IDE or downgrade all your dependencies that require a newer AGP version. That is at least androidx.core:core-ktx from your first error message, but it may very well be other dependencies too that you'll only find out about when you actually try to build your app.
Long story short: I recommend you update your IDE (or switch to Android Studio if you cannot easily update your IntelliJ IDEA version). You can have them both installed in parallel, and you can even have different versions of the same IDE installed at the same time. The easiest way to manage different IDE versions is probably to use the JetBrains Toolbox.
After installing a newer IDE you can use the AGP Upgrade Assistant to update AGP to the newest version and also update Gradle to a matching one.
A little heads up: Right now there is a big switch taking place from AGP 8 to AGP 9, including a Gradle update to version 9 as well. Several things changed, and not all tools and dependencies in the wild are already compatible. So you might want to hold off of AGP 9 and Gradle 9 for now (yeah, I know, they both share the same version 9 - but they are still different versions). You should at least try to get your app to build with AGP 8 first, then you can try the upgrade to AGP 9.
