Skip to content Skip to sidebar Skip to footer

Can't Use Firebase Ads: No Static Method Zzc(Landroid/os/Bundle;

I'm trying to add the Firebase ads library to my project (which is already live), the build works but when i try to run it crashes with this error: 11-16 10:33:13.535 540-540/com.

Solution 1:

So i found a solution to my problem, but it's not really the best way in my opinion.

I had to downgrade several firebase lib until it works as you can see on my graddle.

implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.google.firebase:firebase-messaging:17.3.2'
implementation 'com.google.firebase:firebase-storage:16.0.2'
implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-database:16.0.2'
implementation 'com.firebaseui:firebase-ui-storage:2.0.1'
implementation 'com.google.firebase:firebase-dynamic-links:16.1.1'
implementation 'com.google.firebase:firebase-analytics:16.0.3'
implementation 'com.google.firebase:firebase-config:16.0.0'
implementation 'com.google.firebase:firebase-invites:16.0.3'
implementation 'com.google.firebase:firebase-functions:16.1.0'
implementation 'com.google.firebase:firebase-ads:15.0.1'

implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'com.android.billingclient:billing:1.1'

Apparently some libs depend on each other. For now i won't update them to their latest version... It would be really appreciated if i could have more information about this.


Solution 2:

please replace com.google.firebase:firebase-ads:17.1.1 with com.google.firebase:firebase-ads:17.1.0


Solution 3:

Make sure that firebase-core and firebase-ads are up to date by specifying the last version.

At the time of writing my answer they are:

implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-ads:17.1.2'

Solution 4:

Change implementation 'com.google.firebase:firebase-core:16.0.4' to implementation 'com.google.firebase:firebase-core:+'


Solution 5:

well i have spent 2 days on the exact same pbs. So first, i changed implementation 'com.google.firebase:firebase-core:16.0.4' -> implementation 'com.google.firebase:firebase-core:16.0.5' but, when running it, it could not find the exact version 16.0.5. So what ends up working weirdly for me, is to change 'com.google.firebase:firebase-core:16.0.4' -> implementation 'com.google.firebase:firebase-core:+'

Here is my app level build.gradle dependencies, in case it might be helpful: dependencies {

implementation fileTree(include: ['*.jar'], dir: 'libs')


configurations.androidTestImplementation.dependencies.each { androidTestImplementationDependency ->
    androidTestImplementationDependency.exclude group: 'com.android.support'
}

implementation ("com.android.support:support-v4:28.0.0") {
    force = true //<-- force dependency resolution to 28.0.0 in my case
}
implementation project(':slyce-messaging')
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.android.support:support-core-utils:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.google.firebase:firebase-core:+'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.6'
implementation 'com.google.firebase:firebase-database:16.0.5'
implementation 'com.google.firebase:firebase-storage:16.0.5'
implementation 'com.google.firebase:firebase-crash:16.2.1'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-config:16.1.0'
implementation 'com.google.firebase:firebase-invites:16.0.4'
implementation 'com.firebaseui:firebase-ui:2.0.1'
implementation 'com.google.android.gms:play-services-appinvite:16.0.5'
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.firebase:firebase-jobdispatcher:0.5.2'
implementation 'net.rimoto:intlphoneinput:1.0.1'
implementation 'com.github.marlonlom:timeago:3.0.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support:support-annotations:28.0.0'
implementation 'com.google.firebase:firebase-ads:17.1.1'

}

apply plugin: 'com.google.gms.google-services'

Below is the error message, i got same thing : java.lang.NoSuchMethodError: No static method zzc(Landroid/os/Bundle;)Lcom/google/android/gms/measurement/internal/zzak; in class Lcom/google/android/gms/measurement/internal/zzak; or its super classes (declaration of 'com.google.android.gms.measurement.internal.zzak' appears in ...) at com.google.firebase.analytics.connector.AnalyticsConnectorImpl.getInstance(Unknown Source) at com.google.firebase.analytics.connector.internal.zzb.create(Unknown Source)


Post a Comment for "Can't Use Firebase Ads: No Static Method Zzc(Landroid/os/Bundle;"