Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/auth/internal/InternalAuthProvider; #2122

Closed
1 task done
snamstorm opened this issue May 8, 2019 · 38 comments
Labels
impact: build-error Behaviour causing build failure impact: crash Behaviour causing app to crash. platform: android plugin: authentication Firebase Authentication plugin: storage Firebase Cloud Storage

Comments

@snamstorm
Copy link

Recently added a few google packages such as Crashlytics and updated google-services for Google-Signin on firebase. Since then, Android build is successful through both Android Studio build and react-native run-android. Before these changes app launched without any issue,

App is uploaded to emulator successfully however, app won't launch

The only error log I get is from logcat which seems to be related to firebase auth

2019-05-08 13:47:11.641 15444-15444/com.xxxxxx E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.xxxxxxx, PID: 15444
    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/auth/internal/InternalAuthProvider;
        at java.lang.Class.classForName(Native Method)
        at java.lang.Class.forName(Class.java:453)
        at java.lang.Class.forName(Class.java:378)
        at com.google.firebase.components.ComponentDiscovery.instantiate(com.google.firebase:firebase-common@@17.0.0:78)
        at com.google.firebase.components.ComponentDiscovery.discover(com.google.firebase:firebase-common@@17.0.0:71)
        at com.google.firebase.FirebaseApp.<init>(com.google.firebase:firebase-common@@17.0.0:468)
        at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@17.0.0:354)
        at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@17.0.0:321)
        at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@17.0.0:305)
        at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common@@17.0.0:53)
        at android.content.ContentProvider.attachInfo(ContentProvider.java:1917)
        at android.content.ContentProvider.attachInfo(ContentProvider.java:1892)
        at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common@@17.0.0:47)
        at android.app.ActivityThread.installProvider(ActivityThread.java:6391)
        at android.app.ActivityThread.installContentProviders(ActivityThread.java:5938)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5853)
        at android.app.ActivityThread.access$1100(ActivityThread.java:199)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6669)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
     Caused by: java.lang.ClassNotFoundException: com.google.firebase.auth.internal.InternalAuthProvider
        at java.lang.VMClassLoader.findLoadedClass(Native Method)
        at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:738)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:363)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at java.lang.Class.classForName(Native Method) 
        at java.lang.Class.forName(Class.java:453) 
        at java.lang.Class.forName(Class.java:378) 
        at com.google.firebase.components.ComponentDiscovery.instantiate(com.google.firebase:firebase-common@@17.0.0:78) 
        at com.google.firebase.components.ComponentDiscovery.discover(com.google.firebase:firebase-common@@17.0.0:71) 
        at com.google.firebase.FirebaseApp.<init>(com.google.firebase:firebase-common@@17.0.0:468) 
        at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@17.0.0:354) 
        at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@17.0.0:321) 
        at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@17.0.0:305) 
        at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common@@17.0.0:53) 
        at android.content.ContentProvider.attachInfo(ContentProvider.java:1917) 
        at android.content.ContentProvider.attachInfo(ContentProvider.java:1892) 
        at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common@@17.0.0:47) 
        at android.app.ActivityThread.installProvider(ActivityThread.java:6391) 
        at android.app.ActivityThread.installContentProviders(ActivityThread.java:5938) 
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5853) 
        at android.app.ActivityThread.access$1100(ActivityThread.java:199) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:193) 
        at android.app.ActivityThread.main(ActivityThread.java:6669) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 
     Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/internal/InternalTokenProvider;
        at java.lang.Class.classForName(Native Method) 
        at java.lang.Class.forName(Class.java:453) 
        at java.lang.Class.forName(Class.java:378) 
        at com.google.firebase.components.ComponentDiscovery.instantiate(com.google.firebase:firebase-common@@17.0.0:78) 
        at com.google.firebase.components.ComponentDiscovery.discover(com.google.firebase:firebase-common@@17.0.0:71) 
        at com.google.firebase.FirebaseApp.<init>(com.google.firebase:firebase-common@@17.0.0:468) 
        at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@17.0.0:354) 
        at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@17.0.0:321) 
        at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@17.0.0:305) 
        at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common@@17.0.0:53) 
        at android.content.ContentProvider.attachInfo(ContentProvider.java:1917) 
        at android.content.ContentProvider.attachInfo(ContentProvider.java:1892) 
        at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common@@17.0.0:47) 
        at android.app.ActivityThread.installProvider(ActivityThread.java:6391) 
        at android.app.ActivityThread.installContentProviders(ActivityThread.java:5938) 
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5853) 
        at android.app.ActivityThread.access$1100(ActivityThread.java:199) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:193) 
        at android.app.ActivityThread.main(ActivityThread.java:6669) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.internal.InternalTokenProvider" on path: DexPathList[[zip file "/data/app/com.xxxxxxx-9_NR07rkrD3jKgN-0U3DBQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.xxxxxxx-9_NR07rkrD3jKgN-0U3DBQ==/lib/x86, /data/app/com.xxxxxxx-9_NR07rkrD3jNgN-0U3DBQ==/base.apk!/lib/x86, /system/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)

Project Files

Android

android/build.gradle:

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 28
        supportLibVersion = "28.0.0"
	googlePlayServicesAuthVersion = "16.0.1" // for social signin with firebase
    }
    repositories {
        google()
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.1' // 3.2.1 3.1.4
        classpath 'com.google.gms:google-services:4.2.0'
        classpath 'io.fabric.tools:gradle:1.+'
    }
}

allprojects {
    repositories {
        maven { url "https://jitpack.io" }
        mavenLocal()
        google()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        maven {
            url "https://maven.google.com"
        }
    }
}

task wrapper(type: Wrapper) {
    gradleVersion = '4.4'
    distributionUrl = distributionUrl.replace("bin", "all")
}

subprojects {
   project.configurations.all {
       resolutionStrategy.eachDependency { details ->
           if (details.requested.group == 'com.android.support'
                   && !details.requested.name.contains('multidex') ) {
               details.useVersion "26.1.0"
           }
       }
   }
}

android/app/build.gradle:

apply plugin: "com.android.application"

import com.android.build.OutputFile

project.ext.react = [
    entryFile: "index.js",

    bundleInDebug: false,
    bundleInRelease: true,

    bundleDevDebug: false,
    bundleUatDebug: true,
    bundleProdDebug: true,
    bundleDevRelease: false,
    bundleUatRelease: true,
    bundleProdRelease: true,

    devDisabledInDebug: false,
    devDisabledInRelease: true,

    devDisabledInDevDebug: false,
    devDisabledInUatDebug: false,
    devDisabledInProdDebug: false,
    devDisabledInDevRelease: true,
    devDisabledInUatRelease: true,
    devDisabledInProdRelease: true,

    jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
    jsBundleDirRelease: "$buildDir/intermediates/assets/release",

    resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
    resourcesDirRelease: "$buildDir/intermediates/res/merged/release",

    inputExcludes: ["android/**", "ios/**", "__tests__/**", "js_build/**"]
]

apply from: "../../node_modules/react-native/react.gradle"

def enableProguardInReleaseBuilds = false

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    flavorDimensions "default"  // <-- !!! add this line for multiple variants!!!

    defaultConfig {
        applicationId "xxxxxxx"
        resValue "string", "build_config_package", "xxxxxx"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        // versionCode 1 <- added to AndroidManifest.xml for CI
        // versionName "1.0" 1 <- added to AndroidManifest.xml for CI
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
        multiDexEnabled true

        vectorDrawables.useSupportLibrary = true // for react-native-image-crop-picker
    }

    signingConfigs {

    }

    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
        }
    }

    buildTypes {
        release {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
            signingConfig signingConfigs.release
            debuggable false
        }
    }

    productFlavors {
        dev {
            minSdkVersion rootProject.ext.minSdkVersion
            applicationId 'xxxxxxx'
            targetSdkVersion rootProject.ext.targetSdkVersion
            resValue "string", "build_config_package", "xxxxxx"
        }
        uat {
            minSdkVersion rootProject.ext.minSdkVersion
            applicationId 'xxxxxxx'
            targetSdkVersion rootProject.ext.targetSdkVersion
            resValue "string", "build_config_package", "xxxxxx"
        }
        prod {
            minSdkVersion rootProject.ext.minSdkVersion
            applicationId 'xxxxxx'
            targetSdkVersion rootProject.ext.targetSdkVersion
            resValue "string", "build_config_package", "xxxxx"
        }
    }

    // applicationVariants are e.g. debug, release
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
            def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }
        }
    }

    dexOptions {
        preDexLibraries false
        javaMaxHeapSize "8g" // this to speed up the builds
    }
}

dependencies {
    implementation project(':react-native-image-crop-picker')
    implementation project(':react-native-webview')
    implementation project(':react-native-svg')
    implementation project(':@react-native-community_netinfo')
    implementation project(':react-native-google-signin')
    implementation project(':react-native-fbsdk')
    implementation project(':@react-native-community_slider')
    implementation project(':react-native-android-open-settings')
    implementation project(':react-native-localize')
    implementation project(':react-native-fs')
    implementation project(':react-native-camera')
    implementation project(':react-native-video')
    implementation project(':react-native-youtube')
    implementation project(':react-native-firebase')
    implementation project(':react-native-uuid-generator')
    implementation project(':react-native-device-info')
    implementation project(':react-native-fast-image')
    implementation project(':react-native-contacts')
    implementation project(':react-native-screens')
    implementation project(':react-native-share-extension')
    implementation project(':react-native-gesture-handler')
    implementation project(':react-native-push-notification')
    implementation project(':react-native-vector-icons')
    implementation project(':react-native-splash-screen')
    implementation project(':react-native-linear-gradient')
    implementation project(':react-native-spinkit')
    implementation project(':react-native-image-picker')
    implementation project(':react-native-share')
    //implementation project(':react-native-geolocation-service')
    implementation(project(':react-native-geolocation-service')) {
        exclude group: 'com.google.android.gms', module: 'play-services-location'
    }
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    implementation 'com.facebook.react:react-native:+'
    // From node_modules
    implementation 'com.google.firebase:firebase-core:16.0.8'
    implementation 'com.google.firebase:firebase-messaging:17.3.4'
    implementation 'me.leolin:ShortcutBadger:1.1.21@aar'
    // <-- Add this line if you wish to use badge on Android
    implementation 'com.google.android.gms:play-services-base:16.0.1'
    implementation 'com.google.android.gms:play-services-location:16.0.0'
    implementation 'com.google.firebase:firebase-auth:16.2.1'
    implementation 'com.google.firebase:firebase-invites:16.0.6'
    implementation 'com.google.firebase:firebase-dynamic-links:16.0.6'
    implementation 'com.google.firebase:firebase-storage:16.0.5'
	implementation 'com.google.android.gms:play-services-auth:16.0.1'
    implementation('com.crashlytics.sdk.android:crashlytics:2.9.9@aar') {
        transitive = true;
    }

	implementation 'com.facebook.android:facebook-android-sdk:4.34.0'
    implementation project(':react-native-fbsdk')
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

apply plugin: 'com.google.gms.google-services'
apply plugin: 'io.fabric'

com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true // this disables some warning about firebase incompatible versions etc

android/settings.gradle:

rootProject.name = 'xxxxxxx'
include ':react-native-image-crop-picker'
project(':react-native-image-crop-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-crop-picker/android')
include ':react-native-webview'
project(':react-native-webview').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-webview/android')
include ':react-native-svg'
project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android')
include ':@react-native-community_netinfo'
project(':@react-native-community_netinfo').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/netinfo/android')
include ':react-native-google-signin'
project(':react-native-google-signin').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-google-signin/android')
include ':react-native-fbsdk'
project(':react-native-fbsdk').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fbsdk/android')
include ':@react-native-community_slider'
project(':@react-native-community_slider').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/slider/android')
include ':react-native-android-open-settings'
project(':react-native-android-open-settings').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-android-open-settings/android')
include ':react-native-localize'
project(':react-native-localize').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-localize/android')
include ':react-native-fs'
project(':react-native-fs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fs/android')
include ':react-native-camera'
project(':react-native-camera').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-camera/android')
include ':react-native-youtube'
project(':react-native-youtube').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-youtube/android')
include ':react-native-config'
project(':react-native-config').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-config/android')
include ':react-native-video'
project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android-exoplayer')
include ':react-native-video'
project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android-exoplayer')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-uuid-generator'
project(':react-native-uuid-generator').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-uuid-generator/android')
include ':react-native-splash-screen'
project(':react-native-splash-screen').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-splash-screen/android')
include ':react-native-share-extension'
project(':react-native-share-extension').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-share-extension/android')
include ':react-native-share'
project(':react-native-share').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-share/android')
include ':react-native-screens'
project(':react-native-screens').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-screens/android')
include ':react-native-push-notification'
project(':react-native-push-notification').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-push-notification/android')
include ':react-native-image-picker'
project(':react-native-image-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-picker/android')
include ':react-native-gesture-handler'
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
include ':react-native-firebase'
project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android')
include ':react-native-fast-image'
project(':react-native-fast-image').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fast-image/android')
include ':react-native-device-info'
project(':react-native-device-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-device-info/android')
include ':react-native-contacts'
project(':react-native-contacts').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-contacts/android')
include ':react-native-linear-gradient'
project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android')
include ':react-native-spinkit'
project(':react-native-spinkit').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-spinkit/android')
include ':react-native-video'
project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android-exoplayer')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-uuid-generator'
project(':react-native-uuid-generator').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-uuid-generator/android')
include ':react-native-splash-screen'
project(':react-native-splash-screen').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-splash-screen/android')
include ':react-native-share-extension'
project(':react-native-share-extension').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-share-extension/android')
include ':react-native-share'
project(':react-native-share').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-share/android')
include ':react-native-screens'
project(':react-native-screens').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-screens/android')
include ':react-native-push-notification'
project(':react-native-push-notification').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-push-notification/android')
include ':react-native-image-picker'
project(':react-native-image-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-picker/android')
include ':react-native-image-crop-picker'
project(':react-native-image-crop-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-crop-picker/android')
include ':react-native-gesture-handler'
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
include ':react-native-firebase'
project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android')
include ':react-native-fast-image'
project(':react-native-fast-image').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fast-image/android')
include ':react-native-device-info'
project(':react-native-device-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-device-info/android')
include ':react-native-contacts'
project(':react-native-contacts').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-contacts/android')
include ':react-native-linear-gradient'
project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android')
include ':react-native-spinkit'
project(':react-native-spinkit').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-spinkit/android')
include ':react-native-firebase'
project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android')
include ':react-native-video'
project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android-exoplayer')
include ':react-native-image-crop-picker'
project(':react-native-image-crop-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-crop-picker/android')
include ':react-native-uuid-generator'
project(':react-native-uuid-generator').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-uuid-generator/android')
include ':react-native-device-info'
project(':react-native-device-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-device-info/android')
include ':react-native-fast-image'
project(':react-native-fast-image').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fast-image/android')
include ':react-native-contacts'
project(':react-native-contacts').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-contacts/android')
include ':react-native-screens'
project(':react-native-screens').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-screens/android')
include ':react-native-share-extension'
project(':react-native-share-extension').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-share-extension/android')
include ':react-native-gesture-handler'
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
include ':react-native-push-notification'
project(':react-native-push-notification').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-push-notification/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-splash-screen'
project(':react-native-splash-screen').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-splash-screen/android')
include ':react-native-linear-gradient'
project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android')
include ':react-native-spinkit'
project(':react-native-spinkit').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-spinkit/android')
include ':react-native-image-picker'
project(':react-native-image-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-picker/android')
include ':react-native-share'
project(':react-native-share').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-share/android')
include ':react-native-geolocation-service'
project(':react-native-geolocation-service').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-geolocation-service/android')
include ':react-native-fbsdk'
project(':react-native-fbsdk').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fbsdk/android')

include ':app'

MainApplication.java:

package com.xxxxxx;

import android.app.Application;

import com.BV.LinearGradient.LinearGradientPackage;
import com.alinz.parkerdan.shareextension.SharePackage;
import com.dieam.reactnativepushnotification.ReactNativePushNotificationPackage;
import com.dylanvann.fastimage.FastImageViewPackage;
import com.facebook.CallbackManager;
import com.facebook.react.ReactApplication;
import com.reactnative.ivpusic.imagepicker.PickerPackage;
import com.reactnativecommunity.webview.RNCWebViewPackage;
import com.horcrux.svg.SvgPackage;
import com.reactnativecommunity.netinfo.NetInfoPackage;
///import com.goldenowl.twittersignin.TwitterSigninPackage;
import co.apptailor.googlesignin.RNGoogleSigninPackage;
import com.facebook.reactnative.androidsdk.FBSDKPackage;
import com.facebook.CallbackManager;
import com.reactnativecommunity.slider.ReactSliderPackage;
import com.levelasquez.androidopensettings.AndroidOpenSettingsPackage;
import com.reactcommunity.rnlocalize.RNLocalizePackage;
import com.rnfs.RNFSPackage;
import org.reactnative.camera.RNCameraPackage;
import com.inprogress.reactnativeyoutube.ReactNativeYouTube;
//import com.lugg.ReactNativeConfig.ReactNativeConfigPackage;
import com.brentvatne.react.ReactVideoPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import io.github.traviskn.rnuuidgenerator.RNUUIDGeneratorPackage;
import org.devio.rn.splashscreen.SplashScreenReactPackage;
import com.alinz.parkerdan.shareextension.SharePackage;
import cl.json.RNSharePackage;
import com.swmansion.rnscreens.RNScreensPackage;
import com.dieam.reactnativepushnotification.ReactNativePushNotificationPackage;
import com.imagepicker.ImagePickerPackage;
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
import io.invertase.firebase.RNFirebasePackage;
import com.dylanvann.fastimage.FastImageViewPackage;
import com.learnium.RNDeviceInfo.RNDeviceInfo;
import com.rt2zz.reactnativecontacts.ReactNativeContacts;
import com.BV.LinearGradient.LinearGradientPackage;
import com.react.rnspinkit.RNSpinkitPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import io.github.traviskn.rnuuidgenerator.RNUUIDGeneratorPackage;
import org.devio.rn.splashscreen.SplashScreenReactPackage;
import com.alinz.parkerdan.shareextension.SharePackage;
import cl.json.RNSharePackage;
import com.swmansion.rnscreens.RNScreensPackage;
import com.dieam.reactnativepushnotification.ReactNativePushNotificationPackage;
import com.imagepicker.ImagePickerPackage;
import com.reactnative.ivpusic.imagepicker.PickerPackage;
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
import io.invertase.firebase.RNFirebasePackage;
import com.dylanvann.fastimage.FastImageViewPackage;
import com.learnium.RNDeviceInfo.RNDeviceInfo;
import com.rt2zz.reactnativecontacts.ReactNativeContacts;
import com.BV.LinearGradient.LinearGradientPackage;
import com.react.rnspinkit.RNSpinkitPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import com.imagepicker.ImagePickerPackage;
import com.learnium.RNDeviceInfo.RNDeviceInfo;
import com.oblador.vectoricons.VectorIconsPackage;
import com.react.rnspinkit.RNSpinkitPackage;
import com.reactnative.ivpusic.imagepicker.PickerPackage;
import com.rt2zz.reactnativecontacts.ReactNativeContacts;
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
import com.swmansion.rnscreens.RNScreensPackage;
import org.devio.rn.splashscreen.SplashScreenReactPackage;
import java.util.Arrays;
import java.util.List;
import cl.json.RNSharePackage;
import io.github.traviskn.rnuuidgenerator.RNUUIDGeneratorPackage;
import io.invertase.firebase.RNFirebasePackage;
import io.invertase.firebase.auth.RNFirebaseAuthPackage;
import io.invertase.firebase.messaging.RNFirebaseMessagingPackage;
import io.invertase.firebase.notifications.RNFirebaseNotificationsPackage;
import io.invertase.firebase.links.RNFirebaseLinksPackage;
import com.agontuk.RNFusedLocation.RNFusedLocationPackage;
import io.invertase.firebase.storage.RNFirebaseStoragePackage;


public class MainApplication extends Application implements ReactApplication {
	private static CallbackManager mCallbackManager = CallbackManager.Factory.create();

	protected static CallbackManager getCallbackManager() {
	  return mCallbackManager;
	}

  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
    @Override
    public boolean getUseDeveloperSupport() {
      return BuildConfig.DEBUG;
    }

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
            new MainReactPackage(),
            new PickerPackage(),
            new RNCWebViewPackage(),
            new SvgPackage(),
            new NetInfoPackage(),
            ///new TwitterSigninPackage(),
            new RNGoogleSigninPackage(),
            new ReactSliderPackage(),
            new AndroidOpenSettingsPackage(),
            new RNLocalizePackage(),
            new RNFSPackage(),
            new RNCameraPackage(),
            new ReactNativeYouTube(),
            //new ReactNativeConfigPackage(),
            new ReactVideoPackage(),
            new VectorIconsPackage(),
            new RNUUIDGeneratorPackage(),
            new SplashScreenReactPackage(),
            new SharePackage(),
            new RNSharePackage(),
            new RNScreensPackage(),
            new ReactNativePushNotificationPackage(),
            new ImagePickerPackage(),
            new RNGestureHandlerPackage(),
            new RNFirebasePackage(),
            new FastImageViewPackage(),
            new RNDeviceInfo(),
            new ReactNativeContacts(),
            new LinearGradientPackage(),
            new RNSpinkitPackage(),
            new RNFirebaseMessagingPackage(), // <-- Add this line
            new RNFirebaseNotificationsPackage(), // <-- this is for notifs-only or notifs-with-data ( so not data-only )
            new RNFirebaseAuthPackage(), // for phone authentication
            new RNFusedLocationPackage(),
            new RNFirebaseLinksPackage(),
			new RNFirebaseStoragePackage(),
			new FBSDKPackage(mCallbackManager)
      );
    }

    @Override
    protected String getJSMainModuleName() {
      return "index";
    }
  };

  @Override
  public ReactNativeHost getReactNativeHost() {
    return mReactNativeHost;
  }

  @Override
  public void onCreate() {
    super.onCreate();
    SoLoader.init(this, /* native exopackage */ false);
  }
}

AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="xxxxxx"
    android:versionCode="1"
    android:versionName="1.0">

    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
    <uses-permission android:name="android.permission.READ_CONTACTS"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY"/>

    <!-- from react native notif permissions -->
    <!-- < Only if you're using GCM or localNotificationSchedule() > -->
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <permission
        android:name="${applicationId}.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />
    <uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />
    <!-- < Only if you're using GCM or localNotificationSchedule() > -->

    <!-- used by firebase and others for notifications -->
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.VIBRATE" />

    <uses-permission android:name="android.permission.CAMERA"/>
    <uses-permission android:name="android.permission.RECORD_AUDIO"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    
    <uses-feature android:name="android.hardware.camera" android:required="false" />
    <uses-feature android:name="android.hardware.camera.front" android:required="false" />

    <application
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:allowBackup="false"
      android:theme="@style/AppTheme"
      android:usesCleartextTraffic="true">

      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
        android:windowSoftInputMode="adjustResize"
        android:launchMode="singleTop"
        android:screenOrientation="portrait">

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

        <intent-filter>
            <action android:name="android.intent.action.VIEW"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <category android:name="android.intent.category.BROWSABLE"/>
            <data android:host="xxxxx.page.link" android:scheme="http"/>
            <data android:host="xxxxx.page.link" android:scheme="https"/>
        </intent-filter>

      </activity>

      
      <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />

      <!-- for react-native-share-extension -->
      <activity
            android:noHistory="true"
            android:name=".share.ShareActivity"
            android:configChanges="orientation"
            android:label="@string/title_activity_share"
            android:screenOrientation="portrait"
            android:theme="@style/Theme.Share.Transparent"
            android:launchMode="singleTask">
            <intent-filter>
                <action android:name="android.intent.action.SEND" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="text/plain" />
                <data android:mimeType="image/*" />
            </intent-filter>
      </activity>

    <!-- from crashlytics -->
    <meta-data android:name="io.fabric.ApiKey" android:value="xxxxxxx"/>

    <!-- from react native notif permissions -->
    <meta-data android:name="com.dieam.reactnativepushnotification.notification_channel_name" android:value="YOUR NOTIFICATION CHANNEL NAME"/>
    <meta-data android:name="com.dieam.reactnativepushnotification.notification_channel_description" android:value="YOUR NOTIFICATION CHANNEL DESCRIPTION"/>
    <!-- Change the resource name to your App's accent color - or any other color you want -->
    <meta-data android:name="com.dieam.reactnativepushnotification.notification_color" android:resource="@android:color/white"/>

    <!-- Set custom default icon. This is used when no icon is set for incoming notification messages.
        See README(https://goo.gl/l4GJaQ) for more. -->
    <meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/ic_stat_ic_notification" />
    <!-- Set color used with incoming notification messages. This is used when no color is set for the incoming
                notification message. See README(https://goo.gl/6BKBk7) for more. -->
    <meta-data android:name="com.google.firebase.messaging.default_notification_color" android:resource="@color/colorAccent" />
    <meta-data android:name="com.google.firebase.messaging.default_notification_channel_id" android:value="@string/default_notification_channel_id"/>

	<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
	
        <!-- firebase to schedule local notifs -->
        <receiver android:name="io.invertase.firebase.notifications.RNFirebaseNotificationReceiver"/>
        <receiver android:enabled="true" android:exported="true"  android:name="io.invertase.firebase.notifications.RNFirebaseNotificationsRebootReceiver">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED"/>
                <action android:name="android.intent.action.QUICKBOOT_POWERON"/>
                <action android:name="com.htc.intent.action.QUICKBOOT_POWERON"/>
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </receiver>



        <!-- < Only if you're using GCM or localNotificationSchedule() > -->
        <receiver
            android:name="com.google.android.gms.gcm.GcmReceiver"
            android:exported="true"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <category android:name="${applicationId}" />
            </intent-filter>
        </receiver>
        <!-- < Only if you're using GCM or localNotificationSchedule() > -->
        <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher" />
        <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
            </intent-filter>
        </receiver>
        <service android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationRegistrationService"/>

        <!-- < Only if you're using GCM or localNotificationSchedule() > -->
        <service
            android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerServiceGcm"
            android:exported="false" >
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            </intent-filter>
        </service>
        <!-- </ Only if you're using GCM or localNotificationSchedule() > -->

        <!-- < Else > -->
        <service
            android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService"
            android:exported="false" >
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>
        <!-- </Else> -->

        <service android:name="io.invertase.firebase.messaging.RNFirebaseMessagingService">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>


    </application>

</manifest>

Environment

react-native info output:

React Native Environment Info:
    System:
      OS: macOS 10.14.4
      CPU: (8) x64 Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz
      Memory: 19.28 MB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 11.2.0 - /usr/local/bin/node
      npm: 6.7.0 - ~/.npm-packages/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
      Android SDK:
        API Levels: 23, 26, 28
        Build Tools: 28.0.3, 29.0.0
        System Images: android-26 | Google Play Intel x86 Atom, android-28 | Intel x86 Atom, android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom_64
    IDEs:
      Android Studio: 3.4 AI-183.5429.30.34.5452501
      Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
    npmPackages:
      react: ^16.8.4 => 16.8.4 
      react-native: ^0.59.1 => 0.59.1 
    npmGlobalPackages:
      react-native-cli: 2.0.1
  • Platform that you're experiencing the issue on:

    • Android
  • Are you using TypeScript?

    • N
@deflorilemarului
Copy link

I have same issue on android.

@minion0324
Copy link

I have same issue on android.

Please check this link.
https://firebase.google.com/support/release-notes/android

@igor-slotin
Copy link

with com.google.firebase:firebase-auth:17.0.0 runs without crashes

@minion0324
Copy link

minion0324 commented May 8, 2019

@igor-slotin
Please let me know your react-native and react-native-firebase version.
And did you change only com.google.firebase:firebase-auth:17.0.0?
Or any others? (I mean firebase-core and etc)

@igor-slotin
Copy link

current react-native-firbase version is 4.3.7
I've downgraded it from 4.3.8, will try to turn it back now
yes, changed only firbase-auth.

@Salakar
Copy link
Member

Salakar commented May 8, 2019

Looks like this is the latest Android SDK release causing this - I'm not sure why the latest release is causing issues when the versions are locked in your dependencies to versions that were working prior to yesterdays release =/

If @igor-slotin solution works then that's the way to go, update to latest Auth SDK:

 com.google.firebase:firebase-auth:17.0.0

Alternatively, it may just be that only core is required to be updated here instead of auth, could someone try that and confirm here please, update core from 16.0.8 to 16.0.9:

com.google.firebase:firebase-core:16.0.9

@igor-slotin
Copy link

I've also update
com.google.firebase:firebase-core from 16.0.8 to 16.0.9
com.google.firebase:firebase-database to 17.0.0
com.google.firebase:firebase-storage to 17.0.0
app has been runned sucessfly, curently in the process of testing functionality

@Salakar you suggestion make sense, i can try update just only it in 10 minutes

@chichilatte
Copy link

I got this same crash on Monday night UK time, 6th May 2019. Was doing debug builds (just superficial tweaks to our codebase), running them on Android emulator, all was fine, then suddenly this error and no builds working since. Another coder on our team just got it this morning.

React Native 0.56.1

*Project gradle*
Android gradle plugin com.android.tools.build:gradle:3.1.4 (Gradle 4.4)
com.google.gms:google-services:4.0.1

*App gradle*
com.google.android.gms:play-services-base:16.0.1
com.google.firebase:firebase-core:16.0.4
com.google.firebase:firebase-auth:16.0.5

*package.json*
react-native-firebase@5.2.0

Might be relevant: To overcome a previous gradle bomb we have this in our app gradle...

com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true

@igor-slotin
Copy link

Nope, updating just core doesn't work for me, the same crash

@chichilatte
Copy link

UPDATE: I got it working by updating firebase-auth to 17.0.0 as mentioned above :)
Also updated the others while i was at it...

*Project gradle*
com.google.gms:google-services:4.1.0
(tried 4.2.0 but it gave me a build error)

*App gradle*
com.google.android.gms:play-services-base:16.1.0
com.google.firebase:firebase-core:16.0.9
com.google.firebase:firebase-auth:17.0.0

What i would love to know is: How did this bug happen without me doing anything apart from running react-native run-android? All the relevant dependencies have specific versions. Hmm.

@ericm999
Copy link

ericm999 commented May 8, 2019

I also am facing same issue. Has anyone resolved yet? I have not installed any new packages but still my app crashes with same error

@Salakar
Copy link
Member

Salakar commented May 8, 2019

What i would love to know is: How did this bug happen without me doing anything apart from running react-native run-android? All the relevant dependencies have specific versions. Hmm.

An Android Firebase SDK release must have caused this, very weird though given that all of us, myself included have specified the exact versions - but according to the Firebase Android SDK release notes for yesterday there was a breaking Auth change:

image

Must have been backported or something, really don't know 🤷‍♂

@nicoburns
Copy link

@ericm999 It seems that an android SDK update has broken the existing packages. However, updating firebase-core from 16.0.8 to 16.0.9 and all other firebase-* packages from 16.x to 17.0.0 has fixed the issues for me (and otherwise seems to work fine).

@snamstorm
Copy link
Author

with com.google.firebase:firebase-auth:17.0.0 runs without crashes

Thank you all, upgrading firebase-auth to 17.0.0 fixed the issue.

@AarshOza
Copy link

AarshOza commented May 9, 2019

with com.google.firebase:firebase-auth:17.0.0 runs without crashes

Thanks man you saved my day !!!

@Salakar Salakar pinned this issue May 9, 2019
@Salakar
Copy link
Member

Salakar commented May 9, 2019

A heads up as well if you're using storage: if you're getting unknown http failure errors, check the logs, if you see the following then you'll need to update to the latest Android SDK version for that as well 😫

java.lang.NoSuchMethodError: No virtual method getToken(Z)Lcom/google/android/gms/tasks/Task; in class Lcom/google/firebase/FirebaseApp; or its super classes (declaration of 'com.google.firebase.FirebaseApp' appears in /data/app/com.invertase.testing-liclx4O0EGs09L4RDd7guA==/base.apk!classes3.dex)

image


It may be the case on other modules, the safest option is to update all of them. There are no breaking changes as far as I can see that will affect RNFB v5 (have tested on RNFB v6 - which had same versions as RNFB v5)

image

@Salakar Salakar added impact: build-error Behaviour causing build failure platform: android plugin: authentication Firebase Authentication plugin: storage Firebase Cloud Storage impact: crash Behaviour causing app to crash. labels May 9, 2019
Salakar added a commit that referenced this issue May 9, 2019
[android] update to latest firebase sdks - previous release broken (#2122)

[skip ci]
@mikehardy
Copy link
Collaborator

mikehardy commented May 10, 2019

I am using current everything on the android side (current gradle, current gradle plugin, current sdk, build tools, firebase deps etc etc) with react-native-firebase 5.3.1 and it's fine for all the modules I'm using - I am not using storage, remote config, or dynamic links yet though

@Salakar
Copy link
Member

Salakar commented May 10, 2019

@mikehardy not sure why it works for you :D Happened to me today on v6 without upgrading anything, just did a fresh android build and it went spoopy 💩

@mikehardy
Copy link
Collaborator

Well, I have something to look forward to on my next build then I suppose - the joy of dynamic dependency resolution.

@AarshOza
Copy link

Anyone who gets module specific errors like Auth,Database, etc. Try updating those to 17.0.0. As firebase updated to these SDK version. Somehow the older SDKs version broke and couldn't simply work anymore !!

@GioLogist
Copy link

+1 for workaround, glad I found this solution!

@chichilatte
Copy link

So reassuring to know that even behemoths like Google fuck things up on a regular basis.

@EmreKorpe
Copy link

I don't understand why Google is shattering jobs in his updates. FirebaseInstanceId was removed and I included it in my project but still couldn't remove my head from problems. Very painful

@hackyxicor
Copy link

with com.google.firebase:firebase-auth:17.0.0 runs without crashes

It's Working

robertbarclay added a commit to robertbarclay/react-native-firebase that referenced this issue May 28, 2019
* v5.x.x:
  5.4.0
  [tests] disable admob (has a new runtime check that causes a crash as we don't have a valid admob identifier)
  [android] update firebase sdk versions - forced to upgrade due to invertase#2122
  [android][internals] rework internals utils to better support JSONObject/Array values
  [GENERAL][BUGFIX][build] - patch v5 build toolchains for XCode10.2 & RN0.59 compatibility (invertase#2166)
  [tests] update podfile lock
  [tests] sync v5.x.x local changes
  [tests] sync v5.x.x local changes
  [docs] update link
  [STORAGE][BUGFIX][ANDROID] - Preserve `file://` prefix
  [JS][BUGFIX] [package.json] - Fix build on Windows (BABEL_ENV error)
  [Messaging] Add null check to acquire WakeLock on Android (invertase#2092)
  [TYPES][BUGFIX][AUTHENTICATION] - Change type PhoneAuthSnapshot.Error to NativeError
@mikehardy
Copy link
Collaborator

Closing this, we've got versions in our compatibility table, we did a fair bit of work recently on v5 build + CI and even did a v5 release, and I'm using it all in a real app - there was definitely a hiccup, but with current versions things are working

@neri4488
Copy link

Downgrading com.google.firebase:firebase-core:17.0.0
to com.google.firebase:firebase-core:16.0.9 solved it.
I can finally run the app without crash.

@mikehardy
Copy link
Collaborator

@neri4488 - yes that is one way, just replying for future viewers, because you may be able to use the versions over 16 (that is, the AndroidX ones) if you also convert your app to AndroidX and use https://github.com/mikehardy/jetifier - but all these things (the AndroidX transition steps) have to happen together - all one way or all the other

@richardradics
Copy link

https://dev.to/rosariopfernandes/exploring-firebase-bill-of-materials-bom-1hij

I fixed this issue with adding firebase-bom to my project

implementation platform('com.google.firebase:firebase-bom:17.0.0')

implementation "com.google.firebase:firebase-core"
implementation "com.google.firebase:firebase-analytics"
implementation "com.google.firebase:firebase-messaging"

https://firebase.google.com/support/release-notes/android#2019-04-02

@mikehardy
Copy link
Collaborator

Having tested the "bom" style myself, it what I recommend going forward, we just haven't updated the docs or anything. It is a very nice way to manage all the dependencies. That said, @richardradics why not bom 22.1.0? I don't understand why people don't stay current... 🤷‍♂️

@richardradics
Copy link

@mikehardy I've just tried to be as close with the versions as in the library's integration documentation. In the firebase-bom version 17.0.0 the firebase-core is 16.0.8. In the android integration guide the library recommends the 16.0.9 version, and I thought that version is supported.

@mikehardy
Copy link
Collaborator

I updated the docs recently so they indicate ranges, including the current ones - the whole point of the v5.5.x release line where I made breaking changes was to support keeping the underlying firebase SDKs current. You can assume that until the SDKs themselves make another breaking changes you can just stay updated https://rnfirebase.io/docs/v5.x.x/getting-started#Supported-versions---React-Native-/-Firebase

...and when they do, I'll release v5.6.x with the necessary changes to make those compatible

@mikehardy
Copy link
Collaborator

Which I guess answers my implied question anyway: I think our documents might be a bit unclear there. if you can think of a more clear wording for that link that makes it clear we track the current underlying SDKs so you can stay current, I'm open to anything as a PR there

@Precival
Copy link

Precival commented Jun 7, 2020

I had the same issue on android.
My project used API19(Android 4), and i just changed in "build.gradle", the "google-services" version, from "classpath 'com.google.gms:google-services:4.3.3'", to "classpath 'com.google.gms:google-services:4.2.0'", and remove "implementation 'com.google.firebase:firebase-analytics:17.2.2'".

@amixel
Copy link

amixel commented Dec 4, 2020

Same issue.

@mikehardy
Copy link
Collaborator

@amixel this issue is closed, which implies if you have the same issue it should be solved with the above information

If you have an open issue on current stable versions, please open a new issue including the necessary information in the template. Prior to doing so I encourage you to examine what a clean example looks like to make sure you've done all necessary steps: https://github.com/mikehardy/rnfbdemo/blob/master/make-demo.sh

@amixel
Copy link

amixel commented Dec 4, 2020

@amixel este problema foi encerrado, o que significa que se você tiver o mesmo problema, ele deve ser resolvido com as informações acima

Se você tiver um problema aberto nas versões estáveis ​​atuais, abra um novo problema incluindo as informações necessárias no modelo. Antes de fazer isso, eu encorajo você a examinar a aparência de um exemplo limpo para ter certeza de que executou todas as etapas necessárias: https://github.com/mikehardy/rnfbdemo/blob/master/make-demo.sh

but I don't see the solution that good.
They said to use firebase-auth, but I don't need that, it's not a coherent solution.
Unless it's temporary ..

the Firebase community is also experiencing the same problem.
firebase/quickstart-unity#861

@mikehardy
Copy link
Collaborator

@amixel

If you have an open issue on current stable versions, please open a new issue including the necessary information in the template. Prior to doing so I encourage you to examine what a clean example looks like to make sure you've done all necessary steps: https://github.com/mikehardy/rnfbdemo/blob/master/make-demo.sh

@munenelewis
Copy link

com.google.firebase:firebase-core:16.0.9

Worked for me thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact: build-error Behaviour causing build failure impact: crash Behaviour causing app to crash. platform: android plugin: authentication Firebase Authentication plugin: storage Firebase Cloud Storage
Projects
None yet
Development

No branches or pull requests