Skip to content

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 #147

@shuwenli-tomo

Description

@shuwenli-tomo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions