问题
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.dap E/AndroidRuntime: FATAL EXCEPTION: main Process: com.dap, PID: 540 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 /data/app/com.dap-AZ0LDvxgjJKn7K-a-EQ0QQ==/split_lib_dependencies_apk.apk) at com.google.firebase.analytics.connector.AnalyticsConnectorImpl.getInstance(Unknown Source:20) at com.google.firebase.analytics.connector.internal.zzb.create(Unknown Source:6) at com.google.firebase.components.Lazy.lambda$new$0(com.google.firebase:firebase-common@@16.0.4:43) at com.google.firebase.components.Lazy$$Lambda$1.get(Unknown Source:4) at com.google.firebase.components.Lazy.get(com.google.firebase:firebase-common@@16.0.4:54) at com.google.firebase.components.AbstractComponentContainer.get(com.google.firebase:firebase-common@@16.0.4:26) at com.google.firebase.components.ComponentRuntime.get(com.google.firebase:firebase-common@@16.0.4:34) at com.google.firebase.components.ComponentRuntime.initializeEagerComponents(com.google.firebase:firebase-common@@16.0.4:82) at com.google.firebase.FirebaseApp.initializeAllApis(com.google.firebase:firebase-common@@16.0.4:761) at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@16.0.4:359) at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@16.0.4:324) at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@16.0.4:310) at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common@@16.0.4:53) at android.content.ContentProvider.attachInfo(ContentProvider.java:1919) at android.content.ContentProvider.attachInfo(ContentProvider.java:1894) at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common@@16.0.4:47) at android.app.ActivityThread.installProvider(ActivityThread.java:7107) at android.app.ActivityThread.installContentProviders(ActivityThread.java:6594) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6498) at android.app.ActivityThread.-wrap2(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1963) at android.os.Handler.dispatchMessage(Handler.java:108) at android.os.Looper.loop(Looper.java:166) at android.app.ActivityThread.main(ActivityThread.java:7425) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
All my Firebase / Google libraries are up to date firebase latest version:
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
// Facebook libraries
implementation 'com.facebook.android:facebook-android-sdk:4.32.0'
// Firebase/Google libraries
implementation('com.crashlytics.sdk.android:crashlytics:2.9.6@aar') {
transitive = true;
}
implementation 'com.firebase:geofire-android:2.1.0'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-storage:16.0.4'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-database:16.0.4'
implementation 'com.firebaseui:firebase-ui-storage:2.0.1'
implementation 'com.google.firebase:firebase-dynamic-links:16.1.3'
implementation 'com.google.firebase:firebase-analytics:16.0.5'
implementation 'com.google.firebase:firebase-config:16.1.0'
implementation 'com.google.firebase:firebase-invites:16.0.5'
implementation 'com.google.firebase:firebase-functions:16.1.2'
implementation 'com.google.firebase:firebase-ads:17.1.1'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.android.billingclient:billing:1.1'
// Support libraries (don't use the global support library)
implementation 'com.android.support.constraint:constraint-layout:2.0.0-alpha2'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:percent:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:support-fragment:27.1.1'
implementation 'com.android.support:support-vector-drawable:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:animated-vector-drawable:27.1.1'
// Other libraries
implementation 'com.baoyz.swipemenulistview:library:1.3.0'
implementation 'me.himanshusoni.chatmessageview:chat-message-view:1.0.3'
implementation 'com.github.bumptech.glide:glide:3.8.0'
implementation 'com.github.warkiz.widget:indicatorseekbar:1.1.2'
implementation 'com.github.guilhe:seekbar-ranged-view:1.0.1'
implementation 'com.crystal:crystalrangeseekbar:1.1.3'
testImplementation 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
As long as my build.gradle:
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.google.gms:google-services:4.2.0'
dependencies {
//classpath 'io.fabric.tools:gradle:1.25.0'
classpath 'io.fabric.tools:gradle:1.25.1'
}
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
I've tried to downgrade some libraries like this post advice too. No success.
I've tried to downgrade gms:play-services-location, but no success.
Instead of adding the ads library from Firebase i've tried the one from Google but i get this error:
"Error: Program type already present: com.google.android.gms.internal.measurement.zzdz"
I've also tried to Clean and Rebuilt project, uninstall app on my phone, Invalidate Cache and Restart. But i keep getting the same error.
I'll keep digging but for now i can't find a way to make these Firebase libs to work together.
Finally if it can help anyone, here my gradlew app:dependencies:
+--- com.facebook.android:facebook-android-sdk:4.32.0
| +--- com.facebook.android:facebook-core:4.32.0
| | +--- com.parse.bolts:bolts-android:1.4.0
| | | +--- com.parse.bolts:bolts-tasks:1.4.0
| | | \--- com.parse.bolts:bolts-applinks:1.4.0
| | | \--- com.parse.bolts:bolts-tasks:1.4.0
| | +--- com.android.support:support-annotations:27.0.2 -> 27.1.1
| | \--- com.android.support:support-core-utils:27.0.2 -> 27.1.1
| | +--- com.android.support:support-annotations:27.1.1
| | \--- com.android.support:support-compat:27.1.1
| | +--- com.android.support:support-annotations:27.1.1
| | \--- android.arch.lifecycle:runtime:1.1.0
| | +--- android.arch.lifecycle:common:1.1.0
| | \--- android.arch.core:common:1.1.0
| +--- com.facebook.android:facebook-common:4.32.0
| | +--- com.facebook.android:facebook-core:4.32.0 (*)
| | +--- com.android.support:support-v4:27.0.2 -> 27.1.1
| | | +--- com.android.support:support-compat:27.1.1 (*)
| | | +--- com.android.support:support-media-compat:27.1.1
| | | | +--- com.android.support:support-annotations:27.1.1
| | | | \--- com.android.support:support-compat:27.1.1 (*)
| | | +--- com.android.support:support-core-utils:27.1.1 (*)
| | | +--- com.android.support:support-core-ui:27.1.1
| | | | +--- com.android.support:support-annotations:27.1.1
| | | | +--- com.android.support:support-compat:27.1.1 (*)
| | | | \--- com.android.support:support-core-utils:27.1.1 (*)
| | | \--- com.android.support:support-fragment:27.1.1
| | | +--- com.android.support:support-compat:27.1.1 (*)
| | | +--- com.android.support:support-core-ui:27.1.1 (*)
| | | +--- com.android.support:support-core-utils:27.1.1 (*)
| | | +--- com.android.support:support-annotations:27.1.1
| | | +--- android.arch.lifecycle:livedata-core:1.1.0
| | | | +--- android.arch.lifecycle:common:1.1.0
| | | | +--- android.arch.core:common:1.1.0
| | | | \--- android.arch.core:runtime:1.1.0
| | | | \--- android.arch.core:common:1.1.0
| | | \--- android.arch.lifecycle:viewmodel:1.1.0
| | +--- com.android.support:appcompat-v7:27.0.2 -> 27.1.1
| | | +--- com.android.support:support-annotations:27.1.1
| | | +--- com.android.support:support-core-utils:27.1.1 (*)
| | | +--- com.android.support:support-fragment:27.1.1 (*)
| | | +--- com.android.support:support-vector-drawable:27.1.1
| | | | +--- com.android.support:support-annotations:27.1.1
| | | | \--- com.android.support:support-compat:27.1.1 (*)
| | | \--- com.android.support:animated-vector-drawable:27.1.1
| | | +--- com.android.support:support-vector-drawable:27.1.1 (*)
| | | \--- com.android.support:support-core-ui:27.1.1 (*)
| | +--- com.android.support:cardview-v7:27.0.2
| | | \--- com.android.support:support-annotations:27.0.2 -> 27.1.1
| | +--- com.android.support:customtabs:27.0.2
| | | +--- com.android.support:support-compat:27.0.2 -> 27.1.1 (*)
| | | \--- com.android.support:support-annotations:27.0.2 -> 27.1.1
| | \--- com.google.zxing:core:3.3.0
| +--- com.facebook.android:facebook-login:4.32.0
| | +--- com.facebook.android:facebook-core:4.32.0 (*)
| | +--- com.facebook.android:facebook-common:4.32.0 (*)
| | \--- com.android.support:appcompat-v7:27.0.2 -> 27.1.1 (*)
| +--- com.facebook.android:facebook-share:4.32.0
| | +--- com.facebook.android:facebook-core:4.32.0 (*)
| | \--- com.facebook.android:facebook-common:4.32.0 (*)
| +--- com.facebook.android:facebook-places:4.32.0
| | \--- com.facebook.android:facebook-core:4.32.0 (*)
| +--- com.facebook.android:facebook-applinks:4.32.0
| | +--- com.facebook.android:facebook-core:4.32.0 (*)
| | \--- com.parse.bolts:bolts-android:1.4.0 (*)
| \--- com.facebook.android:facebook-messenger:4.32.0
| +--- com.facebook.android:facebook-core:4.32.0 (*)
| \--- com.parse.bolts:bolts-android:1.4.0 (*)
+--- com.crashlytics.sdk.android:crashlytics:2.9.6
| +--- com.crashlytics.sdk.android:answers:1.4.4
| | \--- io.fabric.sdk.android:fabric:1.4.5
| +--- com.crashlytics.sdk.android:beta:1.2.10
| +--- io.fabric.sdk.android:fabric:1.4.5
| \--- com.crashlytics.sdk.android:crashlytics-core:2.6.5
| +--- com.crashlytics.sdk.android:answers:1.4.4 (*)
| \--- io.fabric.sdk.android:fabric:1.4.5
+--- com.firebase:geofire-android:2.1.0
+--- com.google.firebase:firebase-core:16.0.4
| +--- com.google.firebase:firebase-analytics:16.0.4 -> 16.0.5
| | +--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0
| | | \--- com.android.support:support-v4:26.1.0 -> 27.1.1 (*)
| | +--- com.google.android.gms:play-services-measurement-api:[16.0.3] -> 16.0.3
| | | +--- com.google.android.gms:play-services-ads-identifier:16.0.0
| | | | \--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
| | | +--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
| | | +--- com.google.android.gms:play-services-measurement-base:[16.0.4] -> 16.0.4
| | | | \--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
| | | +--- com.google.android.gms:play-services-stats:16.0.1
| | | | \--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
| | | +--- com.google.android.gms:play-services-tasks:16.0.1
| | | | \--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
| | | +--- com.google.firebase:firebase-analytics-impl:[16.2.3] -> 16.2.3
| | | | +--- com.google.android.gms:play-services-ads-identifier:16.0.0 (*)
| | | | +--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
| | | | +--- com.google.android.gms:play-services-measurement-base:[16.0.4] -> 16.0.4 (*)
| | | | +--- com.google.android.gms:play-services-stats:16.0.1 (*)
| | | | +--- com.google.android.gms:play-services-tasks:16.0.1 (*)
| | | | +--- com.google.firebase:firebase-common:16.0.3 -> 16.0.4
| | | | | +--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
| | | | | \--- com.google.android.gms:play-services-tasks:16.0.1 (*)
| | | | \--- com.google.firebase:firebase-iid:17.0.3 -> 17.0.4
| | | | +--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
| | | | +--- com.google.android.gms:play-services-stats:16.0.1 (*)
| | | | +--- com.google.android.gms:play-services-tasks:16.0.1 (*)
| | | | +--- com.google.firebase:firebase-common:16.0.3 -> 16.0.4 (*)
| | | | \--- com.google.firebase:firebase-iid-interop:16.0.1
| | | | +--- com.google.android.gms:play-services-base:16.0.1
| | | | | +--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
| | | | | \--- com.google.android.gms:play-services-tasks:16.0.1 (*)
| | | | \--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
| | | +--- com.google.firebase:firebase-common:16.0.3 -> 16.0.4 (*)
| | | \--- com.google.firebase:firebase-iid:17.0.3 -> 17.0.4 (*)
| | +--- com.google.android.gms:play-services-measurement-base:[16.0.4] -> 16.0.4 (*)
| | +--- com.google.android.gms:play-services-stats:16.0.1 (*)
| | +--- com.google.firebase:firebase-analytics-impl:[16.2.3] -> 16.2.3 (*)
| | \--- com.google.firebase:firebase-common:16.0.3 -> 16.0.4 (*)
| \--- com.google.firebase:firebase-measurement-connector-impl:17.0.2
| +--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
| +--- com.google.android.gms:play-services-measurement-api:16.0.2 -> 16.0.3 (*)
| +--- com.google.android.gms:play-services-measurement-base:16.0.3 -> 16.0.4 (*)
| +--- com.google.firebase:firebase-analytics:16.0.4 -> 16.0.5 (*)
| +--- com.google.firebase:firebase-analytics-impl:16.2.2 -> 16.2.3 (*)
| +--- com.google.firebase:firebase-common:16.0.3 -> 16.0.4 (*)
| \--- com.google.firebase:firebase-measurement-connector:17.0.1
| \--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
+--- com.google.firebase:firebase-messaging:17.3.4
| +--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
| +--- com.google.android.gms:play-services-tasks:16.0.1 (*)
| +--- com.google.firebase:firebase-common:16.0.3 -> 16.0.4 (*)
| +--- com.google.firebase:firebase-iid:[17.0.4] -> 17.0.4 (*)
| \--- com.google.firebase:firebase-measurement-connector:17.0.1 (*)
+--- com.google.firebase:firebase-storage:16.0.4
| +--- com.google.android.gms:play-services-base:16.0.1 (*)
| +--- com.google.android.gms:play-services-tasks:16.0.1 (*)
| \--- com.google.firebase:firebase-common:16.0.3 -> 16.0.4 (*)
+--- com.google.firebase:firebase-auth:16.0.5
| +--- com.google.android.gms:play-services-base:16.0.1 (*)
| +--- com.google.android.gms:play-services-basement:16.1.0 (*)
| +--- com.google.android.gms:play-services-flags:16.0.1
| | +--- com.google.android.gms:play-services-base:16.0.1 (*)
| | \--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
| +--- com.google.android.gms:play-services-tasks:16.0.1 (*)
| +--- com.google.firebase:firebase-auth-interop:16.0.1
| | +--- com.google.android.gms:play-services-base:16.0.1 (*)
| | +--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
| | +--- com.google.android.gms:play-services-tasks:16.0.1 (*)
| | \--- com.google.firebase:firebase-common:16.0.3 -> 16.0.4 (*)
| \--- com.google.firebase:firebase-common:16.0.3 -> 16.0.4 (*)
+--- com.google.firebase:firebase-database:16.0.4
| +--- com.google.android.gms:play-services-base:16.0.1 (*)
| +--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
| +--- com.google.android.gms:play-services-tasks:16.0.1 (*)
| +--- com.google.firebase:firebase-common:16.0.3 -> 16.0.4 (*)
| \--- com.google.firebase:firebase-database-collection:16.0.0
| \--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
+--- com.firebaseui:firebase-ui-storage:2.0.1
| +--- com.android.support:appcompat-v7:25.3.1 -> 27.1.1 (*)
| +--- com.android.support:palette-v7:25.3.1
| | +--- com.android.support:support-compat:25.3.1 -> 27.1.1 (*)
| | \--- com.android.support:support-core-utils:25.3.1 -> 27.1.1 (*)
| +--- com.github.bumptech.glide:glide:3.7.0 -> 3.8.0
| \--- com.google.firebase:firebase-storage:11.0.1 -> 16.0.4 (*)
+--- com.google.firebase:firebase-dynamic-links:16.1.3
| +--- com.google.android.gms:play-services-base:16.0.1 (*)
| +--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
| +--- com.google.android.gms:play-services-measurement-base:[16.0.4] -> 16.0.4 (*)
| +--- com.google.android.gms:play-services-tasks:16.0.1 (*)
| +--- com.google.firebase:firebase-analytics-impl:[16.2.3] -> 16.2.3 (*)
| \--- com.google.firebase:firebase-common:16.0.3 -> 16.0.4 (*)
+--- com.google.firebase:firebase-analytics:16.0.5 (*)
+--- com.google.firebase:firebase-config:16.1.0
| +--- com.google.android.gms:play-services-base:16.0.1 (*)
| +--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
| +--- com.google.android.gms:play-services-phenotype:16.0.0
| | +--- com.google.android.gms:play-services-base:16.0.1 (*)
| | +--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
| | \--- com.google.android.gms:play-services-tasks:16.0.1 (*)
| +--- com.google.android.gms:play-services-tasks:16.0.1 (*)
| +--- com.google.firebase:firebase-abt:16.0.1
| | +--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
| | +--- com.google.firebase:firebase-analytics-impl:16.2.2 -> 16.2.3 (*)
| | \--- com.google.firebase:firebase-common:16.0.3 -> 16.0.4 (*)
| +--- com.google.firebase:firebase-analytics:16.0.4 -> 16.0.5 (*)
| +--- com.google.firebase:firebase-analytics-impl:16.2.2 -> 16.2.3 (*)
| +--- com.google.firebase:firebase-common:16.0.3 -> 16.0.4 (*)
| \--- com.google.firebase:firebase-iid:17.0.3 -> 17.0.4 (*)
+--- com.google.firebase:firebase-invites:16.0.5
| +--- com.google.android.gms:play-services-appinvite:16.0.5
| | +--- com.google.android.gms:play-services-base:16.0.1 (*)
| | +--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
| | +--- com.google.android.gms:play-services-measurement-base:[16.0.4] -> 16.0.4 (*)
| | +--- com.google.android.gms:play-services-tasks:16.0.1 (*)
| | \--- com.google.firebase:firebase-dynamic-links:[16.1.3] -> 16.1.3 (*)
| \--- com.google.firebase:firebase-analytics:16.0.5 (*)
+--- com.google.firebase:firebase-functions:16.1.2
| +--- com.google.android.gms:play-services-base:16.0.1 (*)
| +--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
| +--- com.google.android.gms:play-services-tasks:16.0.1 (*)
| +--- com.google.firebase:firebase-auth-interop:16.0.1 (*)
| +--- com.google.firebase:firebase-common:16.0.4 (*)
| +--- com.google.firebase:firebase-iid:17.0.3 -> 17.0.4 (*)
| +--- com.google.firebase:firebase-iid-interop:16.0.1 (*)
| \--- com.squareup.okhttp:okhttp:2.7.2
| \--- com.squareup.okio:okio:1.6.0
+--- com.google.firebase:firebase-ads:17.1.1
| +--- com.google.android.gms:play-services-ads:17.1.1
| | +--- com.android.support:customtabs:26.1.0 -> 27.0.2 (*)
| | +--- com.google.android.gms:play-services-ads-base:[17.1.1] -> 17.1.1
| | +--- com.google.android.gms:play-services-ads-identifier:16.0.0 (*)
| | +--- com.google.android.gms:play-services-ads-lite:[17.1.1] -> 17.1.1
| | | +--- com.google.android.gms:play-services-ads-base:[17.1.1] -> 17.1.1
| | | +--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
| | | \--- com.google.android.gms:play-services-measurement-sdk-api:16.0.3
| | | +--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
| | | \--- com.google.android.gms:play-services-measurement-base:[16.0.4] -> 16.0.4 (*)
| | +--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
| | \--- com.google.android.gms:play-services-gass:[17.1.1] -> 17.1.1
| | +--- com.google.android.gms:play-services-ads-base:[17.1.1] -> 17.1.1
| | \--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
| \--- com.google.firebase:firebase-analytics:16.0.5 (*)
+--- com.google.android.gms:play-services-location:16.0.0
| +--- com.google.android.gms:play-services-base:16.0.1 (*)
| +--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
| +--- com.google.android.gms:play-services-places-placereport:16.0.0
| | \--- com.google.android.gms:play-services-basement:16.0.1 -> 16.1.0 (*)
| \--- com.google.android.gms:play-services-tasks:16.0.1 (*)
+--- com.android.billingclient:billing:1.1
| \--- com.android.support:support-annotations:25.0.0 -> 27.1.1
+--- com.android.support.constraint:constraint-layout:2.0.0-alpha2
| +--- com.android.support:appcompat-v7:27.1.1 (*)
| +--- com.android.support:recyclerview-v7:27.1.1
| | +--- com.android.support:support-annotations:27.1.1
| | +--- com.android.support:support-compat:27.1.1 (*)
| | \--- com.android.support:support-core-ui:27.1.1 (*)
| \--- com.android.support.constraint:constraint-layout-solver:2.0.0-alpha2
+--- com.android.support:multidex:1.0.3
+--- com.android.support:percent:27.1.1
| \--- com.android.support:support-compat:27.1.1 (*)
+--- com.android.support:recyclerview-v7:27.1.1 (*)
+--- com.android.support:support-fragment:27.1.1 (*)
+--- com.android.support:support-vector-drawable:27.1.1 (*)
+--- com.android.support:appcompat-v7:27.1.1 (*)
+--- com.android.support:design:27.1.1
| +--- com.android.support:support-v4:27.1.1 (*)
| +--- com.android.support:appcompat-v7:27.1.1 (*)
| +--- com.android.support:recyclerview-v7:27.1.1 (*)
| \--- com.android.support:transition:27.1.1
| +--- com.android.support:support-annotations:27.1.1
| \--- com.android.support:support-compat:27.1.1 (*)
+--- com.android.support:animated-vector-drawable:27.1.1 (*)
+--- com.baoyz.swipemenulistview:library:1.3.0
| \--- com.android.support:support-v4:22.1.1 -> 27.1.1 (*)
+--- me.himanshusoni.chatmessageview:chat-message-view:1.0.3
+--- com.github.bumptech.glide:glide:3.8.0
+--- com.github.warkiz.widget:indicatorseekbar:1.1.2
+--- com.github.guilhe:seekbar-ranged-view:1.0.1
| \--- com.android.support:appcompat-v7:26.0.1 -> 27.1.1 (*)
+--- com.crystal:crystalrangeseekbar:1.1.3
| \--- com.android.support:appcompat-v7:23.4.0 -> 27.1.1 (*)
\--- com.android.support:multidex:1.0.2 -> 1.0.3
(*) - dependencies omitted (listed previously)
(n) - Not resolved (configuration is not meant to be resolved)
Sorry for all the codes blocks, but i thought it would be more easier to understand.
Thank you for your time.
回答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.
回答2:
please replace com.google.firebase:firebase-ads:17.1.1
with com.google.firebase:firebase-ads:17.1.0
回答3:
Change implementation 'com.google.firebase:firebase-core:16.0.4' to implementation 'com.google.firebase:firebase-core:+'
回答4:
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)
回答5:
Follow this answer i hope this will solve your problem let me know if its work.
回答6:
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'
来源:https://stackoverflow.com/questions/53335748/cant-use-firebase-ads-no-static-method-zzclandroid-os-bundle