Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to find byte code for com/google/firebase

I made following upgrades today

  1. Android Studio 3.0 -> 3.1
  2. In build.gradle

    dependencies { classpath 'com.android.tools.build:gradle:3.0.1' -> 3.1.0 }

  3. In gradle/wrapper/gradle-wrapper.properties

    distributionUrl=https://services.gradle.org/distributions/gradle-4.5-all.zip -> gradle-4.6-all.zip

And I am now getting following error with my firebase modules (random module at a time when I build)

Failed to find byte code for com/google/firebase/storage/StreamDownloadTask$StreamProcessor

or sometimes

Failed to find byte code for com/google/firebase/database/ChildEventListener

My project implements

dependencies {
    compile 'com.google.android.gms:play-services-base:11.8.0'
    compile 'com.google.firebase:firebase-core:11.8.0'
    compile 'com.google.firebase:firebase-auth:11.8.0'
    compile 'com.google.firebase:firebase-firestore:11.8.0'
    compile 'com.google.firebase:firebase-invites:11.8.0'
    compile "com.google.firebase:firebase-messaging:11.8.0"
    compile 'com.google.android.gms:play-services-auth:11.8.0'
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:26.1.0'
}
like image 437
Ilja Avatar asked Mar 27 '18 16:03

Ilja


Video Answer


2 Answers

I have the same error

Failed to find byte code for com/google/firebase/database/Transaction$Handler

(although i don't use firebase/database).

Have found that disabling instant run in AndroidStudio settings resolve this issue.

like image 187
Dmitriy Grachev Avatar answered Sep 30 '22 14:09

Dmitriy Grachev


In the dependencies add:

compile 'com.google.firebase:firebase-database:11.8.0'
compile 'com.google.firebase:firebase-storage:11.8.0'

to be able to use ChildEventListener and StreamDownloadTask$StreamProcessor

Also you may have to write the other firebase dependencies

like image 23
Peter Haddad Avatar answered Sep 30 '22 14:09

Peter Haddad