it seems like a build or gradle setting error. Any thought of how to fix it?
[ +1 ms] e: Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors
it seems like a build or gradle setting error. Any thought of how to fix it?
[ +1 ms] e: Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors
This error will normally happen when the Kotlin version specified in your Android 'build.gradle' file is different from that bundled in Android Studio (or your preferred IDE in this case).
To solve it:
In Project Explorer of your Flutter project, navigate to android directory, and open build.gradle file.
NOTE: This is the overall 'build.gradle' file. Not the one inside the 'app' directory.
Your build.gradle file would look almost similar to the following snippet.
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Your Kotlin version is marked by this line ext.kotlin_version = '1.3.50'.
This version needs to be same as the version of Kotlin bundled in the IDE. You can find the version of the bundled Kotlin by opening the 'Problems' tool window (can normally be found on the bottom left in Android Studio).
Update the version, and re-run the Flutter project.