[📚] migrating-to-v27: Android fails on Expo SDK 58 (Kotlin 2.2) — document the BoM 34.19.0 override

Abierto Apto para principiantes
#9,418 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
85/100
Tipo de issue
Documentación
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
android, kotlin, react-native

Línea de trabajo

Empieza con la sección de Android/Kotlin de docs/migrating-to-v27.mdx y la guía existente «Overriding Native SDK Versions». Añade una nota sobre Expo que explique la sobrescritura de BoM a 34.19.0 y el enfoque de config-plugin de Expo CNG que se muestra en el issue; considera añadir la nota correspondiente sobre la compatibilidad con Android a platforms.mdx. El trabajo estará listo cuando ambos documentos expliquen claramente la solución temporal y cuándo quitar la fijación de versión.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Documentation Feedback

The v27 migration guide (docs/migrating-to-v27.mdx) says the only supported Android path is Kotlin ≥ 2.4.0, because Firebase Android BoM 35 / firebase-auth 25 ships Kotlin 2.4 metadata. It does not mention Expo, and Expo's current release can't meet that requirement without overriding Expo's own toolchain.

What happens on Expo

Expo SDK 58 ([email protected], [email protected]) builds with Kotlin 2.2.10 and a matching KSP pin. A fresh @react-native-firebase/{app,auth}@27.1.0 install fails at :react-native-firebase_auth:compileReleaseKotlin on EAS:

e: .../firebase-auth-25.0.0-api.jar!/META-INF/java.com.google.android.gmscore.integ.client.firebase-auth-api_firebase-auth-api.kotlin_module
   Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.4.0, expected version is 2.2.0.

Nothing in the guide, the Expo install docs or platforms.mdx tells an Expo user what to do here. The only workaround offered is the unsupported -Xskip-metadata-version-check flag, which Expo CNG users can't easily apply anyway.

A smaller, already-documented workaround

v27.0.0 was cut on BoM 34.19.0 (ca054bc), and the later bump to 35 (0ca03d1) only changed gradle version strings, no Kotlin sources. So 27.x compiles fine against 34.19.0 using the override the site already documents under "Overriding Native SDK Versions":

// android/build.gradle (root)
project.ext {
  set('react-native', [versions: [firebase: [bom: '34.19.0']]])
}

For Expo CNG (no checked-in android/), the same thing as a config plugin:

// plugins/withFirebaseBom.js
const { withProjectBuildGradle } = require('expo/config-plugins')

module.exports = function withFirebaseBom(config, { bom }) {
  return withProjectBuildGradle(config, (config) => {
    config.modResults.contents += `
project.ext {
  set('react-native', [versions: [firebase: [bom: '${bom}']]])
}
`
    return config
  })
}
// app.config.js
plugins: [
  ['./plugins/withFirebaseBom.js', { bom: '34.19.0' }],
  '@react-native-firebase/app',
  '@react-native-firebase/auth',
]

Verified: the EAS build then passes and the log prints firebase.bom using custom value: 34.19.0.

Suggested change

In migrating-to-v27.mdx, under the Android/Kotlin section, add an "Expo" note along the lines of:

Expo SDK 58 builds with Kotlin 2.2 and does not yet support Kotlin 2.4. Until it does, pin the Firebase Android BoM to 34.19.0 (the last BoM built with Kotlin ≤ 2.2 that v27 was released on) using the SDK version override. For Expo CNG, apply it with a withProjectBuildGradle config plugin (example above). Remove the pin once your Expo SDK uses Kotlin ≥ 2.4.

A matching line in platforms.mdx (Android support matrix) would also help.

Environment
  • @react-native-firebase/app, auth, app-check 27.1.0
  • expo 58.0.21, react-native 0.88.1, EAS Build
  • Kotlin 2.2.10 (Expo default), KSP 2.2.10-2.0.2
Lenguaje dominante
TypeScript
Estrellas
12.3k
Forks
2.3k
Merge medio
1 d 19 h
PR fusionados (30 d)
21

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de invertase/react-native-firebase

Todos los issues de invertase/react-native-firebase

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.