android / codelab-kotlin-coroutines

Kotlin Coroutines codelab
Apache License 2.0
552 stars 268 forks source link

App crashes on Android S+ because of missing Flag in executePendingIntent() #158

Closed tillkrempel closed 2 years ago

tillkrempel commented 2 years ago

When trying to do the advanced coroutines codelab using an emulator with Android S, the application crashes as the FLAG_IMMUTABLE or FLAG_MUTABLE is not set, which seems to be required on that platform version.

JaesungLeee commented 2 years ago

Me either :(

lmint1 commented 2 years ago

Go to build.gradle (root) and change the work_version to 2.7.0:

//def work_version = '2.2.0'
def work_version = '2.7.0'
katiedotson commented 2 years ago

@lmint1 's suggestion worked, but I also had to specify the Java Version in the sunflower build.gradle:

compileOptions {
  sourceCompatibility JavaVersion.VERSION_1_8
  targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
  jvmTarget = '1.8'
}