Cordova-plugin-firebasex: Can we use this with capacitor ..??

Created on 3 Apr 2020  路  7Comments  路  Source: dpa99c/cordova-plugin-firebasex

I was trying to use this plugin with capacitor but I'm getting an error

ERROR: Crashlytics could not find the manifest. Not found

So, my question is does this plugin support capacitor or not. Thank you.

Most helpful comment

It works for me with Ionic 5 and Capacitor, take a look at my post on Stackoverflow here:

May @dpa99c can adjust the Plugin to copy the required file as required (for Capacitor)? It would be really great! :)

Hope it helps.

Cheers
Unkn0wn0x

All 7 comments

This plugin has been designed and tested for a Cordova environment; it may or may not work with Capacitor, but Capacitor is not explicitly supported and has not been tested.

hmmmm, this is odd as the Ionic docs strongly imply it is supported by capacitor - will try installing with Cordova and rebuilding

It works for me with Ionic 5 and Capacitor, take a look at my post on Stackoverflow here:

May @dpa99c can adjust the Plugin to copy the required file as required (for Capacitor)? It would be really great! :)

Hope it helps.

Cheers
Unkn0wn0x

Thx, @Unkn0wn0x it works!
But, i catch some error: Duplicate class com.google.common.util.concurrent.ListenableFuture found in modules jetified-guava-26.0-android.jar (com.google.guava:guava:26.0-android) and jetified-listenablefuture-1.0.jar (com.google.guava:listenablefuture:1.0)
I fixed is add to main app/build.gradle file new dep implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'.

After this all works like a charm.
And i have one question: how i can automate it? It's look a like dirty hack. 馃槬

It works for me with Ionic 5 and Capacitor, take a look at my post on Stackoverflow here:

May @dpa99c can adjust the Plugin to copy the required file as required (for Capacitor)? It would be really great! :)

Hope it helps.

Cheers
Unkn0wn0x

I am also facing the same problem but this solution has an issue. Every time the project is rebuild in Android studio, the changes will be lost. It's difficult to maintain it every time something changes. Is there a permanent solution to this?

I'm going to be honest. This following solution was super hacky, and I take no pride in it. But the ultimate solution which is to find a fix to the plugin itself isn't in the cards today.

Building off of Unkn0wn0x fix:

Having said that here is how I made it a bit more convenient. In the packages.json scripts from the root ionic project:

Note: This is for windows, I'm pretty sure for bash you need change the & to || in buildAndroid and change the slashes to /

"buildAndroid": "yarn buildAndroidDebug & yarn buildAndroidNext", "buildAndroidDebug": "cd android && ./gradlew assembleDebug", "buildAndroidNext": "copy .\\android\\capacitor-cordova-android-plugins\\src\\main\\AndroidManifest.xml .\\android\\capacitor-cordova-android-plugins\\build\\intermediates\\merged_manifests\\debug\\ && yarn buildAndroidDebug"

Then you run from the root project:

yarn buildAndroid

It works for me with Ionic 5 and Capacitor, take a look at my post on Stackoverflow here:

May @dpa99c can adjust the Plugin to copy the required file as required (for Capacitor)? It would be really great! :)

Hope it helps.

Cheers
Unkn0wn0x

@Unkn0wn0x @t4tapas did you find a way to automate this so it'll copy required files on each rebuild?
I did it locally on my own environment by manually copying and seems to work but I'll be using Ionic Appflow service to build and package so I guess this needs to be part of the automated build process.

Thanks!!

Was this page helpful?
0 / 5 - 0 ratings