Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed resolution of: Lcom/google/firebase/iid/FirebaseInstanceId #744

Closed
mtrakal opened this issue May 19, 2021 · 21 comments
Closed

Failed resolution of: Lcom/google/firebase/iid/FirebaseInstanceId #744

mtrakal opened this issue May 19, 2021 · 21 comments

Comments

@mtrakal
Copy link

mtrakal commented May 19, 2021

    implementation 'com.mixpanel.android:mixpanel-android:5.9.1'

    // Firebase
    implementation platform('com.google.firebase:firebase-bom:28.0.1')

    implementation 'com.google.firebase:firebase-messaging'
    implementation "com.google.firebase:firebase-config"
    implementation 'com.google.firebase:firebase-core'
    implementation 'com.google.firebase:firebase-dynamic-links'
    implementation 'com.google.firebase:firebase-auth-ktx'
    implementation 'com.google.firebase:firebase-analytics'
    implementation 'com.google.firebase:firebase-database-ktx'
    implementation 'com.google.firebase:firebase-firestore-ktx'
    implementation 'com.google.firebase:firebase-crashlytics'

Crash on startapp

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/iid/FirebaseInstanceId;
        at com.mixpanel.android.mpmetrics.MixpanelFCMMessagingService.init(MixpanelFCMMessagingService.java:84)
        at com.mixpanel.android.mpmetrics.MixpanelAPI.getInstance(MixpanelAPI.java:655)
        at com.mixpanel.android.mpmetrics.MixpanelAPI.getInstance(MixpanelAPI.java:536)
        at myapp.App.onCreate(App.kt:52)

myapp.App.onCreate(App.kt:52):

MixpanelAPI.getInstance(this, BuildConfig.MIXPANEL_TOKEN)

Firebase: 28.0.1 don't contain FirebaseInstanceId at all. It was deprecated a few versions ago. You should use: FirebaseMessaging.getToken() for messaging or FirebaseInstallations for app instance identifiers. More info: https://firebase.google.com/docs/reference/android/com/google/firebase/iid/FirebaseInstanceId

@MDXDave
Copy link

MDXDave commented Jun 1, 2021

You can fix this issue by adding the firebase-iid dependency:

implementation("com.google.firebase:firebase-iid")

@Sanam-Bdr-Gurung
Copy link

You can fix this issue by adding the firebase-iid dependency:

implementation("com.google.firebase:firebase-iid")

Thanks for the fix.

@sundardsTechMind
Copy link

Add this line into implementation section (android/app/build.gradle)
dependencies {
implementation "com.google.firebase:firebase-iid"
}

Thanks @MDXDave for letting know this to everyone. I appreciate you're valuable time.::)

@owolp
Copy link

owolp commented Jun 10, 2021

Thank you @MDXDave for the workaround.
I've also added an explanation to the implementation

implementation("com.google.firebase:firebase-iid") {
        because("https://github.com/mixpanel/mixpanel-android/issues/744")
}

@yangcheng
Copy link

when can we expect a proper fix by removing the deprecated dependency ?

@trickeyd
Copy link

yes agree with @yangcheng - would be good to remove this.

Thanks to @MDXDave and @owolp BTW - I was pretty stuck

@ubarua123
Copy link

when can we expect a proper fix by removing the deprecated dependency ?

This is actually important since apps will have conflicts with FirebaseMessaging and FirebaseInstanceId.

@zihejia
Copy link
Contributor

zihejia commented Jul 7, 2021

Thanks for bringing it up. We will address this issue as a priority.

@Shinwari536
Copy link

I don't know how to thank you. You solve my issue which I have been facing for more than 2 weeks. I added the dependency and it worked. Thanks again.

@krutarth-h-dave
Copy link

You can fix this issue by adding the firebase-iid dependency:

implementation("com.google.firebase:firebase-iid")

Much thanks. Solved the issue which was keeping me to upgrade dependencies appwide. Much thanks.

@omarreess
Copy link

Added these in App's Build gradl dependencies 

implementation platform('com.google.firebase:firebase-bom:28.0.1')
implementation("com.google.firebase:firebase-iid")

@luansingjavier
Copy link

@omarreess Thanks for this. I already solved my issue.

@zihejia
Copy link
Contributor

zihejia commented Oct 7, 2021

We have released v5.9.4 which has the fix for the missing dependency. We are deprecating Messaging and Mobile A/B testing features(more details) so the FCM service will be removed soon from our SDK. I'm closing this one now, please feel free to raise any questions.

@benpratt22
Copy link

Just in case somebody else lands here, v5.9.2 has an issue, use 5.9.4 and it works! Thanks @zihejia

@zihejia
Copy link
Contributor

zihejia commented Oct 20, 2021

thanks @benpratt22 !

@brianschrameck
Copy link

I'm still getting this issue on 5.9.4 and 5.9.5:

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/iid/FirebaseInstanceId;

Adding the dependency manually fixes the issue still, but I thought this was fixed correctly by Mixpanel?

@rmazajev
Copy link

Having same issue with 5.9.5

@Niel-Torres
Copy link

Check that you have these dependences in "build.gradle":

Android>App>build.gradle

      dependences{
         implementation platform('com.google.firebase:firebase-bom:29.0.1')
         implementation('com.google.firebase:firebase-iid')
         implementation 'com.google.firebase:firebase-messaging'
      }

Android>build.gradle

      dependences{
          classpath 'com.android.tools.build:gradle:4.2.1'
          classpath 'com.google.gms:google-services:4.3.10'
          classpath 'com.google.firebase:firebase-messaging:21.0.1'
      }

@ghost
Copy link

ghost commented Jul 22, 2022

Added these in App's Build gradl dependencies 

implementation platform('com.google.firebase:firebase-bom:28.0.1')
implementation("com.google.firebase:firebase-iid")

It's working for me

@gldstrrbt
Copy link

@Niel-Torres thank you so damn much. I'm not even using mixpanel, but your solution solved a big problem I've been facing these last few days. Android configs are new to me, but with help like this I'm slowly picking up its env. Thank you again

@AhmadRaza159
Copy link

AhmadRaza159 commented Nov 29, 2022

After adding implementation("com.google.firebase:firebase-iid")
got this error
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.google.firebase:firebase-iid:.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests