invertase / react-native-firebase

🔥 A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
https://rnfirebase.io
Other
11.73k stars 2.22k forks source link

🔥 Error installing on Android after fresh ExpoKit (SDK32) eject #2018

Closed redpandatronicsuk closed 5 years ago

redpandatronicsuk commented 5 years ago

Issue

I removed expo-firebase from my app as it is deprecated now. I tried to add react-native-firebase, but got too many build errors (on Android), so decided to do a fresh ExpoKit eject. I followed the installation guide, but after changing com.google.gms:google-services:3.2.1 to com.google.gms:google-services:4.0.1 I get this error when trying to build:

ERROR: The library com.google.android.gms:play-services-basement is being requested by various other libraries at [[15.0.1,15.0.1]], but resolves to 16.0.1. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

I tried adding com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true to the bottom of app/build.gradle, but then get:

Error: Program type already present: com.google.android.gms.internal.measurement.zzu

Project Files

iOS

ios/Podfile:

# N/A

AppDelegate.m:

// N/A

Android

android/build.gradle:

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

buildscript {
  repositories {
    google()
    jcenter()
    maven { url 'https://dl.bintray.com/android/android-tools/' }
  }
  dependencies {
    classpath 'com.android.tools.build:gradle:3.2.1'
    classpath 'com.google.gms:google-services:4.0.1'
    // Version before installing react-native-firebase:
//    classpath 'com.google.gms:google-services:3.2.1'
    classpath 'de.undercouch:gradle-download-task:2.0.0'
    classpath 'com.amazonaws:aws-devicefarm-gradle-plugin:1.3' // https://github.com/awslabs/aws-device-farm-gradle-plugin/releases
  }
}

allprojects {
  repositories {
    // For non-detach
    maven {
      url "$rootDir/maven"
    }
    // For old expoviews to work
    maven {
      url "$rootDir/versioned-abis/expoview-abi26_0_0/maven"
    }
    maven {
      url "$rootDir/versioned-abis/expoview-abi27_0_0/maven"
    }
    maven {
      url "$rootDir/versioned-abis/expoview-abi28_0_0/maven"
    }
    maven {
      url "$rootDir/versioned-abis/expoview-abi29_0_0/maven"
    }
    maven {
      url "$rootDir/versioned-abis/expoview-abi30_0_0/maven"
    }
    maven {
      url "$rootDir/versioned-abis/expoview-abi31_0_0/maven"
    }
    maven {
      url "$rootDir/versioned-abis/expoview-abi32_0_0/maven"
    }
    // For detach
    maven {
      url "$rootDir/../node_modules/expokit/maven"
    }
    maven {
      // We use a modified build of com.android.support.test:runner:1.0.1. Explanation in maven-test/README
      url "$rootDir/maven-test"
    }
    google()
    jcenter()
    maven {
      // Local Maven repo containing AARs with JSC built for Android
      url "$rootDir/../node_modules/jsc-android/dist"
    }
    flatDir {
      dirs 'libs'
      // dirs project(':expoview').file('libs')
    }
    // https://github.com/google/ExoPlayer/issues/5225#issuecomment-445739013
    maven { url 'https://google.bintray.com/exoplayer' }
    maven { url "https://jitpack.io" }

    // Want this last so that we never end up with a stale cache
    mavenLocal()
  }
}

task clean(type: Delete) {
  delete rootProject.buildDir
}

android/app/build.gradle:

buildscript {
  repositories {
    google()
    maven { url 'https://maven.fabric.io/public' }
  }

  dependencies {
    classpath 'io.fabric.tools:gradle:1.26.1'
  }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'devicefarm'

repositories {
  maven { url 'https://maven.fabric.io/public' }
}

android {
  compileSdkVersion 27

  defaultConfig {
    applicationId 'com.ninabeste.myditation'
    minSdkVersion 21
    targetSdkVersion 26
    versionCode 1
    versionName '2.0.6'
    ndk {
      abiFilters 'armeabi-v7a', 'x86'
    }
    multiDexEnabled true
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    // Deprecated. Used by net.openid:appauth
    manifestPlaceholders = [
        'appAuthRedirectScheme': 'host.exp.exponent'
    ]
  }
  dexOptions {
    javaMaxHeapSize System.getenv("DISABLE_DEX_MAX_HEAP") ? null : "8g"
  }

  flavorDimensions 'remoteKernel'
  productFlavors {
    devKernel {
      dimension 'remoteKernel'
    }
    prodKernel {
      dimension 'remoteKernel'
    }
  }
  signingConfigs {
    debug {
      storeFile file('../debug.keystore')
    }
    release {
      storeFile file(System.getenv("ANDROID_KEYSTORE_PATH") ?: "release-key.jks")
      storePassword System.getenv("ANDROID_KEYSTORE_PASSWORD")
      keyAlias System.getenv("ANDROID_KEY_ALIAS")
      keyPassword System.getenv("ANDROID_KEY_PASSWORD")
    }
  }
  buildTypes {
    debug {
      debuggable true
      ext.enableCrashlytics = false
    }
    release {
      minifyEnabled true
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
      signingConfig signingConfigs.release
    }
  }
  lintOptions {
    abortOnError false
  }
  packagingOptions {
    pickFirst "**"
  }
  configurations.all {
    resolutionStrategy.force 'com.android.support:design:27.1.0'
  }
}

devicefarm {
  projectName System.getenv("DEVICEFARM_PROJECT_NAME")
  devicePool System.getenv("DEVICEFARM_DEVICE_POOL")
  executionTimeoutMinutes 40
  authentication {
    accessKey System.getenv("AWS_ACCESS_KEY_ID")
    secretKey System.getenv("AWS_SECRET_ACCESS_KEY")
  }
}

configurations.all {
  resolutionStrategy {
    force 'org.webkit:android-jsc:r224109'
  }
}

// WHEN_PREPARING_SHELL_REMOVE_FROM_HERE

apply from: 'expo.gradle'

// WHEN_PREPARING_SHELL_REMOVE_TO_HERE

dependencies {
    compile project(':react-native-firebase')
  // Added for react-naitve-firebase (think it needs to go up here)
  implementation project(':react-native-firebase')
  implementation fileTree(dir: 'libs', include: ['*.jar'])

  implementation 'com.android.support:multidex:1.0.1'

  // Our dependencies
  implementation 'com.android.support:appcompat-v7:27.1.1'

  // Our dependencies from ExpoView
  // DON'T ADD ANYTHING HERE THAT ISN'T IN EXPOVIEW. ONLY COPY THINGS FROM EXPOVIEW TO HERE.
  implementation 'com.android.support:appcompat-v7:27.1.1'
  implementation 'com.facebook.android:facebook-android-sdk:4.37.0'
  implementation('com.facebook.android:audience-network-sdk:4.99.0') {
    exclude module: 'play-services-ads'
  }
  compileOnly 'org.glassfish:javax.annotation:3.1.1'
  implementation 'com.jakewharton:butterknife:8.4.0'
  implementation 'de.greenrobot:eventbus:2.4.0'

  // Be careful when upgrading! Upgrading might break experience scoping. Check with Jesse. See Analytics.resetAmplitudeDatabaseHelper
  implementation 'com.amplitude:android-sdk:2.9.2'

  implementation 'com.squareup.picasso:picasso:2.5.2'
  implementation 'com.google.android.gms:play-services-gcm:15.0.1'
  implementation 'com.google.android.gms:play-services-analytics:16.0.1'
  implementation 'com.google.android.gms:play-services-maps:15.0.1'
  implementation 'com.google.android.gms:play-services-auth:15.0.1'
  implementation 'com.google.android.gms:play-services-location:15.0.1'
  implementation 'com.google.android.gms:play-services-ads:15.0.1'
  annotationProcessor 'com.raizlabs.android:DBFlow-Compiler:2.2.1'
  implementation "com.raizlabs.android:DBFlow-Core:2.2.1"
  implementation "com.raizlabs.android:DBFlow:2.2.1"
  implementation "com.madgag.spongycastle:core:1.53.0.0"
  implementation "com.madgag.spongycastle:prov:1.53.0.0"
  debugImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
  // debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.4-beta1'
  releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
  implementation 'com.facebook.device.yearclass:yearclass:2.1.0'
  implementation 'commons-io:commons-io:1.4'
  implementation 'me.leolin:ShortcutBadger:1.1.4@aar'
  implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
  implementation 'com.yqritc:android-scalablevideoview:1.0.1'
  implementation 'commons-codec:commons-codec:1.10'
  implementation 'com.segment.analytics.android:analytics:4.3.0'
  implementation 'com.google.zxing:core:3.3.3'
  implementation 'net.openid:appauth:0.4.1'
  implementation('com.airbnb.android:lottie:2.5.5') {
    exclude group: 'com.android.support', module: 'appcompat-v7'
  }
  implementation 'io.branch.sdk.android:library:2.17.1'
  implementation('io.nlopez.smartlocation:library:3.2.11') {
    transitive = false
  }
  implementation 'com.android.support:exifinterface:27.1.1'
  implementation 'com.squareup.okio:okio:1.9.0'
  implementation 'com.facebook.soloader:soloader:0.5.1'

  implementation 'com.google.android.exoplayer:exoplayer:2.6.1'
  implementation 'expolib_v1.com.google.android.exoplayer:expolib_v1-extension-okhttp:2.6.1@aar'

  // expo-file-system
  implementation 'com.squareup.okhttp3:okhttp:3.10.0'
  implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.10.0'

  // Testing
  androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
  // We use a modified build of com.android.support.test:runner:1.0.1. Explanation in maven-test/README
  androidTestImplementation 'com.android.support.test:runner:1.0.1'
  androidTestImplementation 'com.android.support:support-annotations:27.1.1'
  androidTestImplementation 'com.google.code.findbugs:jsr305:3.0.0'
  androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1'
  androidTestImplementation 'com.azimolabs.conditionwatcher:conditionwatcher:0.2'

  testImplementation 'junit:junit:4.12'
  testImplementation 'org.mockito:mockito-core:1.10.19'
  testImplementation 'org.robolectric:robolectric:3.8'
  testImplementation 'com.android.support.test:runner:1.0.2-alpha1'
  testImplementation 'com.android.support.test:rules:1.0.2-alpha1'

  implementation('host.exp.exponent:expoview:32.0.0@aar') {
    transitive = true
    exclude group: 'com.squareup.okhttp3', module: 'okhttp'
    exclude group: 'com.squareup.okhttp3', module: 'okhttp-urlconnection'
  }

  api 'com.facebook.react:react-native:32.0.0'
  api 'host.exp.exponent:expo-app-loader-provider:1.0.0'
  api 'host.exp.exponent:expo-core:2.0.0'
  api 'host.exp.exponent:expo-constants-interface:2.0.0'
  api 'host.exp.exponent:expo-constants:2.0.1'
  api 'host.exp.exponent:expo-errors:1.0.0'
  api 'host.exp.exponent:expo-file-system-interface:2.0.0'
  api 'host.exp.exponent:expo-file-system:2.0.0'
  api 'host.exp.exponent:expo-image-loader-interface:2.0.0'
  api 'host.exp.exponent:expo-permissions:2.0.0'
  api 'host.exp.exponent:expo-permissions-interface:2.0.0'
  api 'host.exp.exponent:expo-sensors-interface:2.0.0'
  api 'host.exp.exponent:expo-react-native-adapter:2.0.0'
  api 'host.exp.exponent:expo-task-manager:1.0.0'
  api 'host.exp.exponent:expo-task-manager-interface:1.0.0'

  // Optional universal modules, could be removed
  // along with references in MainActivity
  api 'host.exp.exponent:expo-ads-admob:2.0.0'
  api 'host.exp.exponent:expo-app-auth:2.0.0'
  api 'host.exp.exponent:expo-analytics-segment:2.0.0'
  api 'host.exp.exponent:expo-barcode-scanner-interface:2.0.0'
  api 'host.exp.exponent:expo-barcode-scanner:2.0.0'
  api 'host.exp.exponent:expo-camera-interface:2.0.0'
  api 'host.exp.exponent:expo-camera:2.0.0'
  api 'host.exp.exponent:expo-contacts:2.0.0'
  api 'host.exp.exponent:expo-face-detector:2.0.0'
  api 'host.exp.exponent:expo-face-detector-interface:2.0.0'
  api 'host.exp.exponent:expo-font:2.0.0'
  api 'host.exp.exponent:expo-gl-cpp:2.0.0'
  api 'host.exp.exponent:expo-gl:2.0.0'
  api 'host.exp.exponent:expo-google-sign-in:2.0.0'
  api 'host.exp.exponent:expo-local-authentication:2.0.0'
  api 'host.exp.exponent:expo-localization:2.0.0'
  api 'host.exp.exponent:expo-location:2.0.1'
  api 'host.exp.exponent:expo-media-library:2.0.0'
  api 'host.exp.exponent:expo-print:2.0.0'
  api 'host.exp.exponent:expo-sensors:2.0.0'
  api 'host.exp.exponent:expo-sms:2.0.0'
  api 'host.exp.exponent:expo-background-fetch:1.0.0'

  // My stuff:
  // Firebase dependencies
  implementation "com.google.android.gms:play-services-base:16.0.1"
  implementation "com.google.firebase:firebase-core:16.0.6"

}

// This has to be down here for some reason
apply plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true

android/settings.gradle:

include ':app'
include ':react-native-firebase'
project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android')

MainApplication.java:

package host.exp.exponent;

import com.facebook.react.ReactPackage;

import java.util.Arrays;
import java.util.List;

import expo.core.interfaces.Package;
import expo.loaders.provider.interfaces.AppLoaderPackagesProviderInterface;
import expo.modules.ads.admob.AdMobPackage;
import expo.modules.analytics.segment.SegmentPackage;
import expo.modules.appauth.AppAuthPackage;
import expo.modules.backgroundfetch.BackgroundFetchPackage;
import expo.modules.barcodescanner.BarCodeScannerPackage;
import expo.modules.camera.CameraPackage;
import expo.modules.constants.ConstantsPackage;
import expo.modules.contacts.ContactsPackage;
import expo.modules.facedetector.FaceDetectorPackage;
import expo.modules.filesystem.FileSystemPackage;
import expo.modules.font.FontLoaderPackage;
import expo.modules.gl.GLPackage;
import expo.modules.google.signin.GoogleSignInPackage;
import expo.modules.localauthentication.LocalAuthenticationPackage;
import expo.modules.localization.LocalizationPackage;
import expo.modules.location.LocationPackage;
import expo.modules.medialibrary.MediaLibraryPackage;
import expo.modules.permissions.PermissionsPackage;
import expo.modules.print.PrintPackage;
import expo.modules.sensors.SensorsPackage;
import expo.modules.sms.SMSPackage;
import expo.modules.taskManager.TaskManagerPackage;
import expolib_v1.okhttp3.OkHttpClient;

// Needed for `react-native link`
// import com.facebook.react.ReactApplication;
import io.invertase.firebase.RNFirebasePackage;

public class MainApplication extends ExpoApplication implements AppLoaderPackagesProviderInterface<ReactPackage> {

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

  // Needed for `react-native link`
  public List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
        // Add your own packages here!
        // TODO: add native modules!

        // Needed for `react-native link`
        // new MainReactPackage(),
            new RNFirebasePackage()
    );
  }

  public List<Package> getExpoPackages() {
    return Arrays.<Package>asList(
        new CameraPackage(),
        new ConstantsPackage(),
        new SensorsPackage(),
        new FileSystemPackage(),
        new FaceDetectorPackage(),
        new GLPackage(),
        new GoogleSignInPackage(),
        new PermissionsPackage(),
        new SMSPackage(),
        new PrintPackage(),
        new ConstantsPackage(),
        new MediaLibraryPackage(),
        new SegmentPackage(),
        new FontLoaderPackage(),
        new LocationPackage(),
        new ContactsPackage(),
        new BarCodeScannerPackage(),
        new AdMobPackage(),
        new LocalAuthenticationPackage(),
        new LocalizationPackage(),
        new AppAuthPackage(),
        new TaskManagerPackage(),
        new BackgroundFetchPackage()
    );
  }

  @Override
  public String gcmSenderId() {
    return getString(R.string.gcm_defaultSenderId);
  }

  @Override
  public boolean shouldUseInternetKernel() {
    return BuildVariantConstants.USE_INTERNET_KERNEL;
  }

  public static OkHttpClient.Builder okHttpClientBuilder(OkHttpClient.Builder builder) {
    // Customize/override OkHttp client here
    return builder;
  }
}

AndroidManifest.xml:

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

  <permission
    android:name="com.ninabeste.myditation.permission.C2D_MESSAGE"
    android:protectionLevel="signature"/>

  <!-- These are required permissions to make the app run -->
  <uses-permission android:name="com.ninabeste.myditation.permission.C2D_MESSAGE" />
  <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
  <uses-permission android:name="android.permission.WAKE_LOCK" />

  <!-- ADD PERMISSIONS HERE -->
  <!-- BEGIN OPTIONAL PERMISSIONS -->
  <uses-permission android:name="android.permission.MANAGE_DOCUMENTS" />
  <uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.READ_PHONE_STATE" />
  <uses-permission android:name="android.permission.USE_FINGERPRINT" />
  <uses-permission android:name="android.permission.VIBRATE" />
  <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
  <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

  <!-- These require runtime permissions on M -->
  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
  <uses-permission android:name="android.permission.CAMERA" />
  <uses-permission android:name="android.permission.READ_CONTACTS" />
  <uses-permission android:name="android.permission.READ_CALENDAR" />
  <uses-permission android:name="android.permission.WRITE_CALENDAR" />
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.RECORD_AUDIO" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.WRITE_SETTINGS" />
  <!-- END OPTIONAL PERMISSIONS -->

  <!-- ADD TEST PERMISSIONS HERE -->

  <uses-feature android:glEsVersion="0x00020000" android:required="false" />
  <uses-feature android:name="android.software.leanback" android:required="false" />
  <uses-feature android:name="android.hardware.touchscreen" android:required="false" />

  <application
    android:name=".MainApplication"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:largeHeap="true">

    <activity
      android:name=".LauncherActivity"
      android:exported="true"
      android:launchMode="singleTask"
      android:screenOrientation="portrait"
      android:theme="@android:style/Theme.Translucent.NoTitleBar">
    </activity>

    <activity
      android:name=".experience.ExperienceActivity"
      android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
      android:theme="@style/Theme.Exponent.Light"
      android:windowSoftInputMode="adjustResize">
    </activity>

    <activity
      android:name=".MainActivity"
      android:launchMode="singleTask"
      android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
      android:theme="@style/Theme.Exponent.Splash"
      android:windowSoftInputMode="adjustResize">
      <intent-filter>
        <data android:scheme="exp49f0c9b5263a4dc3baff52d1030fddf3"/>

        <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.MAIN"/>

        <category android:name="android.intent.category.LAUNCHER"/>
      </intent-filter>
      <!-- ADD DETACH APP SPECIFIC INTENT FILTERS -->
    </activity>

    <activity
      android:name=".experience.HomeActivity"
      android:label="@string/app_name"
      android:launchMode="singleTask"
      android:screenOrientation="portrait"
      android:theme="@style/Theme.Exponent.Light">
    </activity>

    <activity
      android:name=".experience.TvActivity"
      android:label="@string/app_name"
      android:theme="@style/Theme.Exponent.Light"
      android:screenOrientation="landscape">
     <intent-filter>
       <action android:name="android.intent.action.MAIN" />
       <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
     </intent-filter>
   </activity>

    <activity android:name="com.facebook.react.devsupport.DevSettingsActivity"/>
    <!-- WHEN_PREPARING_SHELL_REMOVE_FROM_HERE -->
    <!-- ADD DEV SETTINGS HERE -->
    <activity android:name="abi32_0_0.com.facebook.react.devsupport.DevSettingsActivity"/>
    <!-- BEGIN_SDK_31 -->
    <activity android:name="abi31_0_0.com.facebook.react.devsupport.DevSettingsActivity"/>
    <!-- END_SDK_31 -->
    <!-- BEGIN_SDK_30 -->
    <activity android:name="abi30_0_0.com.facebook.react.devsupport.DevSettingsActivity"/>
    <!-- END_SDK_30 -->
    <!-- BEGIN_SDK_29 -->
    <activity android:name="abi29_0_0.com.facebook.react.devsupport.DevSettingsActivity"/>
    <!-- END_SDK_29 -->
    <!-- BEGIN_SDK_28 -->
    <activity android:name="abi28_0_0.com.facebook.react.devsupport.DevSettingsActivity"/>
    <!-- END_SDK_28 -->
    <!-- BEGIN_SDK_27 -->
    <activity android:name="abi27_0_0.com.facebook.react.devsupport.DevSettingsActivity"/>
    <!-- END_SDK_27 -->
    <!-- BEGIN_SDK_26 -->
    <activity android:name="abi26_0_0.com.facebook.react.devsupport.DevSettingsActivity"/>
    <!-- END_SDK_26 -->
    <!-- WHEN_PREPARING_SHELL_REMOVE_TO_HERE -->

    <activity
      android:name=".ExponentDevActivity"
      android:exported="true"
      android:label="@string/dev_activity_name"
      android:screenOrientation="portrait"
      android:theme="@style/Theme.Exponent.Dark"
      android:windowSoftInputMode="adjustPan">
    </activity>

    <activity
      android:name=".oauth.OAuthWebViewActivity"
      android:screenOrientation="portrait"
      android:theme="@style/Theme.Exponent.Light">
    </activity>

    <activity
        android:name="net.openid.appauth.RedirectUriReceiverActivity"
        tools:node="replace">
      <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:scheme="com.ninabeste.myditation" android:path="oauthredirect"/>
      </intent-filter>
    </activity>

    <activity
      android:name=".oauth.OAuthResultActivity">
    </activity>

    <activity
      android:name="abi32_0_0.expo.modules.appauth.AppAuthBrowserActivity">
    </activity>

    <!-- START OF STRIPE SCHEMES -->
    <activity
        android:exported="true"
        android:launchMode="singleTask"
        android:name="expo.modules.payments.stripe.RedirectUriReceiver"
        android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">
        <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:scheme="expo.modules.payments.stripe.912fa399-d572-488f-983b-ad871860d195" />
        </intent-filter>
    </activity>
    <!-- Versioned Activity for Stripe -->
    <activity
        android:exported="true"
        android:launchMode="singleTask"
        android:name="abi31_0_0.expo.modules.payments.stripe.RedirectUriReceiver"
        android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">
        <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:scheme="abi31_0_0.expo.modules.payments.stripe" />
        </intent-filter>
    </activity>

    <!-- END OF STRIPE SCHEMES -->

    <activity
      android:name=".chrometabs.ChromeTabsManagerActivity">
    </activity>

    <activity
      android:name=".experience.ErrorActivity"
      android:theme="@style/Theme.Exponent.Dark"
      android:screenOrientation="portrait">
    </activity>

    <activity
      android:name=".experience.InfoActivity"
      android:screenOrientation="portrait"
      android:theme="@style/Theme.Exponent.Light">
    </activity>

    <activity
      android:name="com.facebook.FacebookActivity"
      android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
      android:label="@string/app_name"
      android:theme="@android:style/Theme.Translucent.NoTitleBar"
      tools:replace="android:theme" />

    <activity
      android:name="com.facebook.ads.InterstitialAdActivity"
      android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
      android:label="@string/app_name"
      android:theme="@android:style/Theme.Translucent.NoTitleBar" />

    <service
      android:name=".ExponentIntentService"
      android:exported="false" />

    <!-- Analytics -->
    <receiver
      android:name="host.exp.exponent.referrer.InstallReferrerReceiver"
      android:exported="true">
      <intent-filter>
        <action android:name="com.android.vending.INSTALL_REFERRER" />
      </intent-filter>
    </receiver>

    <!--
    This crashes: https://code.google.com/p/analytics-issues/issues/detail?id=667
    TODO: turn it back on when it's fixed
    <service
      android:name="com.google.android.gms.analytics.CampaignTrackingService"
      android:enabled="true"
      android:exported="false" />-->

    <receiver android:name="com.google.android.gms.analytics.AnalyticsReceiver"
              android:enabled="true">
      <intent-filter>
        <action android:name="com.google.android.gms.analytics.ANALYTICS_DISPATCH" />
      </intent-filter>
    </receiver>

    <service android:name="com.google.android.gms.analytics.AnalyticsService"
             android:enabled="true"
             android:exported="false"/>

    <!-- GCM -->
    <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"/>
        <action android:name="com.google.android.c2dm.intent.REGISTRATION"/>

        <category android:name="com.ninabeste.myditation"/>
      </intent-filter>
    </receiver>

    <service
      android:name=".gcm.ExponentGcmListenerService"
      android:exported="false">
      <intent-filter>
        <action android:name="com.google.android.c2dm.intent.RECEIVE"/>
      </intent-filter>
    </service>
    <service
      android:name=".gcm.ExponentInstanceIDListenerService"
      android:exported="false">
      <intent-filter>
        <action android:name="com.google.android.gms.iid.InstanceID"/>
      </intent-filter>
    </service>
    <service
      android:name=".gcm.GcmRegistrationIntentService"
      android:exported="false">
    </service>

    <!-- FCM -->
    <service
      android:name=".fcm.ExpoFcmMessagingService">
      <intent-filter>
        <action android:name="com.google.firebase.MESSAGING_EVENT"/>
      </intent-filter>
    </service>
    <meta-data
      android:name="com.google.firebase.messaging.default_notification_icon"
      android:resource="@drawable/shell_notification_icon" />
    <meta-data
      android:name="com.google.firebase.messaging.default_notification_color"
      android:resource="@color/colorAccent" />
    <service
      android:name=".fcm.FcmRegistrationIntentService"
      android:exported="false">
    </service>

    <!-- ImagePicker native module -->
    <activity
      android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
      android:theme="@style/Base.Theme.AppCompat">
    </activity>

    <!-- ADD FABRIC CONFIG HERE -->
    <!-- BEGIN FABRIC CONFIG -->
    <meta-data
      android:name="io.fabric.ApiKey"
      android:value="a25fafe9f9edee11a9882b32e0cd7a26df6e2c42"/>
    <!-- END FABRIC CONFIG -->

    <!-- ADD GOOGLE MAPS CONFIG HERE -->
    <!-- BEGIN GOOGLE MAPS CONFIG -->
    <meta-data
      android:name="com.google.android.geo.API_KEY"
      android:value="AIzaSyCPyKmt6in3JwAsogYikNNjor8qgU9stRQ"/>
    <!-- END GOOGLE MAPS CONFIG -->

    <!-- ADD BRANCH CONFIG HERE -->

    <!-- The Facebook SDK runs FacebookInitProvider on startup and crashes if there isn't an ID here -->
    <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="fb0"/>

    <meta-data android:name="standaloneStripeScheme" android:value="912fa399-d572-488f-983b-ad871860d195" />
  </application>

</manifest>

Environment


Think react-native-firebase is great? Please consider supporting the project with any of the below:

mikehardy commented 5 years ago

native code projects on react-native have all moved to this style to manage dependencies, it is aimed precisely at the dependency tangle you seem to be in

https://github.com/invertase/react-native-firebase-starter/blob/master/android/build.gradle#L3

I encourage you to look very closely at the starter project I linked above, get it working, then carefully move pieces in to your app one by one

redpandatronicsuk commented 5 years ago

@mikehardy Thanks, I'll give that a try

awslattery commented 5 years ago

@redpandatronicsuk after ejecting at SDK 32, and moving to using RNF, I had to update com.google.android.gms:play-services-analytics to 16.0.6 to resolve that same issue, after it was confirmed that Expo was dropping the expo-firebase endeavor for the time being.

hotaryuzaki commented 5 years ago

@redpandatronicsuk after ejecting at SDK 32, and moving to using RNF, I had to update com.google.android.gms:play-services-analytics to 16.0.6 to resolve that same issue, after it was confirmed that Expo was dropping the expo-firebase endeavor for the time being.

can you share your setup for your ejected app to using RN Firebase please?? i have this problem almost for a week.

harisvsulaiman commented 5 years ago

@hotaryuzaki this works for me 👇

implementation project(path: ':react-native-firebase', configuration: 'default')
  // Required dependencies
  //noinspection GradleCompatible
  compileOnly "com.google.android.gms:play-services-base:15.0.1"
  api "com.google.firebase:firebase-core:16.0.1"

  // Authentication
  api "com.google.firebase:firebase-auth:16.0.4"

  api "com.google.firebase:firebase-functions:16.1.2"

  // Cloud Firestore
  api "com.google.firebase:firebase-firestore:17.1.2"

  // Cloud Messaging / FCM
  api "com.google.firebase:firebase-messaging:17.3.3"

  api "com.google.firebase:firebase-invites:16.0.1"

  api 'com.google.firebase:firebase-inappmessaging-display:17.0.1'
}