java.lang.NoSuchMethodError: No direct method at com.google.android.gms.iid.InstanceID.zza

java.lang.NoSuchMethodError: No direct method at com.google.android.gms.iid.InstanceID.zza

错误

java.lang.NoSuchMethodError: No direct method (Landroid/content/Context;)V in class Lcom/google/android/gms/iid/zzd; or its super classes (declaration of 'com.google.android.gms.iid.zzd' appears in /data/app/com.app-1/base.apk:classes33.dex) at com.google.android.gms.iid.InstanceID.zza(Unknown Source) at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source) at com.quickblox.messages.services.a.c.(Unknown Source)

Gradle

qbSdkVersion = '3.3.1'

versionName = '3.3.0'

testRunnerVersion = "0.4.1"


// Dependency versions
playServicesVersion = '10.2.1'
supportV4Version = '23.1.1'
appcompatV7Version = '23.1.1'
recyclerviewV7Version = '23.2.1'
supportAnnotationsVersion = '23.1.1'
designVersion = '23.1.1'

uilVersion = '1.9.0'
glideVersion = '3.6.1'
pullToRefreshVersion = '3.2.3'
stickyListHeaders = '2.7.0'
robotoTextViewVersion = '2.4.3'
stickersVersion = '0.7.3'
crashlyticsVersion = '2.2.2'

我在项目中使用时遇到了类似的问题android-support libs or play-services libs with different versions, check it in your project (you can see in Android Studio in部分 'External Libraries')。在 QuickBlox Android SDK (v3.3.1) 中使用了播放服务版本 10.2.1 和支持库版本 23.1.1。如果您在项目中使用 firebase,它的版本必须与 play-services 版本相同。另外检查项目中其他模块中此库的版本。还要检查,您的依赖项中的其他库是否使用了支持库或播放服务库与您的项目的不同版本。