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(ios): Fix support for new architecture on react-native 0.74 #2284

Merged

Conversation

gabrieldonadel
Copy link
Contributor

Motivation (required)

When trying to build on iOS with new architecture enabled, user face the following error
image

Given that we're importing ImagePickerManager.h inside ios/ImagePickerUtils.mm, which imports RNImagePickerSpec.h, we need to rename this file to .mm

After this change a different error shows up regarding ld not finding the following simbols:

ld: Undefined symbols:
  _OBJC_CLASS_$_PHAsset, referenced from:
       in libreact-native-image-picker.a[2](ImagePickerManager.o)
  _OBJC_CLASS_$_PHPhotoLibrary, referenced from:
       in libreact-native-image-picker.a[2](ImagePickerManager.o)
  _OBJC_CLASS_$_PHPickerConfiguration, referenced from:
       in libreact-native-image-picker.a[3](ImagePickerUtils.o)
  _OBJC_CLASS_$_PHPickerFilter, referenced from:
       in libreact-native-image-picker.a[3](ImagePickerUtils.o)
  _OBJC_CLASS_$_PHPickerViewController, referenced from:
       in libreact-native-image-picker.a[2](ImagePickerManager.o)

This can be fixed by specifying the Photos and PhotosUI frameworks inside the podspec file

Test Plan (required)

Manually bump the example app to 0.73.0-rc3 (https://react-native-community.github.io/upgrade-helper/?from=0.73.6&to=0.74.0-rc.3), run RCT_NEW_ARCH_ENABLED=1 pod install and build the app

@gabrieldonadel
Copy link
Contributor Author

@Johan-dutoit can you please take a look at this when you have some time?

@brentvatne brentvatne merged commit 6859d23 into react-native-image-picker:main Mar 20, 2024
1 check passed
@gabrieldonadel gabrieldonadel deleted the fix-bridgeless branch March 20, 2024 20:18
Johan-dutoit pushed a commit that referenced this pull request Mar 20, 2024
## [7.1.2](v7.1.1...v7.1.2) (2024-03-20)

### Bug Fixes

* **ios:** Fix support for react-native 0.74 ([#2284](#2284)) ([6859d23](6859d23))
@Johan-dutoit
Copy link
Collaborator

🎉 This PR is included in version 7.1.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

3 participants