I screwed a firebase chat into my application (I took https://habrahabr.ru/company/google/blog/305308/ from here). So, the point is that with the MainActivity, I switch to the ChatActivity by means of a button, back by the hardware button back. I turn for the first time - everything is ok, the second - ok. The third one is crash, the log is lower, I have already broken my whole head and I cannot understand why this is, please help!
E/AndroidRuntime: FATAL EXCEPTION: GoogleApiHandler Process: ИМЯПАКЕТА, PID: 5113 java.lang.IllegalAccessError: tried to access method android.support.v4.content.ContextCompat.<init>:(Ljava/lang/String;)V from class com.google.firebase.iid.zzg at com.google.firebase.iid.zzg.zzeC(Unknown Source) at com.google.firebase.iid.zzg.<init>(Unknown Source) at com.google.firebase.iid.zzg.<init>(Unknown Source) at com.google.firebase.iid.zzd.zzb(Unknown Source) at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source) at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source) at com.google.firebase.iid.zzc.zzUl(Unknown Source) at com.google.android.gms.config.internal.zza$1.zza(Unknown Source) at com.google.android.gms.config.internal.zza$zzb.zza(Unknown Source) at com.google.android.gms.config.internal.zza$zzb.zza(Unknown Source) at com.google.android.gms.internal.zznt$zza.zzb(Unknown Source) at com.google.android.gms.internal.zznp$zza.zzb(Unknown Source) at com.google.android.gms.internal.zzoj$zzc.zzc(Unknown Source) at com.google.android.gms.internal.zzoj$zzc.zzsu(Unknown Source) at com.google.android.gms.internal.zzoj$zzc.onConnected(Unknown Source) at com.google.android.gms.common.internal.zzk$1.onConnected(Unknown Source) at com.google.android.gms.common.internal.zzd$zzj.zztp(Unknown Source) at com.google.android.gms.common.internal.zzd$zza.zzc(Unknown Source) at com.google.android.gms.common.internal.zzd$zza.zzw(Unknown Source) at com.google.android.gms.common.internal.zzd$zze.zztr(Unknown Source) at com.google.android.gms.common.internal.zzd$zzd.handleMessage(Unknown Source) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loop(Looper.java:193) at android.os.HandlerThread.run(HandlerThread.java:61) added dependencies to build
dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile 'de.hdodenhof:circleimageview:1.3.0' compile 'com.mcxiaoke.volley:library:1.0.15' compile 'com.mikepenz.materialdrawer:library:2.9.2@aar' compile 'com.mikepenz.iconics:library:0.9.1@aar' compile 'com.afollestad:assent:0.2.5' compile 'com.github.javiersantos:PiracyChecker:0.0.2' compile 'com.github.bumptech.glide:glide:3.6.1' compile 'com.android.support:support-v4:25.1.0' compile 'com.android.support:support-v13:25.1.0' compile 'com.android.support:design:25.1.0' compile 'com.android.support:appcompat-v7:25.1.0' compile 'com.android.support:recyclerview-v7:25.1.0' compile 'com.melnykov:floatingactionbutton:1.3.0' compile 'com.android.support:cardview-v7:25.1.0' compile 'com.google.firebase:firebase-database:9.0.0' compile 'com.firebaseui:firebase-ui-database:0.4.0' compile 'de.hdodenhof:circleimageview:1.3.0' compile 'com.github.bumptech.glide:glide:3.6.1' compile 'com.google.firebase:firebase-auth:9.0.0' compile 'com.google.android.gms:play-services-auth:9.0.0' compile 'com.google.firebase:firebase-messaging:9.0.0' compile 'com.google.firebase:firebase-config:9.0.0' compile 'com.google.android.gms:play-services-appindexing:9.0.0' apply plugin: 'com.google.gms.google-services' }
in build.gradle project level:
dependencies { classpath 'com.android.tools.build:gradle:2.2.3' classpath 'com.google.gms:google-services:3.0.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }