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

🔥[🐛] Crash - Using in-app-messaging (or remote-config) without analytics #4821

Closed
4 of 10 tasks
sabin10 opened this issue Jan 26, 2021 · 3 comments · Fixed by #4850
Closed
4 of 10 tasks

🔥[🐛] Crash - Using in-app-messaging (or remote-config) without analytics #4821

sabin10 opened this issue Jan 26, 2021 · 3 comments · Fixed by #4850
Assignees
Labels
impact: crash Behaviour causing app to crash. platform: android plugin: analytics Google Analytics for Firebase plugin: remote_config Firebase Remote Config type: bug New bug report Workflow: Needs Review Pending feedback or review from a maintainer.

Comments

@sabin10
Copy link

sabin10 commented Jan 26, 2021

Issue

Hello guys. We updated to firebase 10.5.0 (for app package and 10.5.1 for the other packages) and rollout in production. For the first time our play console registered this crash on opening the app. It impacted ~ 1k/20k users. It was something that we couldn't replicate with our devices & emulators.

This is the stack trace from play console

java.lang.RuntimeException: 
  at android.app.ActivityThread.installProvider (ActivityThread.java:6747)
  at android.app.ActivityThread.installContentProviders (ActivityThread.java:6289)
  at android.app.ActivityThread.handleBindApplication (ActivityThread.java:6204)
  at android.app.ActivityThread.access$1200 (ActivityThread.java:237)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1785)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:214)
  at android.app.ActivityThread.main (ActivityThread.java:7050)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:494)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:965)
Caused by: com.google.firebase.components.MissingDependencyException: 
  at com.google.firebase.components.ComponentRuntime.b (ComponentRuntime.java:125)
  at com.google.firebase.components.ComponentRuntime.a (ComponentRuntime.java:130)
  at com.google.firebase.components.ComponentRuntime.<init> (ComponentRuntime.java:106)
  at com.google.firebase.components.ComponentRuntime.<init> (ComponentRuntime.java)
  at com.google.firebase.components.ComponentRuntime.<init> (ComponentRuntime.java)
  at com.google.firebase.FirebaseApp.<init> (FirebaseApp.java:140)
  at com.google.firebase.FirebaseApp.a (FirebaseApp.java:60)
  at com.google.firebase.FirebaseApp.a (FirebaseApp.java:37)
  at com.google.firebase.provider.FirebaseInitProvider.onCreate (FirebaseInitProvider.java:4)
  at android.content.ContentProvider.attachInfo (ContentProvider.java:1940)
  at android.content.ContentProvider.attachInfo (ContentProvider.java:1915)
  at com.google.firebase.provider.FirebaseInitProvider.attachInfo (FirebaseInitProvider.java:15)
  at android.app.ActivityThread.installProvider (ActivityThread.java:6742)
  at android.app.ActivityThread.installContentProviders (ActivityThread.java:6289)
  at android.app.ActivityThread.handleBindApplication (ActivityThread.java:6204)
  at android.app.ActivityThread.access$1200 (ActivityThread.java:237)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1785)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:214)
  at android.app.ActivityThread.main (ActivityThread.java:7050)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:494)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:965)

What we updated:

  1. firebase:

Screenshot 2021-01-25 at 23 23 12

  1. versions in android/build.gradle (may be related):

Screenshot 2021-01-26 at 10 15 54

Then we got a more specific stacktrace from a beta tester:
Screenshot 2021-01-26 at 10 13 04

Reached out to the tester and downgrade firebase versions from package.json to previous values. It works now for him.

But I would not jump into conclusions as I researched this a lot. I'm not sure if it's a firebase problem(probably native implementation) or a cache problem with our project

Other issues i find related:

  1. Issue: Unable to get provider io.invertase.firebase.crashlytics.ReactNativeFirebaseCrashlyticsInitProvider #3670 - Almost same exception but is not satisfied with Crashlytics, instead of InAppMessaging.

Project Files

Javascript

Click To Expand

package.json:

{
"dependencies": {
    "@invertase/react-native-apple-authentication": "1.1.2",
    "@react-native-community/async-storage": "1.12.1",
    "@react-native-community/clipboard": "1.5.1",
    "@react-native-community/google-signin": "5.0.0",
    "@react-native-community/netinfo": "5.9.7",
    "@react-native-firebase/app": "10.5.0",
    "@react-native-firebase/crashlytics": "10.5.1",
    "@react-native-firebase/dynamic-links": "10.5.1",
    "@react-native-firebase/in-app-messaging": "10.5.1",
    "@react-native-firebase/messaging": "10.5.1",
    "@react-native-firebase/remote-config": "10.5.1",
    "@sentry/react-native": "2.1.0",
    "@types/detox": "16.4.3",
    "axios": "0.21.0",
    "date-fns": "2.16.1",
    "fast-memoize": "2.5.2",
    "jetifier": "1.6.6",
    "lottie-react-native": "3.5.0",
    "patch-package": "6.2.2",
    "postinstall-postinstall": "2.1.0",
    "prop-types": "15.7.2",
    "query-string": "6.13.7",
    "react": "16.13.1",
    "react-native": "0.63.2",
    "react-native-amplitude-analytics": "0.2.11",
    "react-native-animatable": "1.3.3",
    "react-native-code-push": "6.4.0",
    "react-native-contacts": "6.0.3",
    "react-native-draggable-flatlist": "2.5.0",
    "react-native-exception-handler": "2.10.9",
    "react-native-fast-image": "8.3.3",
    "react-native-fbsdk": "3.0.0",
    "react-native-gesture-handler": "1.8.0",
    "react-native-image-crop-picker": "0.34.1",
    "react-native-image-viewing": "0.2.0",
    "react-native-indicators": "0.17.0",
    "react-native-intercom-native": "1.0.1",
    "react-native-iphone-x-helper": "1.3.1",
    "react-native-keyboard-aware-scroll-view": "0.9.3",
    "react-native-keyboard-spacer": "0.4.1",
    "react-native-keychain": "3.1.3",
    "react-native-linear-gradient": "2.5.6",
    "react-native-modalize": "2.0.6",
    "react-native-navigation": "6.11.0",
    "react-native-navigation-hooks": "6.0.2",
    "react-native-rate": "1.2.4",
    "react-native-reanimated": "1.9.0",
    "react-native-restart": "0.0.17",
    "react-native-share": "5.1.0",
    "react-native-sms": "1.11.0",
    "react-native-sound": "0.11.0",
    "react-native-svg": "12.1.0",
    "react-native-swiper": "1.6.0",
    "react-native-v8": "0.63.2-patch.1",
    "react-native-version-check": "3.4.2",
    "react-native-walkthrough-tooltip": "1.1.11",
    "react-native-webview": "10.10.2",
    "react-redux": "7.2.2",
    "redux": "4.0.5",
    "redux-persist": "6.0.0",
    "redux-persist-filesystem-storage": "3.0.0",
    "redux-persist-transform-filter": "0.0.20",
    "redux-thunk": "2.3.0",
    "reselect": "4.0.0",
    "rn-fetch-blob": "0.12.0",
    "rn-placeholder": "3.0.3",
    "singular-react-native": "^1.1.6",
    "ts-jest": "26.4.4",
    "v8-android-nointl": "8.84.0"
  },
}

firebase.json for react-native-firebase v6:

{
  "react-native": {
    "messaging_android_notification_channel_id": "high-priority"
  }
}

iOS

Click To Expand

ios/Podfile:

  • I'm not using Pods
  • I'm using Pods and my Podfile looks like:
# N/A

AppDelegate.m:

// N/A


Android

Click To Expand

Have you converted to AndroidX?

  • my application is an AndroidX application?
  • I am using android/gradle.settings jetifier=true for Android compatibility?
  • I am using the NPM package jetifier for react-native compatibility?

android/build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        RNNKotlinVersion = '1.3.61'
        buildToolsVersion = '29.0.2'
        minSdkVersion = 21
        compileSdkVersion = 29
        targetSdkVersion = 29
        supportLibVersion = "28.0.0"
        googlePlayServicesVersion = "16.1.0"
        kotlinVersion = '1.3.41'
        RNNKotlinStdlib = "kotlin-stdlib-jdk8"

    }
    ext.detoxKotlinVersion = ext.kotlinVersion

    repositories {
        mavenLocal()
        mavenCentral()
        google()
        jcenter()
        maven {
            url 'https://maven.fabric.io/public'
        }
        // From react-native-image-picker-crop
        maven { url 'https://maven.google.com' }

        // From react-native-image-picker-crop
        maven { url "https://www.jitpack.io" }

        
    }
    dependencies {
        classpath('com.android.tools.build:gradle:4.0.2')
        classpath 'com.google.gms:google-services:4.3.3'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
        classpath 'de.mannodermaus.gradle.plugins:android-junit5:1.4.2.1'
        classpath 'de.undercouch:gradle-download-task:3.4.3'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.2.0'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

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

            // Replace AAR from original RN with AAR from react-native-v8
            url("$rootDir/../node_modules/react-native-v8/dist")
        }
        maven {
            // Android JSC is installed from npm
            // url("$rootDir/../node_modules/jsc-android/dist")

            // prebuilt libv8android.so
            url("$rootDir/../node_modules/v8-android-nointl/dist")
        }
        maven {
            url "$rootDir/../node_modules/detox/Detox-android"
        }
        google()
        mavenCentral()
        jcenter()
        maven { url 'https://www.jitpack.io' }

        maven { url 'http://maven.singular.net/' }

        // force dependency versions on all subprojects
        configurations.all {
            resolutionStrategy {
                // force soloader 0.9.0 for x86 arhitecture crash
                force "com.facebook.soloader:soloader:0.9.0"
			}
		}
    }
}

subprojects { subproject ->
    afterEvaluate {
        if ((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
            android {
                variantFilter { variant ->
                    def names = variant.flavors*.name
                    if (names.contains("reactNative51") || names.contains("reactNative55") || names.contains("reactNative56") || names.contains("reactNative57") || names.contains("reactNative57_5") || names.contains("reactNative57WixFork") || names.contains("ReactNative57Wix") || names.contains("reactNative60")) {
                        setIgnore(true)
                    }
                }
            }
        }
    }
}

android/app/build.gradle:

apply plugin: "com.android.application"

import com.android.build.OutputFile

project.ext.react = [
    enableHermes : false,  // clean and rebuild if changing
]

apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"
apply from: "../../node_modules/@sentry/react-native/sentry.gradle"

def enableSeparateBuildPerCPUArchitecture = false

def enableProguardInReleaseBuilds = false


def jscFlavor = 'org.webkit:android-jsc:+'

def enableHermes = project.ext.react.get("enableHermes", false)

android {
    signingConfigs {
        release {
            if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
                storeFile file(MYAPP_UPLOAD_STORE_FILE)
                storePassword MYAPP_UPLOAD_STORE_PASSWORD
                keyAlias MYAPP_UPLOAD_KEY_ALIAS
                keyPassword MYAPP_UPLOAD_KEY_PASSWORD
            }
        }
    }
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        applicationId "com.xxxxxxxxx"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 3146135
        versionName "5.1.0"
        multiDexEnabled true
        missingDimensionStrategy "RNN.reactNativeVersion", "reactNative62"
        renderscriptTargetApi rootProject.ext.targetSdkVersion
        renderscriptSupportModeEnabled true
        resConfigs "en", "US"
        testBuildType System.getProperty('testBuildType', 'debug')
        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
        vectorDrawables.useSupportLibrary = true
    }

    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
        }
    }
    buildTypes {
        debug {
        }
        release {
            signingConfig signingConfigs.release
            // optimization
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            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
            }
        }
    }

    packagingOptions {       
        exclude "**/libjsc.so"
    }
}

dependencies {
    def multidex_version = "2.0.1"
    def appcompat_version = "1.0.2"

    implementation fileTree(dir: "libs", include: ["*.jar"])

    if (enableHermes) {
        def hermesPath = "../../node_modules/hermes-engine/android/"
        debugImplementation files(hermesPath + "hermes-debug.aar")
        releaseImplementation files(hermesPath + "hermes-release.aar")
    } else {
        implementation jscFlavor
    }

    implementation project(':react-native-exception-handler')
    implementation project(':react-native-version-check')  

    implementation "com.google.android.gms:play-services-base:${rootProject.ext.googlePlayServicesVersion}"

    implementation 'com.amplitude:android-sdk:2.19.1' // native sdk of amplitude
    implementation project(':react-native-amplitude-analytics')
    implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
    implementation project(':react-native-keychain')
    implementation project(':react-native-linear-gradient')
    implementation "androidx.appcompat:appcompat:$appcompat_version"
    implementation "com.facebook.react:react-native:+"  // From node_modules

    implementation 'org.chromium:v8-android:+'

    implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
    debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
      exclude group:'com.facebook.fbjni'
    }
    debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
        exclude group:'com.facebook.flipper'
    }
    debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
        exclude group:'com.facebook.flipper'
    }

    // Force webkit version. Needed for editor
    implementation 'androidx.webkit:webkit:1.2.0'

    implementation project(':react-native-navigation')
    implementation 'com.android.support:design:27.1.0'
    implementation "androidx.multidex:multidex:$multidex_version"
    implementation('com.crashlytics.sdk.android:crashlytics:2.9.9@aar') {
        transitive = true
    }

    implementation 'com.facebook.soloader:soloader:0.9.0+'

    androidTestImplementation('com.wix:detox:+') { transitive = true }
    androidTestImplementation 'junit:junit:4.12'
}

task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
configurations {
    all*.exclude group: 'com.google.guava', module: 'listenablefuture'
}

android/settings.gradle:

rootProject.name = 'xxxxxxxxx'
include ':react-native-webview'
project(':react-native-webview').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-webview/android')
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)

include ':app', ':react-native-code-push'
project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app')
include ':react-native-exception-handler'
project(':react-native-exception-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-exception-handler/android')
include ':react-native-version-check'
project(':react-native-version-check').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-version-check/android')
include ':react-native-amplitude-analytics'
project(':react-native-amplitude-analytics').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-amplitude-analytics/android')
include ':react-native-keychain'	
project(':react-native-keychain').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-keychain/android')
include ':react-native-linear-gradient'
project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android')
include ':singular-react-native'
project(':singular-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/singular-react-native/android')
include ':react-native-navigation'
project(':react-native-navigation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-navigation/lib/android/app/')

include ':app'

MainApplication.java:

package com.xxxxxxxx;

import android.content.Context;

import androidx.multidex.MultiDex;

import com.microsoft.codepush.react.CodePush;

import com.BV.LinearGradient.LinearGradientPackage;
import com.facebook.CallbackManager;
import com.facebook.appevents.AppEventsLogger;
import com.facebook.react.PackageList;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.reactnativenavigation.NavigationApplication;
import com.reactnativenavigation.react.NavigationReactNativeHost;
import com.reactnativenavigation.react.ReactGateway;

import java.lang.reflect.InvocationTargetException;
import java.util.List;

import com.facebook.react.modules.i18nmanager.I18nUtil;

public class MainApplication extends NavigationApplication {

    private static CallbackManager mCallbackManager = CallbackManager.Factory.create();

    protected static CallbackManager getCallbackManager() {
        return mCallbackManager;
    }

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

        @Override
        protected String getJSBundleFile() {
            return CodePush.getJSBundleFile();
        }

        protected List<ReactPackage> getPackages() {
            // Add additional packages you require here
            // No need to add RnnPackage and MainReactPackage

            @SuppressWarnings("UnnecessaryLocalVariable")
            List<ReactPackage> packages = new PackageList(this).getPackages();
            // Packages that cannot be autolinked yet can be added manually here, for
            // example:

            packages.add(new LinearGradientPackage());
            packages.add(new KeyboardManagerPackage());
            return packages;
        }

        public List<ReactPackage> createAdditionalReactPackages() {
            return getPackages();
        }

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

    };

    @Override
    public void onCreate() {
        super.onCreate();

        /* Disable app being forced into Right-To-Left format */
        I18nUtil sharedI18nUtilInstance = I18nUtil.getInstance();
        sharedI18nUtilInstance.allowRTL(getApplicationContext(), false);

        initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
    }

    public boolean isDebug() {
        return BuildConfig.DEBUG;
    }

    @Override
    protected void attachBaseContext(Context context) {
        super.attachBaseContext(context);
        MultiDex.install(this);
    }

    @Override
    public ReactNativeHost getReactNativeHost() {
        return this.host;
    }

    /**
     * Loads Flipper in React Native templates. Call this in the onCreate method
     * with something like initializeFlipper(this,
     * getReactNativeHost().getReactInstanceManager());
     *
     * @param context
     * @param reactInstanceManager
     */
    private static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
        if (BuildConfig.DEBUG) {
            try {
                /*
                 * We use reflection here to pick up the class that initializes Flipper, since
                 * Flipper library is not available in release mode
                 */
                Class<?> aClass = Class.forName("com.xxxxxxxx.ReactNativeFlipper");
                aClass.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class).invoke(null, context,
                        reactInstanceManager);
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            } catch (NoSuchMethodException e) {
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            } catch (InvocationTargetException e) {
                e.printStackTrace();
            }
        }
    }
}

AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8" ?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.xxxxxxxxxxx">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    
    <!-- required for react-native-share base64 sharing -->
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

    <uses-feature android:name="android.hardware.camera" android:required="false" />
    <uses-feature android:name="android.hardware.camera.front" android:required="false" />

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <!--  This permission is needed for Singular to retrieve Google Play Referrer data  -->
    <uses-permission android:name="com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE" />
    <!--  This permission is needed for Singular to retrieve data from the google licensing API  -->
    <uses-permission android:name="com.android.vending.CHECK_LICENSE" />

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

    <!--permissions to remove-->
    <uses-permission android:name="android.permission.READ_PHONE_STATE" android:maxSdkVersion="22"/>
    <uses-permission android:name="android.permission.USE_FINGERPRINT" tools:node="remove" />
    <uses-permission android:name="android.permission.USE_BIOMETRIC" tools:node="remove" />



    <application
        android:name=".MainApplication"
        android:allowBackup="false"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:theme="@style/AppTheme"
        android:requestLegacyExternalStorage="true"
        tools:targetApi="q">
        <activity
            android:name=".MainActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
            android:label="@string/app_name"
            android:launchMode="singleTask"
            android:windowSoftInputMode="adjustUnspecified">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
                <action android:name="android.intent.action.DOWNLOAD_COMPLETE" />
            </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" />
            </intent-filter>
            <!-- DON'T DELETE, NEEDED FOR SHARE EXTENSION -->
            <intent-filter>	
                <data android:scheme="xxxxxxxxx" />	
                <action android:name="android.intent.action.VIEW" />	
                <category android:name="android.intent.category.DEFAULT" />	
                <category android:name="android.intent.category.BROWSABLE" />	
            </intent-filter>

            <intent-filter>
                <action android:name="android.intent.action.SEND" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="text/plain" />
            </intent-filter>
        </activity>
        <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" /> <!-- Notification icon and color -->
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_icon"
            android:resource="@drawable/ic_notification" />
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_color"
            android:resource="@color/colorAccent" 
            tools:replace="android:resource"/>
        <!-- <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" />
        <meta-data
            android:name="com.facebook.sdk.CodelessDebugLogEnabled"
            android:value="true" />
        

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


        <service android:name="io.invertase.firebase.messaging.RNFirebaseBackgroundMessagingService" />
    </application>

</manifest>


Environment

Click To Expand

react-native info output:

System:
    OS: macOS 10.15.7
    CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
    Memory: 5.13 GB / 32.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 15.6.0 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.4.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.0 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.1, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
    Android SDK:
      API Levels: 28, 29, 30
      Build Tools: 28.0.3, 29.0.2, 30.0.2
      System Images: android-29 | Android TV Intel x86 Atom, android-29 | Intel x86 Atom, android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom_64, android-29 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom_64, android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom, android-30 | Google Play Intel x86 Atom_64
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.1 AI-201.8743.12.41.6858069
    Xcode: 12.1/12A7403 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_282 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1
    react-native: 0.63.2 => 0.63.2
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
  • Platform that you're experiencing the issue on:
    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • react-native-firebase version you're using that has this issue:
    • 10.5.0
  • Firebase module(s) you're using that has the issue:
    • Crashlytics, DynamicLinks, InAppMessaging, Messaging, RemoteConfig
  • Are you using TypeScript?
    • Y


@sabin10 sabin10 added help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report labels Jan 26, 2021
@mikehardy
Copy link
Collaborator

Hmm -


        supportLibVersion = "28.0.0"
        googlePlayServicesVersion = "16.1.0"

I have 1.3.2 for support lib and play services at 17.5.0 (both current as of this typing). Kotlin can be 1.4.21 and react-native at 0.63.4. appcompat is on 1.2.0 as well. The support lib being old is maybe related to the non-androidx design dependency? Either way looks like you're playing with fire there partially androidx converted, partially not

crashlytics plugin is 2.4.1 and google-services is 4.3.4

        <service android:name="io.invertase.firebase.messaging.RNFirebaseBackgroundMessagingService" />

looks like a remnant from react-native-firebase v5, this should not be necessary

That along with kotlin and react-native itself are behind, I don't think these in particular will end well

All of that is somewhat unrelated though. I think the error message is supposed to be more thorough and explain what component failed,

My guess is that in-app-messaging has a dependency on analytics and if you add it, it will work?

https://github.com/firebase/firebase-android-sdk/blob/843b963679a3a02f044f9f8bdabadfbcfbbe1202/firebase-inappmessaging-display/src/main/java/com/google/firebase/inappmessaging/display/FirebaseInAppMessagingDisplayRegistrar.java#L49

I'm actually not sure how you expect remote-config or in-app-messaging to function without analytics as they both indicate it is necessary:

https://firebase.google.com/docs/in-app-messaging/get-started?platform=android
https://firebase.google.com/docs/remote-config/use-config-android

I think that will get you moving, however it would be a bug here if we don't specify those are required - and I Just checked the docs, we don't. Pending confirmation that fixes your issue we can pursue communicating the required transitive dependency

@sabin10
Copy link
Author

sabin10 commented Jan 27, 2021

@mikehardy thank you. installing analytics solved this.

we didn't check official firebase docs, only react-native-firebase. I guess the majority of RN developers did this, adding this is in the docs will help

@mikehardy
Copy link
Collaborator

Really glad to hear that worked, I was going to be confused if it did not work :-)
This needs to go in to the docs but even more so, I think we can make analytics a devDependency of in-app-messaging and remote-config to more formally specify it

I hope you don't mind but I am going to change the title on this one now that the root cause seems identified, and I will leave it open to prompt the follow-on work

Cheers

@mikehardy mikehardy changed the title 🔥[🐛] Crash - Unable to get provider com.google.firebase.provider.FirebaseInitProvider 🔥[🐛] Crash - Using in-app-messaging (or remote-config) without analytics Jan 27, 2021
@mikehardy mikehardy added impact: crash Behaviour causing app to crash. platform: android plugin: analytics Google Analytics for Firebase plugin: remote_config Firebase Remote Config Type: Docs Workflow: Needs Review Pending feedback or review from a maintainer. and removed help: needs-triage Issue needs additional investigation/triaging. labels Jan 27, 2021
@mikehardy mikehardy self-assigned this Feb 2, 2021
mikehardy added a commit that referenced this issue Feb 2, 2021
…ency

Visible in integration guides upstream

Related #4821
mikehardy added a commit that referenced this issue Feb 2, 2021
…dependency

Visible in integration guides upstream

Related #4821
mikehardy added a commit that referenced this issue Feb 2, 2021
…ency

Visible in integration guides upstream

Related #4821
mikehardy added a commit that referenced this issue Feb 2, 2021
…ency

Visible in integration guides upstream

Related #4821
mikehardy added a commit that referenced this issue Feb 2, 2021
…dependency

Visible in integration guides upstream

Related #4821
mikehardy added a commit that referenced this issue Feb 2, 2021
…ency

Visible in integration guides upstream

Related #4821
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact: crash Behaviour causing app to crash. platform: android plugin: analytics Google Analytics for Firebase plugin: remote_config Firebase Remote Config type: bug New bug report Workflow: Needs Review Pending feedback or review from a maintainer.
Projects
None yet
2 participants