Capacitor: bug: Capacitor build Android FIREBASE (Error)

Created on 12 May 2020  ·  14Comments  ·  Source: ionic-team/capacitor

Error Type com.google.firebase.iid.zzbg is referenced as an interface from com.google.firebase.messaging.zzf.

Capacitor Version

npx cap doctor output:
@capacitor/core 2.1.0

@capacitor/android 2.1.0

@capacitor/cli 2.1.0

@capacitor/ios 2.1.0

Affected Platform(s)

  • [X] Android
  • [ ] iOS
  • [ ] Electron
  • [ ] Web

Other Technical Details

npm --version output: 6.14.4

node --version output: v13.0.1

Other Information

It sounds like your Firebase dependencies don't match. ????

Most helpful comment

I have updated variables.gradle with this firebase messaging version, and it is working!

**firebaseMessagingVersion =  '20.1.6'**

Maybe this line should also be updated in the Ionic template with Capacitor and this updating guide:
https://capacitor.ionicframework.com/docs/android/updating

All 14 comments

can you provide a sample app?

I'm trying to upload the ionic conference to one repo today.

In addition i have this error: google-services.json not found, google-services plugin not applied. Push Notifications won't work

But google-services.json are in this folder android/app/*
why android studio are showing me this?

Here repo: https://github.com/SSuarezBrooktec/android_capacitor2.1

if you need google-services.json for Firebase, I can send you privately.

Project error:
Captura de pantalla 2020-05-12 a las 21 51 40

I have updated the project using this guide, but I still have problems :(
https://capacitor.ionicframework.com/docs/android/updating

Task :app:mergeExtDexDebug FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:mergeExtDexDebug'.

    Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
    Failed to transform artifact 'firebase-messaging.aar (com.google.firebase:firebase-messaging:20.1.2)' to match attributes {artifactType=android-dex, dexing-enable-desugaring=true, dexing-is-debuggable=true, dexing-min-sdk=21, org.gradle.usage=java-runtime}.
    Execution failed for DexingWithClasspathTransform: /Users/S/.gradle/caches/transforms-2/files-2.1/b431bcddf9026aa860f76c64355ee9b3/jetified-firebase-messaging-20.1.2-runtime.jar.
    Error while dexing.

  • 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.

  • Get more help at https://help.gradle.org

BUILD FAILED in 25s

I have updated variables.gradle with this firebase messaging version, and it is working!

**firebaseMessagingVersion =  '20.1.6'**

Maybe this line should also be updated in the Ionic template with Capacitor and this updating guide:
https://capacitor.ionicframework.com/docs/android/updating

I can't reproduce the

Error Type com.google.firebase.iid.zzbg is referenced as an interface from com.google.firebase.messaging.zzf

in your sample app, but might be related to conflicting firebase versions since you have plenty of firebase plugins (cordova and capacitor).
Going to close since you solved it by updating the firebase messaging version

About the google-services not found message, it's because of the cordova-support-google-services applying the google services plugin before Capacitor does and making it to fail, I've added it to the incompatible list since it's not needed
https://github.com/ionic-team/capacitor/pull/2912

Yes, yesterday i saw #2912 thanks anyway!

I have updated variables.gradle with this firebase messaging version, and it is working!

**firebaseMessagingVersion =  '20.1.6'**

Maybe this line should also be updated in the Ionic template with Capacitor and this updating guide:
https://capacitor.ionicframework.com/docs/android/updating

this worked for me. Thank you very much!

I have updated variables.gradle with this firebase messaging version, and it is working!

**firebaseMessagingVersion =  '20.1.6'**

Maybe this line should also be updated in the Ionic template with Capacitor and this updating guide:
https://capacitor.ionicframework.com/docs/android/updating

It worked for me too. Thanks !

このFirebaseメッセージングバージョンでvariables.gradleを更新しました。

**firebaseMessagingVersion =  '20.1.6'**

たぶんこの行は、コンデンサとこの更新ガイドを含むIonicテンプレートでも更新する必要があります:https :
//capacitor.ionicframework.com/docs/android/updating

Worked for me. Thanks!!

I have updated variables.gradle with this firebase messaging version, and it is working!

**firebaseMessagingVersion =  '20.1.6'**

Maybe this line should also be updated in the Ionic template with Capacitor and this updating guide:
https://capacitor.ionicframework.com/docs/android/updating

I tried this, but it fails when installing that version when doing 'Sync project with Gradle Files' with the following errors:

Unable to resolve dependency for ':capacitor-android@debug/compileClasspath': Could not resolve com.google.firebase:firebase-messaging:20.1.6.

Unable to resolve dependency for ':capacitor-android@debugAndroidTest/compileClasspath': Could not resolve com.google.firebase:firebase-messaging:20.1.6.

Unable to resolve dependency for ':capacitor-android@debugUnitTest/compileClasspath': Could not resolve com.google.firebase:firebase-messaging:20.1.6.

It seems like the installation fails, and then it doesn't find the dependency

I have updated variables.gradle with this firebase messaging version, and it is working!

**firebaseMessagingVersion =  '20.1.6'**

Maybe this line should also be updated in the Ionic template with Capacitor and this updating guide:
https://capacitor.ionicframework.com/docs/android/updating

This worked for me. Spent a lot of time on it before I found this. Maybe it should be in the Plugin instructions for @capacitor-community/firebase-analytics.

Was this page helpful?
0 / 5 - 0 ratings