I want to add Firebase to my project. but, I always get error incompatible version with Kotlin module. I already add this code to my /android/build.gradle
<code> buildscript{
ext.kotlin_version = '1.9.0'
repositories {
google()
mavenCentral()
}
dependencies{
classpath 'com.google.gms:google-services:4.4.1'
classpath 'com.android.tools.build:gradle:4.2.2'
classpath "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}
}
plugins{
id 'com.google.gms.google-services' version '4.4.1' apply false
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
</code>
<code> buildscript{
ext.kotlin_version = '1.9.0'
repositories {
google()
mavenCentral()
}
dependencies{
classpath 'com.google.gms:google-services:4.4.1'
classpath 'com.android.tools.build:gradle:4.2.2'
classpath "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}
}
plugins{
id 'com.google.gms.google-services' version '4.4.1' apply false
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
</code>
buildscript{
ext.kotlin_version = '1.9.0'
repositories {
google()
mavenCentral()
}
dependencies{
classpath 'com.google.gms:google-services:4.4.1'
classpath 'com.android.tools.build:gradle:4.2.2'
classpath "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}
}
plugins{
id 'com.google.gms.google-services' version '4.4.1' apply false
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
and to my module gradle /android/app/build.gradle
<code> plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
id 'com.google.gms.google-services'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.pushnotif"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 19
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
dependencies {
implementation platform('com.google.firebase:firebase-bom:32.8.1')
implementation "com.google.firebase:firebase-messaging"
implementation 'com.google.firebase:firebase-analytics'
}
</code>
<code> plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
id 'com.google.gms.google-services'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.pushnotif"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 19
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
dependencies {
implementation platform('com.google.firebase:firebase-bom:32.8.1')
implementation "com.google.firebase:firebase-messaging"
implementation 'com.google.firebase:firebase-analytics'
}
</code>
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
id 'com.google.gms.google-services'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.pushnotif"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 19
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
dependencies {
implementation platform('com.google.firebase:firebase-bom:32.8.1')
implementation "com.google.firebase:firebase-messaging"
implementation 'com.google.firebase:firebase-analytics'
}
with my gradle.property
<code>distributionUrl=https://services.gradle.org/distributions/gradle-7.6.3-all.zip
</code>
<code>distributionUrl=https://services.gradle.org/distributions/gradle-7.6.3-all.zip
</code>
distributionUrl=https://services.gradle.org/distributions/gradle-7.6.3-all.zip
and my Kotlin module version in
<code>Current Kotlin plugin version: 232-1.9.0-release-358-AS10300.40.2321.11567975
</code>
<code>Current Kotlin plugin version: 232-1.9.0-release-358-AS10300.40.2321.11567975
</code>
Current Kotlin plugin version: 232-1.9.0-release-358-AS10300.40.2321.11567975
and I try with
<code>ext.kotlin_version='1.7.1'
</code>
<code>ext.kotlin_version='1.7.1'
</code>
ext.kotlin_version='1.7.1'
but still error. I don’t know how to fix this problem