Ran to it after upgrading the package to 5.2.1
Completed the upgrade steps and ran react-native run-android
Here's the stack trace
error: bundling failed: Error: Unable to resolve module `../crash` from `./ReactNative/Workspace/ProjectName/node_modules/react-native-firebase/dist/modules/core/firebase.js`: The module `../crash` could not be found from `./ReactNative/Workspace/ProjectName/node_modules/react-native-firebase/dist/modules/core/firebase.js`. Indeed, none of these files exist:
* `./ReactNative/Workspace/ProjectName/node_modules/react-native-firebase/dist/modules/crash(.native||.android.js|.native.js|.js|.android.json|.native.json|.json)`
* `./ReactNative/Workspace/ProjectName/node_modules/react-native-firebase/dist/modules/crash/index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json)`
at ModuleResolver.resolveDependency (./ReactNative/Workspace/ProjectName/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:167:697)
at ResolutionRequest.resolveDependency (./ReactNative/Workspace/ProjectName/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:80:16)
at DependencyGraph.resolveDependency (./ReactNative/Workspace/ProjectName/node_modules/metro/src/node-haste/DependencyGraph.js:237:485)
at Object.resolve (./ReactNative/Workspace/ProjectName/node_modules/metro/src/lib/transformHelpers.js:116:25)
at dependencies.map.result (./ReactNative/Workspace/ProjectName/node_modules/metro/src/DeltaBundler/traverseDependencies.js:298:29)
at Array.map (<anonymous>)
at resolveDependencies (./ReactNative/Workspace/ProjectName/node_modules/metro/src/DeltaBundler/traverseDependencies.js:294:16)
at ./ReactNative/Workspace/ProjectName/node_modules/metro/src/DeltaBundler/traverseDependencies.js:159:33
at Generator.next (<anonymous>)
at step (./ReactNative/Workspace/ProjectName/node_modules/metro/src/DeltaBundler/traverseDependencies.js:239:307)
ios/Podfile:# N/A
AppDelegate.m:// N/A
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://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:3.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
google()
maven {
url "https://jitpack.io"
}
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/'
}
jcenter()
}
}
subprojects {
afterEvaluate {
project -> if (project.hasProperty("android")) {
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
}
}
}
}
ext {
buildToolsVersion = "27.0.3"
minSdkVersion = 18
compileSdkVersion = 27
targetSdkVersion = 27
supportLibVersion = "27.0.1"
googlePlayServicesVersion = "16.+"
googleFirebaseMessagingVersion = "17.+"
googlePlayServicesAuthVersion = "15.0.1"
androidMapsUtilsVersion = "0.5+"
}
android/app/build.gradle:apply plugin: "com.android.application"
import com.android.build.OutputFile
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
* and their defaults. If you decide to add a configuration block, make sure to add it before the
* `apply from: "../../node_modules/react-native/react.gradle"` line.
*
* project.ext.react = [
* // the name of the generated asset file containing your JS bundle
* bundleAssetName: "index.android.bundle",
*
* // the entry file for bundle generation
* entryFile: "index.android.js",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
* // whether to bundle JS and assets in release mode
* bundleInRelease: true,
*
* // whether to bundle JS and assets in another build variant (if configured).
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
* // The configuration property can be in the following formats
* // 'bundleIn${productFlavor}${buildType}'
* // 'bundleIn${buildType}'
* // bundleInFreeDebug: true,
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
* // where to put the JS bundle asset in debug mode
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
*
* // where to put the JS bundle asset in release mode
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in debug mode
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in release mode
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
*
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/
project.ext.react = [
entryFile: "index.js"
]
apply from: "../../node_modules/react-native/react.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
signingConfigs {
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
}
defaultConfig {
applicationId "xxxxxxxxxxxxxxxxx"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 16
versionName "1.0.2"
ndk {
abiFilters "armeabi-v7a", "x86"
}
multiDexEnabled true
}
dexOptions {
javaMaxHeapSize "4g"
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
multiDexKeepProguard file('proguard-rules.pro')
}
}
// 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]
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
}
}
}
configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.google.android.gms'
&& !details.requested.name.contains('multidex')) {
details.useVersion "16.+"
}
}
}
}
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
// These docs use an open ended version so that our plugin
// can be updated quickly in response to Android tooling updates
// We recommend changing it to the latest version from our changelog:
// https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
implementation (project(':react-native-fast-image')){
exclude group: "com.android.support"
}
implementation project(':react-native-snackbar')
implementation project(':react-native-linear-gradient')
implementation project(':react-native-splash-screen')
implementation project(':react-native-vector-icons')
implementation project(':react-native-fbsdk')
implementation project(':react-native-firebase')
implementation project(':react-native-geocoder')
implementation project(':react-native-maps')
implementation project(':react-native-google-places')
implementation(project(":react-native-google-signin")) {
exclude group: "com.google.android.gms"
}
implementation project(':react-native-localization')
implementation project(':react-native-spinkit')
implementation project(':react-native-video')
implementation project(':react-native-iap')
implementation "com.google.android.gms:play-services-base:${rootProject.ext.googlePlayServicesVersion}"
implementation "com.google.android.gms:play-services-places:${rootProject.ext.googlePlayServicesVersion}"
implementation "com.google.android.gms:play-services-location:${rootProject.ext.googlePlayServicesVersion}"
implementation "com.google.android.gms:play-services-maps:${rootProject.ext.googlePlayServicesVersion}"
implementation "com.google.android.gms:play-services-auth:${rootProject.ext.googlePlayServicesVersion}"
implementation "com.google.firebase:firebase-core:${rootProject.ext.googlePlayServicesVersion}"
implementation "com.google.firebase:firebase-auth:${rootProject.ext.googlePlayServicesVersion}"
implementation "com.google.firebase:firebase-database:${rootProject.ext.googlePlayServicesVersion}"
implementation "com.google.firebase:firebase-messaging:${rootProject.ext.googleFirebaseMessagingVersion}"
implementation "com.android.support:multidex:1.0.3"
implementation "io.nlopez.smartlocation:library:3.3.3"
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
implementation('com.crashlytics.sdk.android:crashlytics:2.9.5@aar') {
transitive = true
}
}
// 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'
android/settings.gradle:rootProject.name = 'EifoParking'
include ':react-native-snackbar'
project(':react-native-snackbar').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-snackbar/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-splash-screen'
project(':react-native-splash-screen').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-splash-screen/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-fbsdk'
project(':react-native-fbsdk').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fbsdk/android')
include ':react-native-firebase'
project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android')
include ':react-native-google-signin', ':app'
project(':react-native-google-signin').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-google-signin/android')
include ':react-native-geocoder', ':app'
project(':react-native-geocoder').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-geocoder/android')
include ':react-native-google-places'
project(':react-native-google-places').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-google-places/android')
include ':react-native-maps'
project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android')
include ':react-native-localization', ':app'
project(':react-native-localization').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-localization/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-iap'
project(':react-native-iap').projectDir = new File(rootProject.projectDir, '../src/ThiredParty/react-native-iap/android')
include ':react-native-fast-image'
project(':react-native-fast-image').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fast-image/android')
include ':app'
MainApplication.java:import android.app.Application;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import io.invertase.firebase.RNFirebasePackage;
import io.invertase.firebase.auth.RNFirebaseAuthPackage;
import io.invertase.firebase.database.RNFirebaseDatabasePackage;
import io.invertase.firebase.messaging.RNFirebaseMessagingPackage;
import io.invertase.firebase.notifications.RNFirebaseNotificationsPackage;
import com.dooboolab.RNIap.RNIapPackage;
import co.apptailor.googlesignin.RNGoogleSigninPackage;
import com.devfd.RNGeocoder.RNGeocoderPackage;
import com.airbnb.android.react.maps.MapsPackage;
import com.arttitude360.reactnative.rngoogleplaces.RNGooglePlacesPackage;
import com.facebook.reactnative.androidsdk.FBSDKPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import org.devio.rn.splashscreen.SplashScreenReactPackage;
import com.BV.LinearGradient.LinearGradientPackage;
import com.azendoo.reactnativesnackbar.SnackbarPackage;
import com.babisoft.ReactNativeLocalization.ReactNativeLocalizationPackage;
import com.react.rnspinkit.RNSpinkitPackage;
import com.brentvatne.react.ReactVideoPackage;
import com.dylanvann.fastimage.FastImageViewPackage;
import com.eifo.wmt.android.OpenSettingPackage.OpenSettingsPackage;
import com.eifo.wmt.android.LocationModule.LocationModulePackage;
import com.facebook.CallbackManager;
import com.facebook.FacebookSdk;
import com.facebook.reactnative.androidsdk.FBSDKPackage;
import com.crashlytics.android.Crashlytics;
import com.crashlytics.android.core.CrashlyticsCore;
import io.fabric.sdk.android.Fabric;
import java.util.Arrays;
import java.util.List;
public class MainApplication extends android.support.multidex.MultiDexApplication implements ReactApplication {
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 FBSDKPackage(mCallbackManager),
new RNGoogleSigninPackage(),
new RNFirebasePackage(),
new RNFirebaseAuthPackage(),
new RNFirebaseDatabasePackage(),
new RNFirebaseMessagingPackage(),
new RNFirebaseNotificationsPackage(),
new RNGeocoderPackage(),
new MapsPackage(),
new VectorIconsPackage(),
new RNGooglePlacesPackage(),
new SplashScreenReactPackage(),
new LinearGradientPackage(),
new SnackbarPackage(),
new ReactNativeLocalizationPackage(),
new RNSpinkitPackage(),
new ReactVideoPackage(),
new OpenSettingsPackage(),
new LocationModulePackage(),
new RNIapPackage(),
new FastImageViewPackage()
);
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
private static CallbackManager mCallbackManager = CallbackManager.Factory.create();
protected static CallbackManager getCallbackManager() {
return mCallbackManager;
}
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
// Initializes Fabric for builds that don't use the debug build type.
Crashlytics crashlyticsKit = new Crashlytics.Builder()
.core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build())
.build();
Fabric.with(this, crashlyticsKit);
}
}
AndroidManifest.xml:<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="xxxxxxxxxxxxxxxxxxx">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/>
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:allowBackup="true"
android:theme="@style/AppTheme">
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_notification" />
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_api_key"
/>
<meta-data android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id"
/>
<meta-data
android:name="io.fabric.ApiKey"
android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
/>
<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.RNFirebaseInstanceIdService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>-->
<service android:name="io.invertase.firebase.messaging.RNFirebaseBackgroundMessagingService" />
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|layoutDirection|locale"
android:windowSoftInputMode="adjustPan"
android:exported="true"
android:screenOrientation="portrait"
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity"/>
</application>
</manifest>
Android API 25 e.g. iOS 10 or Android API 28N/AN/AUbuntu 18.04ADD_SOMETHING_HERE e.g. Xcode 10, Android Studio 3.2React Native version:0.56.0React Native Firebase library version:5.2.1Firebase module(s) you're using that has the issue:TypeScript?N/AExpoKit?ExpoKitN/A
Think react-native-firebase is great? Please consider supporting the project with any of the below:
React Native Firebase and Invertase on Twitter@nishantWM Did you try to clean the build files? I did it and it works for me (the path for crashlytics is changed.)
Also I removed the reference in the Xcode from the Libraries and add it again and linked again at Build Phases.
Hey,
@golya is correct; crash reporting was removed in v5 (as crashlytics is now the replacement) so this is definitely a local build cache issue, try run your packager with --reset-cache and this should solve the issue.
Thanks
Loving react-native-firebase and the support we provide? Please consider supporting us with any of the below:
React Native Firebase and Invertase on Twitter Yes, I did try resetting the cache, deleting node modules, reinstalling packages and rerunning the packager. The issue still remained.
I had not linked the RNFirebaseCrashlyticsPackage because I'm not using it. The issue resolved after I added linked the package in MainApplication.java
Anyway, it is resolved. Thanks.
I got the same problem after upgrading react-native to 0.59 and react-native-firebase to 5.4.3, but none of above answer helped.
@oskfelin after trying a clean reproduction outside your app, if this still happens please open a new issue following the template fully please - there are lots of ways to install react-native-firebase, but following the recommended path from the docs (in the way https://github.com/mikehardy/rnfbdemo does) results in a build that does work. So we don't think the module has a problem with this right now
Most helpful comment
Hey,
@golya is correct; crash reporting was removed in v5 (as crashlytics is now the replacement) so this is definitely a local build cache issue, try run your packager with
--reset-cacheand this should solve the issue.Thanks
Loving
react-native-firebaseand the support we provide? Please consider supporting us with any of the below:React Native FirebaseandInvertaseon Twitter