Skip to content

Android builds fail due to Kotlin metadata version mismatch with play-services-cast-framework 22.3.0 #486

@mblomdahl

Description

@mblomdahl

Description

All Android build jobs (build_android_apk, build_android_tv_apk, google_play) are failing during :app:compileReleaseKotlin with the following error:

Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.2.0, expected version is 2.0.0.

The error originates from play-services-cast-framework-22.3.0-api.jar, which is pulled in transitively by the react-native-google-cast dependency (^4.9.1). Google has updated play-services-cast-framework to version 22.3.0 which was compiled with Kotlin 2.2.0, but the project's Kotlin compiler version (bundled with Expo SDK 52 / React Native 0.76 / Gradle 8.10.2) is 2.0.x and cannot read the newer metadata format.

Affected workflows

  • build_android_apk.yml
  • build_android_tv_apk.yml
  • google_play.yml

How to reproduce

Trigger a build from any downstream branded app repo (e.g. cust-app-xrtube). All Android jobs fail at the Gradle compile step.

Build log excerpt

e: jetified-play-services-cast-framework-22.3.0-api.jar!/META-INF/...kotlin_module
   Module was compiled with an incompatible version of Kotlin.
   The binary version of its metadata is 2.2.0, expected version is 2.0.0.
> Task :app:compileReleaseKotlin FAILED

Suggested fix

Either:

  1. Pin play-services-cast-framework to a compatible version by adding a Gradle resolution strategy in app/build.gradle (e.g. force version 21.x that was compiled with Kotlin 2.0.x), or
  2. Upgrade the Kotlin version to 2.2.x via expo-build-properties (which may require broader Expo/React Native upgrades), or
  3. Add a dependency constraint in the Expo build properties plugin to cap the cast framework version

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