bug: npx cap sync android breaks the ./gradlew bundleRelease
See original GitHub issueBug Report
Capacitor Version
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 4.0.1 @capacitor/core: 4.0.1 @capacitor/android: 4.0.1 @capacitor/ios: 4.0.1
Installed Dependencies:
@capacitor/ios: not installed @capacitor/cli: 4.0.1 @capacitor/core: 4.0.1 @capacitor/android: 4.0.1
[success] Android looking great! 👌
Platform(s)
Android
Current Behavior
After upgrade to capacitor 4, everytime I run npx cap sync android, the cli is changing 2 lines on both build.gradle (reference below) in a way that my next command (“./gradlew bundleRelease”) won’t run.
android/app/capacitor.build.gradle android/capacitor-cordova-android-plugins/build.gradle
Output after running ./gradlew bundleRelease
- What went wrong: Execution failed for task ‘:app:checkReleaseDuplicateClasses’.
Could not resolve all files for configuration ‘:app:releaseRuntimeClasspath’. Could not find platform(‘com.google.firebase:firebase-bom:30.3.1’). Required by: project :app project :app > project :capacitor-cordova-android-plugins Could not find com.google.firebase:firebase-analytics:. Required by: project :app project :app > project :capacitor-cordova-android-plugins
Expected Behavior
The lines should be like this
implementation platform(‘com.google.firebase:firebase-bom:30.3.1’)
instead of
implementation “platform(‘com.google.firebase:firebase-bom:30.3.1’)”
if I change it manually afterwards, it works.
Code Reproduction
The problem starts when adding cordova-plugin-firebase-* dependencies which include the Firebase Android BoM (Bill of Materials) ( I have many ).
I’ve created a minimal reproduction here: https://github.com/prosidney/reproduce-ionic-platform-issue
Other Technical Details
npm --version
output: 8.15.0
node --version
output: v18.7.0
pod --version
output (iOS issues only):
Additional Context
Firebase Android BoM (Bill of Materials) https://firebase.google.com/docs/android/learn-more#bom
Issue Analytics
- State:
- Created a year ago
- Comments:7 (1 by maintainers)
Top GitHub Comments
I’ve been testing and it wasn’t working on Capacitor 3 neither, using bom dependencies was not supported on cordova until cordova-android 11, released less than a month ago. It breaks now because you have updated to cordova-plugin-firebase-config 7.0.1, which was released 2 days ago and uses bom now. You can downgrade the plugin to version 6.1.0 until we fix the issue.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.