
This is a new flutter error I recently came across and wasn’t able to find solutions in Stack Overflow or other forums and sites.
lib\main.dart:Launching lib\main.dart on Redmi Note 7 Pro in debug mode...
FAILURE: Build failed with an exception.
*What went wrong:The Android Gradle plugin supports only kotlin-android-extensions Gradle plugin version 1.6.20 and higher.
The following dependencies do not satisfy the required version:project ':package_info_plus' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10*
Try:> Run with --stacktrace option to get the stack trace.
What was the problem? As you can see above, the package info plus package have a Kotlin version 1.6.10, however, the required version for the program to run was 1.6.20 and higher.
The obvious solution would be to update the package. If this doesn’t work, use flutter clean command and clear the cache and again get the package, but this time, changing the versions to latest for all packages got me with this error.
Anyway, this solution obviously didn’t work for me, because of conflicts between the packages. If I updated this info plus package, then another package hex color would show this error.
So Instead of updating packages all at ones, I went one by one. If I found the conflict, then I would downgrade to lower versions, until I find a good stable version which gives no conflict error message.
I had to do this for 4 packages one by one to find a stable version where there was no conflict between the packages and the Kotlin version was equal or higher than required.
The plugins which can causes conflict can be easily found(in most cases) by using command flutter pub outdated.
If anyone is confused how to use pub outdated command, you can go to the sites below:
Find and version bump outdated packages in Flutter
To further debug the issue, you can go to dependencies folder in your project.
