Compile error on Android15 (SDK 35)
Describe the bug I upgrade my compile SDK to 35,then raising a compile error for kotlin nullability when I run project.
To Reproduce Steps to reproduce the behavior:
- Upgrade app/build.gradle compile sdk to 35 like below:
android {
namespace "..."
compileSdk 35
ndkVersion flutter.ndkVersion
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
applicationId "..."
minSdkVersion 21
targetSdkVersion 35
versionCode flutterVersionCode
versionName flutterVersionName
multiDexEnabled = true
}
//...
}
- Run
- See error
e: file:///Users/yhq/.pub-cache/hosted/pub.dev/smart_auth-2.0.0/android/src/main/kotlin/fman/ge/smart_auth/AppSignatueHelper.kt:38:30 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type SigningInfo? e: file:///Users/yhq/.pub-cache/hosted/pub.dev/smart_auth-2.0.0/android/src/main/kotlin/fman/ge/smart_auth/AppSignatueHelper.kt:39:20 Type mismatch: inferred type is Array<(out) Signature!>? but Array<Signature> was expected
SmartAuth version: 2.0.0
Result of: flutter doctor --verbose
Smartphone (please complete the following information):
- Device: Samsung Galaxy S22
- OS: Android 14