Upgrading to expo@44.0.0 breaks iOS build of amazon-cognito-identity-js
Problem
Summary I use `amazon-cognito-identity-js@5.1.0` in my project as well as `expo`. I tried upgrading to `expo@44.0.0`, but the iOS build then fails with a lot of errors, e.g: [code block]` Build log is attached: expo-44-build-error.txt This build error does not occur with `expo@43.0.3` Managed or bare workflow? If you have `ios/` or `android/` directories in your project, the answer is bare! bare What platform(s) does this occur on? iOS SDK Version (managed workflow only) _No response_ Environment [code block]` Reproducible demo I created a minimal reproducer here: https://github.com/schiller-manuel/expo-issue The project was created using these steps: 1. `npx react-native init ExpoIssue --template react-native-template-typescript` 2. `npm install amazon-cognito-identity-js && npx pod-install` 3. `npx install-expo-modules` Run `npm run ios` to reproduce the build errors.
Error Output
error: duplicate interface definition for class 'RCTCallableJSModules'
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Fix iOS Build Errors After Upgrading to expo@44.0.0
The upgrade to expo@44.0.0 introduces changes in the React Native version and dependencies that conflict with the existing amazon-cognito-identity-js package. Specifically, the duplicate interface definition for 'RCTCallableJSModules' indicates that there are conflicting definitions in the native modules, likely due to incompatibility with the new React Native version used by expo@44.0.0.
Awaiting Verification
Be the first to verify this fix
- 1
Update amazon-cognito-identity-js
Check for a newer version of amazon-cognito-identity-js that is compatible with expo@44.0.0. If available, update the package to resolve potential compatibility issues.
bashnpm install amazon-cognito-identity-js@latest - 2
Clear Cache and Reinstall Pods
Clear the npm and CocoaPods cache to ensure no stale dependencies are causing the build issues. Then, reinstall the pods to refresh the native dependencies.
bashnpm cache clean --force && cd ios && pod install - 3
Check for Duplicate Module Definitions
Inspect the project for any duplicate module definitions that may have been introduced during the upgrade. This includes checking for any custom native modules that may conflict with the new version.
bashgrep -r 'RCTCallableJSModules' ios/ - 4
Modify Podfile for Compatibility
If the issue persists, modify the Podfile to specify the React Native version that is compatible with amazon-cognito-identity-js. This may involve downgrading React Native or adjusting the Podfile to exclude conflicting modules.
rubyplatform :ios, '11.0' # Add this line to specify React Native version pod 'React', :path => '../node_modules/react-native' - 5
Rebuild the iOS Project
After making the necessary changes, rebuild the iOS project to confirm that the errors have been resolved.
bashnpx react-native run-ios
Validation
To confirm the fix worked, ensure that the iOS build completes successfully without any errors related to 'RCTCallableJSModules'. Additionally, run the application on an iOS simulator or device to verify that the functionality remains intact.
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep