Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Crashlytics: define crashlytics_debug_enabled in Expo managed app #7459

Unanswered
lucasbasquerotto asked this question in Q&A
Discussion options

I have an Expo managed app and was able to make Crashlytics work adding the plugins in app.config.js:

plugins: [
 '@react-native-firebase/app',
 '@react-native-firebase/crashlytics',
]

It worked in an EAS preview build (optimized for production but with development credentials and endpoints, without hot reload), but in an Expo EAS build with developmentClient: true (development build, with hot reload), it doesn't work.

Looking at the docs I saw that defining crashlytics_debug_enabled: true makes it work when in debug mode, but it didn't work in my app. My guess is that firebase.json can not be used in Expo managed apps.

Is that it? If it is, is there a way to define crashlytics_debug_enabled in an Expo managed app? For example:

plugins: [
 '@react-native-firebase/app',
 [
 '@react-native-firebase/crashlytics',
 {
 crashlytics_debug_enabled: true
 }
 ]
]

I saw no plugin configuration options in the docs, there's only the following note:

If you're using Expo, make sure to add the @react-native-firebase/crashlytics config plugin to your app.json or app.config.js. It handles the Android installation steps for you. For instructions on how to do that, view the Expo installation section.

You must be logged in to vote

Replies: 1 comment 3 replies

Comment options

I was under the impression that firebase.json works in expo managed apps

You don't indicate what platform, but I can say that for iOS firebase.json is parsed into Info.plist settings so it is available to the app during cocoapods pod install command so you may need to run (or re-run) certain expo build commands for that to happen. Until that's done firebase.json will have the settings you think you want but your app will have old settings, leading to confusion

For Android it happens during gradle build so works in a more expected way

You must be logged in to vote
3 replies
Comment options

For Expo, my IOS app crashed after these changes.

project_root/firebase.json

{
 "react-native": {
 "crashlytics_debug_enabled": true
 }
}

App.tsx

useEffect(() => {
 const timeout = setTimeout(() => {
 firebase.crashlytics().crash();
 }, 5000);
 return () => clearTimeout(timeout);
 }, []);

Terminal Commands

npx expo prebuild --platform ios --clean
npx expo run:ios
Comment options

That happened in Android, I haven't tested for iOS. The firebase.json file is in the same (root) directory as the expo app.config.js. Generating a new EAS development build (debug and hot reload mode) didn't make crashlytics work.

Comment options

const timeout = setTimeout(() => {
firebase.crashlytics().crash();
}, 5000);
return () => clearTimeout(timeout);

Did you figure out something? I haven't found any workthrough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

AltStyle によって変換されたページ (->オリジナル) /