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

Failed to build when RCT_NEW_ARCH_ENABLED=1 #2252

Merged
merged 1 commit into from Mar 13, 2024

Conversation

ThibaultBee
Copy link
Contributor

@ThibaultBee ThibaultBee commented Dec 8, 2023

Thanks for submitting a PR! Please read these instructions carefully:

  • Explain the motivation for making this change.
  • Provide a test plan demonstrating that the code is solid.
  • Match the code formatting of the rest of the codebase.
  • Target the main branch, NOT a "stable" branch.

Motivation (required)

I use your package for the example of my react-native library in react-native 0.73.
When I build my example with the new architecture enable, I face the issue:

▸ Compiling ImagePickerManager.mm

❌  /Users/thibault/StudioProjects/api.video-reactnative-uploader/example/node_modules/react-native-image-picker/ios/ImagePickerManager.h:32:43: no type or protocol named 'RNImagePickerSpec'

@interface ImagePickerManager : NSObject <RNImagePickerSpec>
                                                    ^

Full logs is available here: https://github.com/apivideo/api.video-reactnative-uploader/actions/runs/7142227360/job/19451072582#logs

What existing problem does the pull request solve?

I think the reason it fails it is because the interface should implement NativeImagePickerSpec instead of RNImagePickerSpec.

See https://reactnative.dev/docs/0.72/the-new-architecture/pillars-turbomodules#rtncalculatorh

Test Plan (required)

As I am not super familiar with RN, I could not find a way to build your library with RCT_NEW_ARCH_ENABLED=1.
Is there a way to build your library for iOS?

Anyway, I tested to locally change ImagePickerManager.h in my local project and it did fix the compilation issue.

You can check that my project is not building with the following commands:

git clone -b feature/new_arch_support git@github.com:apivideo/api.video-reactnative-uploader.git
cd api.video-reactnative-uploader
yarn && yarn example ios

Copy link

@VivienTournie VivienTournie left a comment

Choose a reason for hiding this comment

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

LGTM

@lucaswitch
Copy link

This PR is pretty important!

@clarksandholtz
Copy link

Feels like this should be an easy merge

@sonhavietnamese
Copy link

Saved me, huge thanks!!!

Copy link

@khushbu-gohil-reliable khushbu-gohil-reliable left a comment

Choose a reason for hiding this comment

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

I found this working.

khushbu-gohil-reliable

This comment was marked as duplicate.

Copy link

@maya-salcedo maya-salcedo left a comment

Choose a reason for hiding this comment

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

This works for me in "react-native": "0.73.4"

@brentvatne brentvatne merged commit df78b9a into react-native-image-picker:main Mar 13, 2024
Johan-dutoit pushed a commit that referenced this pull request Mar 13, 2024
## [7.1.1](v7.1.0...v7.1.1) (2024-03-13)

### Bug Fixes

* **ios:** fix spec name when new architecture is enabled ([#2252](#2252)) ([df78b9a](df78b9a))
@Johan-dutoit
Copy link
Collaborator

🎉 This PR is included in version 7.1.1 🎉

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

9 participants