Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!
We spend hours on Instagram and YouTube and waste money on coffee and fast food, but wonβt spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!
Learn from Guru Rajesh Kumar and double your salary in just one year.
Error
Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint: deprecation for details. e: C:/Users/dharm/.gradle/caches/modules-2/files-2.1/androidx.lifecycle/lifecycle-common/2.6.1/10f354fdb64868baecd67128560c5a0d6312c495/lifecycle-common-2.6.1.jar!/META-INF/lifecycle-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.5.1. site:stackoverflow.com

Edit Adding build. gradle below:
def localProperties = new Properties() | |
def localPropertiesFile = rootProject.file('local.properties') | |
if (localPropertiesFile.exists()) { | |
localPropertiesFile.withReader('UTF-8') { reader -> | |
localProperties.load(reader) | |
} | |
} | |
def flutterRoot = localProperties.getProperty('flutter.sdk') | |
if (flutterRoot == null) { | |
throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") | |
} | |
def flutterVersionCode = localProperties.getProperty('flutter.versionCode') | |
if (flutterVersionCode == null) { | |
flutterVersionCode = '1' | |
} | |
def flutterVersionName = localProperties.getProperty('flutter.versionName') | |
if (flutterVersionName == null) { | |
flutterVersionName = '1.0' | |
} | |
apply plugin: 'com.android.application' | |
apply plugin: 'com.google.gms.google-services' | |
apply plugin: 'kotlin-android' | |
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" | |
android { | |
compileSdkVersion 31 | |
compileOptions { | |
sourceCompatibility JavaVersion.VERSION_1_8 | |
targetCompatibility JavaVersion.VERSION_1_8 | |
} | |
kotlinOptions { | |
jvmTarget = '1.8' | |
} | |
sourceSets { | |
main.java.srcDirs += 'src/main/kotlin' | |
} | |
defaultConfig { | |
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). | |
applicationId "com.example.rapid_reps" + | |
"" | |
minSdkVersion 21 | |
targetSdkVersion 30 | |
versionCode flutterVersionCode.toInteger() | |
versionName flutterVersionName | |
} | |
buildTypes { | |
release { | |
signingConfig signingConfigs.debug | |
} | |
} | |
} | |
flutter { | |
source '../..' | |
} | |
dependencies { | |
implementation platform('com.google.firebase:firebase- | |
bom:29.0.0') | |
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | |
} |
Solution
You need to update your kotlin gradle plugin version to any latest in gradle (project), you can probably use 1.5.10. The version you have used is 1.1.15, and its not a valid version.
- Kotlin-related errors:
- βType mismatchβ error: This occurs when you try to assign a value of one type to a variable of another incompatible type. Make sure the types match or perform appropriate type conversions.
- βNull pointer exceptionβ (NPE): This error indicates that youβre trying to access or call a method on a null object reference. Ensure that the object is properly initialized before accessing its properties or methods.
- βUnresolved referenceβ error: This typically means that youβre referring to a variable, function, or class that hasnβt been declared or imported. Check for typos in the name or ensure the necessary imports are present.
- Emulator-related errors:
- βEmulator: emulator: ERROR: GPU emulation is disabledβ: This error occurs when the emulator cannot enable GPU acceleration. Ensure that your systemβs graphics drivers are up to date and that your computerβs hardware supports GPU acceleration.
- βEmulator: Process finished with exit code Xβ: This error message indicates that the emulator terminated unexpectedly with a specific exit code. The exit code can provide more information about the cause of the error. Look for additional error messages or logs to identify the underlying issue.