Open MasGaNo opened 3 days ago
:warning: | Missing Reproducible Example |
---|---|
:information_source: | We could not detect a reproducible example in your issue report. Please provide either:
|
:warning: | Missing Reproducible Example |
---|---|
:information_source: | We could not detect a reproducible example in your issue report. Please provide either:
|
@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:
bundle install
and then install pods with bundle exec pod install
? We use Ruby Bundler to ensure that all the cocoapods dependencies are aligned properly and that might fix your issueThank you so much.
@cipolleschi Thank you for the quick feedback.
Regarding the first point, I have some issue to run the bundle install
command:
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!
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