[firebase_in_app_messaging]: Android build fails with `Could not find com.google.firebase:firebase-inappmessaging:.` since 0.10.0
Los mantenedores suelen responder en 1 día
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Is there an existing issue for this?
- I have searched the existing issues.
Which plugins are affected?
In-App Messaging
Which platforms are affected?
Android
Description
Since firebase_in_app_messaging 0.10.0, any Flutter Android app that depends on the plugin fails to build. Gradle cannot resolve the app's debugCompileClasspath because com.google.firebase:firebase-inappmessaging and com.google.firebase:firebase-inappmessaging-display are requested without a version.
Expected: flutter build apk succeeds on a freshly created app with only firebase_core and firebase_in_app_messaging added (as it does with 0.9.4).
Actual: The build fails with Could not find com.google.firebase:firebase-inappmessaging:. / Could not find com.google.firebase:firebase-inappmessaging-display:.
#18586 changed the plugin's android/build.gradle to expose the Firebase artifacts as api, while the Firebase BoM is still declared as implementation platform(...):
dependencies {
api firebaseCoreProject
implementation platform("com.google.firebase:firebase-bom:${getRootProjectExtOrCoreProperty("FirebaseSDKVersion", firebaseCoreProject)}")
// `api` so app Java compilation can resolve FirebaseInAppMessagingDisplay,
// which the plugin class implements.
api 'com.google.firebase:firebase-inappmessaging'
api 'com.google.firebase:firebase-inappmessaging-display'
implementation 'androidx.annotation:annotation:1.7.0'
}
The versionless api dependencies are exported to the consuming app's compile classpath, but the BoM is an implementation dependency, so its version constraints are not. As a result, the app sees firebase-inappmessaging and firebase-inappmessaging-display with an empty version.
Results with Flutter 3.47.8 (AGP 9.1.0, Gradle 9.3.1, KGP 2.4.0):
| firebase_in_app_messaging | firebase_core | Kotlin app (flutter create) |
Java app (flutter create -a java) |
|---|---|---|---|
| 0.9.4 | 4.15.2 | ✅ builds | ✅ builds |
| 0.10.0 | 5.1.0 | ❌ fails (:app:processDebugResources) |
❌ fails (:app:processDebugResources) |
| 0.10.1 | 5.1.0 | ❌ fails (:app:compileDebugKotlin) |
❌ fails (:app:processDebugResources) |
Workaround: add the Firebase BoM to the app module:
// android/app/build.gradle.kts
dependencies {
implementation(platform("com.google.firebase:firebase-bom:35.1.0"))
}
Reproducing the issue
flutter create --platforms android iam_reprocd iam_reproflutter pub add firebase_core firebase_in_app_messaging(resolvesfirebase_core5.1.0,firebase_in_app_messaging0.10.1)flutter build apk --debug
No Dart code changes or google-services.json are needed to reproduce; the failure happens while Gradle resolves dependencies.
Firebase Core version
5.1.0
Flutter Version
3.47.8
Relevant Log Output
Running Gradle task 'assembleDebug'...
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by net.rubygrapefruit.platform.internal.NativeLibraryLoader in an unnamed module (file:/Users/koji/.gradle/wrapper/dists/gradle-9.3.1-all/9ot9r568e8zfvvd4mn8rbu1j0/gradle-9.3.1/lib/native-platform-0.22-milestone-29.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
WARNING: Your app uses the following plugins that apply Kotlin Gradle Plugin (KGP): firebase_core, firebase_in_app_messaging
Future versions of Flutter will fail to build if your app uses plugins that apply KGP.
Please check the changelogs of these plugins and upgrade to a version that supports Built-in Kotlin.
If no such version exists, report the issue to the plugin. If necessary, here is a guide on filing
an issue against a plugin: https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin/for-app-developers#report-incompatible-kotlin-gradle-plugin-usage-to-plugin-authors
If you are a plugin author, please migrate your plugin to Built-in Kotlin using this guide: https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin/for-plugin-authors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> Error while evaluating property 'friendPathsSet$kotlin_gradle_plugin_common' of task ':app:compileDebugKotlin'.
> Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not find com.google.firebase:firebase-inappmessaging:.
Required by:
project ':app' > project :firebase_in_app_messaging
> Could not find com.google.firebase:firebase-inappmessaging-display:.
Required by:
project ':app' > project :firebase_in_app_messaging
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights from a Build Scan (powered by Develocity).
> Get more help at https://help.gradle.org.
BUILD FAILED in 4s
Running Gradle task 'assembleDebug'... 4.4s
Gradle task assembleDebug failed with exit code 1
Flutter dependencies
Expand Flutter dependencies snippet
Dart SDK 3.13.7
Flutter SDK 3.47.8
iam_repro 1.0.0+1
dependencies:
- cupertino_icons 1.0.9
- firebase_core 5.1.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_in_app_messaging 0.10.1 [firebase_core firebase_core_platform_interface firebase_in_app_messaging_platform_interface flutter meta]
- flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine]
dev dependencies:
- flutter_lints 6.0.0 [lints]
- flutter_test 0.0.0 [flutter test_api matcher path fake_async clock stack_trace vector_math leak_tracker_flutter_testing collection meta stream_channel]
transitive dependencies:
- _flutterfire_internals 1.3.79 [collection firebase_core firebase_core_platform_interface flutter meta]
- async 2.13.1 [collection meta]
- boolean_selector 2.1.2 [source_span string_scanner]
- characters 1.4.1
- clock 1.1.3
- collection 1.19.1
- fake_async 1.3.3 [clock collection]
- firebase_core_platform_interface 8.1.1 [collection flutter meta plugin_platform_interface]
- firebase_core_web 4.1.0 [firebase_core_platform_interface meta web]
- firebase_in_app_messaging_platform_interface 0.2.7+30 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
- leak_tracker 11.0.2 [clock collection meta path vm_service]
- leak_tracker_flutter_testing 3.0.10 [flutter leak_tracker leak_tracker_testing matcher meta]
- leak_tracker_testing 3.0.2 [leak_tracker matcher meta]
- lints 6.1.0
- matcher 0.12.20 [async meta stack_trace term_glyph test_api]
- material_color_utilities 0.13.0 [collection]
- meta 1.18.3
- path 1.9.1
- plugin_platform_interface 2.1.8 [meta]
- sky_engine 0.0.0
- source_span 1.10.2 [collection path term_glyph]
- stack_trace 1.12.2 [path]
- stream_channel 2.1.4 [async]
- string_scanner 1.4.1 [source_span]
- term_glyph 1.2.2
- test_api 0.7.12 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph]
- vector_math 2.4.0
- vm_service 15.4.0
- web 1.1.2
Additional context and comments
Possible fix:
- Revert
firebase-inappmessagingandfirebase-inappmessaging-displaytoimplementation(as in 0.9.4), so they are not exported to the app. - Stop having
FirebaseInAppMessagingPluginimplementFirebaseInAppMessagingDisplaydirectly, and instead set a private property (for example, a lambda) as the display component, so the plugin class's public API no longer references Firebase In-App Messaging types and the app can compileGeneratedPluginRegistrantwithout them.
- Lenguaje dominante
- Dart
- Estrellas
- 9.3k
- Forks
- 4.1k
- Merge medio
- 1 d 15 h
- PR fusionados (30 d)
- 82
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de firebase/flutterfire
-
[firebase_messaging]: Android ANR during background service destruction — main thread blocked in releaseWakeLockPosiblemente ocupada @SelaseKay la tomó hace 4 días. AbiertoNeeds Attention platform: android plugin: messaging reproduced type: bug
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
firebase/flutterfire#18866 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
blocked: customer-response Needs Attention platform: ios plugin: messaging Stale type: bug
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
firebase/flutterfire#18776 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
[firebase_storage] Windows native crash in upload progress callback, sink ownership and thread dispatchQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abiertoblocked: flutter platform: windows plugin: storage reproduced type: bug
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
firebase/flutterfire#18664 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
[core] Decouple platform_interface from Flutter for pure-Dart webQuizá libre de nuevo @Lyokone la tomó hace 40 días y no hay ningún pull request abierto. AbiertoNeeds Attention platform: all platform: web plugin: core type: enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
firebase/flutterfire#18645 · 3 comentarios · 2 reacciones · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
blocked: firebase-sdk platform: android plugin: messaging reproduced type: bug
Dificultad 3/5 1-2 días Aptitud para principiantes 56/100
firebase/flutterfire#18644 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de firebase/flutterfire
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
google/skills_lint.dart#165 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
good first issue help wanted translation
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
blankframe-tech/ThrottleIQ#23 ·
Los mantenedores suelen responder en 5 días
-
good first issue mobile P0 size:S
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
trufi-association/trufi-core#1024 ·
Los mantenedores suelen responder en 14 días