-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Crashlytics: define crashlytics_debug_enabled in Expo managed app #7459
-
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/crashlyticsconfig plugin to yourapp.jsonorapp.config.js. It handles the Android installation steps for you. For instructions on how to do that, view the Expo installation section.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 3 replies
-
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
Beta Was this translation helpful? Give feedback.
All reactions
-
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
Beta Was this translation helpful? Give feedback.
All reactions
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
-
const timeout = setTimeout(() => {
firebase.crashlytics().crash();
}, 5000);
return () => clearTimeout(timeout);
Did you figure out something? I haven't found any workthrough
Beta Was this translation helpful? Give feedback.