I import package from pub.dev
workmanager: ^0.5.2
then I run my project and I get this error
` A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
Duplicate class kotlin.collections.jdk8.CollectionsJDK8Kt found in modules jetified-kotlin-stdlib-1.8.10 (org.jetbrains.kotlin:kotlin-stdlib:1.8.10) and jetified-kotlin-stdlib-jdk8-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20)`
So I change my kotlin version in setting.gradle
file as below
before
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
}
after
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.8.10" apply false
}
after this I getting below Error
ERROR:D:demobuildworkmanagerintermediatesruntime_library_classes_jardebugclasses.jar: D8: com.android.tools.r8.internal.Hc: Sealed classes are not supported as program classes
to solve this error I follow this /questions/73453524/ after this I get another error is
Could not find method dependencies() for arguments [settings_6h1jfprapbazntevniwzdshu9$_run_closure1$_closure5@4011c54d] on object of type org.gradle.plugin.management.internal.DefaultPluginManagementSpec.
setting.gradle file
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}
settings.ext.flutterSdkPath = flutterSdkPath()
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven {
url = uri("https://storage.googleapis.com/r8-releases/raw")
}
}
dependencies {
classpath("com.android.tools:r8:8.2.24")
}
}
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.8.10" apply false
}
include ":app"
- Android Studio Version: Jellyfish | 2023.3.1 Patch 2
- Android Gradle version: 7.6.3
- JDK version: 17.0.10
- CompileSdk: 34
I hope I will get a solution. Thank you.