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

fix(crashlytics): Expo SDK 44 compatibility #5947

Merged
merged 1 commit into from
Dec 18, 2021
Merged

fix(crashlytics): Expo SDK 44 compatibility #5947

merged 1 commit into from
Dec 18, 2021

Conversation

Yonom
Copy link
Contributor

@Yonom Yonom commented Dec 18, 2021

Description

Using crashlytics in a Expo SDK 44 (latest version) project fails. This is because expo patches the react podspec for swift compatibility reasons (expo/expo#15299) and that causes old style imports to not work.

I fixed the issue by changing the import style.

More information: expo/expo#15622 (comment)

› Compiling @react-native-firebase/crashlytics Pods/RNFBCrashlytics » RNFBCrashlyticsModule.m

❌  (/Users/yonom/Documents/GitHub/app/node_modules/@react-native-firebase/crashlytics/ios/RNFBCrashlytics/RNFBCrashlyticsModule.m:40:10)

  38 |   NSMutableDictionary *constants = [NSMutableDictionary new];
  39 |   constants[@"isCrashlyticsCollectionEnabled"] =
> 40 |       @([RCTConvert BOOL:@([RNFBCrashlyticsInitProvider isCrashlyticsCollectionEnabled])]);
     |          ^ declaration of 'RCTConvert' must be imported from module 'React.RCTConvert' before it is required
  41 |   constants[@"isErrorGenerationOnJSCrashEnabled"] =
  42 |       @([RCTConvert BOOL:@([RNFBCrashlyticsInitProvider isErrorGenerationOnJSCrashEnabled])]);
  43 |   constants[@"isCrashlyticsJavascriptExceptionHandlerChainingEnabled"] =

Related issues

Release Summary

fix(crashlytics): Expo SDK 44 compatibility

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
  • My change includes tests;
    • e2e tests added or updated in packages/\*\*/e2e
    • jest tests added or updated in packages/\*\*/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan

Tested by adding crashlytics to a brand new expo sdk 44 project and compiling the app using expo run:ios


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

@vercel
Copy link

vercel bot commented Dec 18, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

react-native-firebase – ./

🔍 Inspect: https://vercel.com/invertase/react-native-firebase/ANGdEpY2vMM2ESKtV12vv8agbkMz
✅ Preview: https://react-native-firebase-git-fork-yonom-fix-expo-sdk-44-invertase.vercel.app

react-native-firebase-next – ./website_modular

🔍 Inspect: https://vercel.com/invertase/react-native-firebase-next/Bs2fYLAXjVCsy5XTnHTE41xZLreX
✅ Preview: Canceled

[Deployment for 504b758 canceled]

@codecov
Copy link

codecov bot commented Dec 18, 2021

Codecov Report

Merging #5947 (33e9442) into main (a5a8270) will not change coverage.
The diff coverage is n/a.

❗ Current head 33e9442 differs from pull request most recent head 504b758. Consider uploading reports for the commit 504b758 to get more accurate results

@@            Coverage Diff            @@
##               main    #5947   +/-   ##
=========================================
  Coverage     53.04%   53.04%           
  Complexity      622      622           
=========================================
  Files           208      208           
  Lines         10171    10171           
  Branches       1618     1618           
=========================================
  Hits           5394     5394           
  Misses         4523     4523           
  Partials        254      254           

@Yonom Yonom changed the title Fix Expo SDK 44 compatibility fix(crashlytics): Expo SDK 44 compatibility Dec 18, 2021
@vercel vercel bot temporarily deployed to Preview – react-native-firebase-next December 18, 2021 06:40 Inactive
Copy link
Collaborator

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting! Looks obviously correct, following the other react imports, and CI will be a clear signal for it. Thanks @Yonom !

@mikehardy
Copy link
Collaborator

Storage.getDownkoadUrl is our last serious flaky test in iOS. Unrelated to this PR if course. Rerun in progress

@mikehardy mikehardy added the Workflow: Pending Merge Waiting on CI or similar label Dec 18, 2021
@Yonom
Copy link
Contributor Author

Yonom commented Dec 18, 2021

Awesome, thank you for the quick review

I can definitely tell that the CI is less flaky now

fyi, on a previous attempt, the Android e2e test also failed on this PR: https://github.com/invertase/react-native-firebase/runs/4568217848?check_suite_focus=true

@mikehardy mikehardy merged commit e45f37c into invertase:main Dec 18, 2021
@mikehardy mikehardy removed the Workflow: Pending Merge Waiting on CI or similar label Dec 18, 2021
@Yonom Yonom deleted the fix-expo-sdk-44 branch December 18, 2021 13:54
@mikehardy
Copy link
Collaborator

Yes, I slowly catalog and squish CI flakiness, and it slowly creeps back in. Now that the disastrous iOS+Detox+firebase-performance crash is fixed iOS has a storage downloadURL issue, both occasionally have an auth beforeAll issue and there are a couple less frequent ones. Bit by bit - I was completely absorbed with the Detox fix from a flakiness perspective so the others sat. I'll get them all eventually :-) #4058

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants