I have a problem with integrating Firebase into my Flutter project. As soon as I add the firebase_core in my project in the pubspec.yaml file, I get two errors. One of them is multidex support which can be fixed and it's okay. But the other one is a compilation error.
Here is the error:
e: C:/Users/DELL/.gradle/caches/transforms-3/8c29013e1aed588339a4f98b518cda7c/transformed/jetified-play-services-measurement-api-21.6.1-api.jar!/META-INF/java.com.google.android.gmscore.integ.client.measurement_api_measurement_api.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
along with the following:
[!] Your project requires a newer version of the Kotlin Gradle plugin. │
│ Find the latest version on https://kotlinlang.org/docs/releases.html#release-details, then │
│ update C:\Users\DELL\Desktop\newfer\android\build.gradle: │
│ ext.kotlin_version = '<latest-version>' │
Note that my Kotlin version is **higher **, and the latest version available and all the other problems are caused by the old incompatible versions.
And as soon as I remove the firebase_core, I have no problems and the code is compiled correctly.
What can be the problem?
Thanks in advance for any help. I have been stuck in this phase for a while now.