Good morning people, everything fine? I come here to report a supposed bug that is happening in the build of my react-native application that is in version 0.65.1.
I've been trying to build the application for a long time and I haven't come up with any solution. I've checked many issues here and in the Flipper repository, hoping to find a solution. But unfortunately I didn't get anything.
I don't know exactly what is causing this problem. Basically, I'm trying to build the application in debug. However, I'm being prevented by Flipper, even disabling it.
I build the app in launch mode and it works perfectly. But in debugging it breaks at the end of compilation. Returns a huge error saying that several modules were reset or that the module could not be built. Below is an example of the error:
fatal error: redefinition of module 'fmt'
fatal error: redefinition of module 'folly'
fatal error: could not build module 'Darwin'
fatal error: could not build module 'CoreFoundation'
fatal error: could not build module 'Foundation'
fatal error: could not build module '_Builtin_stddef_max_align_t'
Note: I'm not sure if this bug is related to my react-native version or is a bug of the flipper itself.
Version
0.65.1
Output of npx react-native info
System:
OS: macOS 12.4
CPU: (4) x64 Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz
Memory: 37.15 MB / 8.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 14.18.1 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 8.19.2 - /usr/local/bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.11.2 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK: Not Found
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8609683
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
Languages:
Java: 11.0.15 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: Not Found
react-native: Not Found
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Steps to reproduce
To reproduce the error, I believe it is enough to insert the same code snippets that I made available, such as those of my Podfile and my AppDelegate.m, and download and configure the same dependencies that are in my application in a react-native project in version 0.65.1.
Snack, code example, screenshot, or link to a repository
Note: Something important to note here is that, even though I have a react-native app version 0.65.1, my Podfile has the Flipper settings for react-native version 0.62.x and not version 0.63.x. I did this, because when I put the settings that Flipper made available for version 0.63.x or more, my Podfile was not even generated.
Below is how mine is Podfile:
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '11.0'
def flipper_post_install(installer)
file_name = Dir.glob("*.xcodeproj")[0]
app_project = Xcodeproj::Project.open(file_name)
app_project.native_targets.each do |target|
target.build_configurations.each do |config|
cflags = config.build_settings['OTHER_CFLAGS'] || '$(inherited) '
unless cflags.include? '-DFB_SONARKIT_ENABLED=1'
puts 'Adding -DFB_SONARKIT_ENABLED=1 in OTHER_CFLAGS...'
cflags << '-DFB_SONARKIT_ENABLED=1'
end
config.build_settings['OTHER_CFLAGS'] = cflags
end
app_project.save
end
installer.pods_project.save
end
target 'my_app' do
config = use_native_modules!
use_modular_headers!
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
:hermes_enabled => false
)
pod 'RNDateTimePicker', :path => '../node_modules/@react-native-community/datetimepicker'
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'simdjson', path: '../node_modules/@nozbe/simdjson'
pod 'react-native-camera', path: '../node_modules/react-native-camera', subspecs: ['BarcodeDetectorMLKit']
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec', :modular_headers => false
pod 'react-native-image-editor', :path => '../node_modules/@react-native-community/image-editor'
pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'
target 'my_appTests' do
inherit! :complete
# Pods for testing
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
use_flipper!() # should match the version of your Flipper client app
post_install do |installer|
react_native_post_install(installer)
# Apple Silicon builds require a library path tweak for Swift library discovery or "symbol not found" for swift things
installer.aggregate_targets.each do |aggregate_target|
aggregate_target.user_project.native_targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['LIBRARY_SEARCH_PATHS'] = ['$(SDKROOT)/usr/lib/swift', '$(inherited)']
end
end
aggregate_target.user_project.save
end
# Flipper requires a crude patch to bump up iOS deployment target, or "error: thread-local storage is not supported for the current target"
# I'm not aware of any other way to fix this one other than bumping iOS deployment target to match react-native (iOS 11 now)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
end
end
# ...but if you bump iOS deployment target, Flipper barfs again "Time.h:52:17: error: typedef redefinition with different types"
# We need to make one crude patch to RCT-Folly - set `__IPHONE_10_0` to our iOS target + 1
# https://github.com/facebook/flipper/issues/834 - 84 comments and still going...
`sed -i -e $'s/__IPHONE_10_0/__IPHONE_12_0/' Pods/RCT-Folly/folly/portability/Time.h`
end
end
Description
Bug Report
Good morning people, everything fine? I come here to report a supposed bug that is happening in the build of my react-native application that is in version
0.65.1
.I've been trying to build the application for a long time and I haven't come up with any solution. I've checked many issues here and in the Flipper repository, hoping to find a solution. But unfortunately I didn't get anything.
I don't know exactly what is causing this problem. Basically, I'm trying to build the application in debug. However, I'm being prevented by Flipper, even disabling it.
I build the app in launch mode and it works perfectly. But in debugging it breaks at the end of compilation. Returns a huge error saying that several modules were reset or that the module could not be built. Below is an example of the error:
Note: I'm not sure if this bug is related to my react-native version or is a bug of the flipper itself.
Version
0.65.1
Output of
npx react-native info
Steps to reproduce
To reproduce the error, I believe it is enough to insert the same code snippets that I made available, such as those of my
Podfile
and myAppDelegate.m
, and download and configure the same dependencies that are in my application in a react-native project in version0.65.1
.Snack, code example, screenshot, or link to a repository
Note: Something important to note here is that, even though I have a react-native app version
0.65.1
, myPodfile
has the Flipper settings for react-native version0.62.x
and not version0.63.x
. I did this, because when I put the settings that Flipper made available for version0.63.x
or more, myPodfile
was not even generated.Below is how mine is
Podfile
:Follow below my
AppDelegate.m
:Finally, my
package.json
below, if you want to see:Some similar issues with what's happening to me:
Debug info:
13.4.1
.15.6
.