Ilja
Ilja

Reputation: 46527

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'
}

Upvotes: 12

Views: 9000

Answers (3)

Dmitriy G
Dmitriy G

Reputation: 359

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.

Upvotes: 23

Chris
Chris

Reputation: 227

This is addressed in the latest react-native-firebase v4 release candidate, available here: https://github.com/invertase/react-native-firebase/releases/tag/v4.0.0-rc.3

The fix was ultimately to update the react-native-firebase build.gradle to use compileOnly instead of compile statements.

Upvotes: 4

Peter Haddad
Peter Haddad

Reputation: 80934

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

Upvotes: 2

Related Questions