analytics_flutter icon indicating copy to clipboard operation
analytics_flutter copied to clipboard

Android build error "Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'android.content.pm.ApplicationInfo?" with compileSdkVersion 35

Open shuwenli-tomo opened this issue 7 months ago • 1 comments

e: file:///Users/xxx/.pub-cache/hosted/pub.dev/segment_analytics-1.1.3/android/src/main/kotlin/com/segment/analytics/AnalyticsPlugin.kt:146:59 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'android.content.pm.ApplicationInfo?'.

Reproduce:

  1. segment-analysis: 1.1.3
  2. upgrade compileSdkVersion 34 to 35
  3. build and run android

Possible reason: In Kotlin 35, the PackageInfo.java mark ApplicationInfo with Nullable annotation.

shuwenli-tomo avatar Mar 31 '25 04:03 shuwenli-tomo