Closed klaurtar closed 2 months ago
Please sync your Gradle project files and try it again. Let me know if this helps.
@robingenz I have synced my Gradle project on both the reproduced error posted on Github and my real application and the same error persists. For now, the only way I have been able to get both applications to build and run is to revert back to @capacitor-firebase/analytics@5.4.1 using the force command which starts throwing peer dependency errors due to the capacitor v6 migration. Also, just to be thorough, iOS builds and runs successfully. Android is the only issue at v6.1.0
npm i @capacitor-firebase/analytics@5.4.1 --force
@klaurtar I took a look at your linked reproduction. Unfortunately, it is not a minimal, reproducible example. There are way too many dependencies. Please have a look at the Capacitor Firebase Plugin Demo app. It uses capacitor-firebase/analytics@6.x.x
and firebase@10.x.x
and I could not reproduce your problem there.
@klaurtar I took a look at your linked reproduction. Unfortunately, it is not a minimal, reproducible example. There are way too many dependencies. Please have a look at the Capacitor Firebase Plugin Demo app. It uses
capacitor-firebase/analytics@6.x.x
andfirebase@10.x.x
and I could not reproduce your problem there.
Ok, please do not close this topic. I will reproduce a minimal example with less dependencies and add it to the bug report.
@robingenz Please check the provided repo again. I have npm uninstalled all npm packages aside from the the basic necessary requirements to scaffold an android app using the Ionic framework. I have kept "@capacitor-firebase/analytics": "^6.1.0"
This example has no bloat and is failing.
You specified a custom Firebase Analytics version instead of using the plugins default one. This fixes your issue:
Thanks for the quick reply. I believe I added this due to the instructions for the npm package. I don't need to specify it for it to work? Here is the part of the docs that caused confusion:
No, you don't need to specify it. The plugin will use the variable if a variable exists. Otherwise the default version is used.
I will close this issue as completed.
Plugin(s)
Version
6.1.0
Platform(s)
Current behavior
When trying to run an Android app in Android studio that has capacitor-firebase/analytics@6.x.x and firebase@10.x.x installed through npm, the app fails with two errors stemming from FirebaseAnalyticsHelper.java file:
Expected behavior
The app should succeed in building and running with the latest version of capacitor-firebase/analytics and firebase installed
Reproduction
https://github.com/klaurtar/bad-capacitor-firebase/tree/main
Steps to reproduce
Clone the repo, and npm install the dependencies. Once that is done, use the comman
ionic cap sync android
thenionic cap open android
to open the project in Android Studio. Press the play button and the app should error out.Other information
No response
Capacitor doctor
[warn] The bundledWebRuntime configuration option has been deprecated. Can be safely deleted. 💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 6.1.1 @capacitor/core: 6.1.1 @capacitor/android: 6.1.1 @capacitor/ios: 6.1.1
Installed Dependencies:
@capacitor/core: 6.1.1 @capacitor/cli: 6.1.1 @capacitor/ios: 6.1.1 @capacitor/android: 6.1.1
[success] iOS looking great! 👌 [success] Android looking great! 👌
Before submitting