question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: npx cap sync android breaks the ./gradlew bundleRelease

See original GitHub issue

Bug 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:closed
  • Created a year ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jcesarmobilecommented, Aug 3, 2022

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.

0reactions
ionitron-bot[bot]commented, Nov 10, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 11, Ionic 5 , Capacitor 2 gradle sync error "Caused by
(If it's already open, close the project, not android studio); You will get a list ... Open your project and delete the folder...
Read more >
"ionic cap add android" fails with "Error running gradle sync"
This is fine, just run npx cap open android and import and sync gradle manually. I cannot figure out what is suddenly wrong...
Read more >
Build your app from the command line | Android Developers
Find out how you can execute all the build tasks available to your Android project using the Gradle wrapper command line tool.
Read more >
Troubleshooting Android Issues | Capacitor Documentation
First of all, make sure the plugin is installed and appears in the package.json . Then, run npx cap sync android . Finally,...
Read more >
deprecated gradle features were used in this build making it ...
This is fine, just run npx cap open android and import and sync gradle manually ✓ Syncing Gradle in 2.21s [success] android platform...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found