-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
Error "no implicit conversion of String into Array" in Pod Install after migrating to RN > 0.74 (0.74.0 until 0.75.3) #46505
Comments
|
|
@MasGaNo thanks for the issue. The build setting can definitely be either String or Array. I'm not sure if that's due to different versions of Xcode, version of cocoapods, or the method used to actually read the project. Anyway, I'd like to ask you a couple of things:
Thank you so much. |
@cipolleschi Thank you for the quick feedback. make: *** No rule to make target `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/universal-darwin22/ruby/config.h', needed by `nkf.o'. Stop. I'm suspecting the fact I'm using the default Ruby 2.6 from MacOS/XCode and it may lead to some issues. I'm currently trying to replace it by a proper ruby and will let you know. Regarding the fix itself, I just created the PR with the code snippet I put above and updated the test to support both Array and String value. Thank you! |
Summary: Following the discussion on #46505, this PR aims to allow mixte type configuration (String and/or Array of String) during the post installation of pods. ## Changelog: <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [IOS] [FIXED] - allow pods mixte type settings on post-install Pull Request resolved: #46536 Test Plan: `packages/react-native/scripts/cocoapods/__tests__/utils-test.rb` test suits was updated to support array and works as expected Reviewed By: shwanton Differential Revision: D62870582 Pulled By: cipolleschi fbshipit-source-id: c0ace6d9d20e6609ceae5aafd236d97fc9e86ddf
Sorry for the late answer, but I finally managed to execute these commands, the first Hopefully, everything will be solved once the fix will be released 😄 |
Thanks for testing that out. |
Summary: Following the discussion on #46505, this PR aims to allow mixte type configuration (String and/or Array of String) during the post installation of pods. ## Changelog: <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [IOS] [FIXED] - allow pods mixte type settings on post-install Pull Request resolved: #46536 Test Plan: `packages/react-native/scripts/cocoapods/__tests__/utils-test.rb` test suits was updated to support array and works as expected Reviewed By: shwanton Differential Revision: D62870582 Pulled By: cipolleschi fbshipit-source-id: c0ace6d9d20e6609ceae5aafd236d97fc9e86ddf
Description
I'm working on a very old application (RN 0.59.3) and we tried to keep it in shape by upgrading all dependencies, especially on RN version. So we might have many legacy configurations we bring from a version to another one, even if we are doing our best to clean as much as possible.
After migrating from RN 0.73.9 to any version > 0.74 including the latest 0.75.3 version, an error occurs during the pod installation:
With the following error:
no implicit conversion of String into Array
After some investigation, it appears that in the /node_modules/react-native/scripts/cocoapods/utils.rb file, the new method
add_flag_to_map_with_inheritance
was introduced and deals with an array of string settings value.For some reason, on the method above, this method is called for
OTHER_CPLUSPLUSFLAGS
andOTHER_CFLAGS
settings.If I tried to output these values, it appears they contain Array instead of string value such as:
["$(inherited)", "-DNDEBUG"]
And so obviously it fails, as the method tries to concat a string with an array
As a quick workaround, if I replace the following lines:
By:
in order to handle both Array and String, it works like a charm and I can complete the pod installation and even fully build my iOS App.
But I'm not sure it something you expect and I'm not able to find where the
config.build_settings
is filled from:in order to understand why I'm getting an array of string instead of a string.
Any hints?
Steps to reproduce
cd ios && pod install
React Native Version
0.75.3
Affected Platforms
Runtime - iOS, Build - MacOS
Output of
npx react-native info
Stacktrace or Logs
Reproducer
No reproducer as it's not easy to reproduce, especially on recent project
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: