facebook / flipper

A desktop debugging platform for mobile developers.
https://fbflipper.com/
MIT License
13.32k stars 954 forks source link

Build failed when upgrading to React Native 0.67.4 and enables flipper #4205

Open Soliy0u opened 1 year ago

Soliy0u commented 1 year ago

🐛 Bug Report

I am currently trying to upgrade a 0.63 React Native project to 0.67.4. I updated the package and added these lines to my Podfile: platform :ios, '11.0'

target 'MyApp' do config = use_native_modules!

use_react_native!( :path => config[:reactNativePath],

to enable hermes on iOS, change false to true and then install pods

:hermes_enabled => false

) end use_modular_headers! use_flipper!({ 'Flipper' => '0.169.0'}) pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec', :modular_headers => false

pre_install do |installer| Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {} installer.pod_targets.each do |pod| if pod.name.start_with?('RNFB') or pod.name.include?('GoogleMaps') or pod.name.include?('Google-Maps-iOS-Utils') or pod.name.include?('react-native-google-maps') or pod.name.eql?('RNPermissions') or pod.name.start_with?('Permission-') def pod.build_type; Pod::BuildType.static_library end end end end

post_install do |installer| react_native_post_install(installer) __apply_Xcode_12_5_M1_post_install_workaround(installer) installer.pods_project.targets.each do |target|

flipper_post_install(installer)

if target.name == 'react-native-reanimated'
  target.build_configurations.each do |config|
    config.build_settings['OTHER_CPLUSPLUSFLAGS'] = ''
  end
end

if target.name == 'react-native-google-maps'
  target.build_configurations.each do |config|
    config.build_settings['CLANG_ENABLE_MODULES'] = 'No'
  end
end

if target.name.include?('iOSPhotoEditor')
  target.build_configurations.each do |config|
    config.build_settings['SWIFT_VERSION'] = '5'
  end
end

 if target.name == 'react-native-config'
    phase = target.project.new(Xcodeproj::Project::Object::PBXShellScriptBuildPhase)
    phase.shell_script = "cd ../../"\
                         " && RNC_ROOT=./node_modules/react-native-config"\
                         " && export SYMROOT=$RNC_ROOT/ios/ReactNativeConfig"\
                         " && export BUILD_DIR=$RNC_ROOT/ios/ReactNativeConfig"\
                        #  " && ruby $RNC_ROOT/ios/ReactNativeConfig/BuildDotenvConfig.rb"

    target.build_phases << phase
    target.build_phases.move(phase,0)
  end

target.build_configurations.each do |config|
  config.build_settings['DEBUG_INFORMATION_FORMAT'] = 'dwarf-with-dsym'
end

end

end

To Reproduce

1/ Remove Podfile.lock 2/Remove Pods folder 3/Run pod install --repo-update 4/ Build app in XCode 13.2.1

My build on XCode still fails with the following errors being reported: module fmt { ^ /Users/Macpro/my-project/packages/mobile/ios/Pods/Headers/Public/fmt/Flipper-Fmt.modulemap:1:8: note: previously defined here module fmt { ^ /Users/Macpro/my-project/packages/mobile/ios/Pods/Headers/Public/folly/RCT-Folly.modulemap:1:8: error: redefinition of module 'folly' module folly { ^ /Users/Macpro/my-project/packages/mobile/ios/Pods/Headers/Public/folly/Flipper-Folly.modulemap:1:8: note: previously defined here module folly { ^ /Users/Macpro/my-project/packages/mobile/ios/Pods/Headers/Public/glog/glog.modulemap:1:8: error: redefinition of module 'glog' module glog { ^ /Users/Macpro/my-project/packages/mobile/ios/Pods/Headers/Public/glog/Flipper-Glog.modulemap:1:8: note: previously defined here module glog { ^

The first 3 lines and the last line are particularly highlighted, and so are the redefinition of module for fmt, folly, and glog.

I found similar issues to which no fix worked for my case, but I found nobody with exactly those same issues. Does anyone have a recommendation on how to fix these?

Environment

System: OS: macOS 12.4 CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz Memory: 334.48 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 13.11.0 - /usr/local/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.13.7 - /usr/local/bin/npm Watchman: 2022.10.03.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3 Android SDK: Not Found IDEs: Android Studio: 2020.3 AI-203.7717.56.2031.7935034 Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild Languages: Java: javac 14 - /usr/bin/javac npmPackages: @react-native-community/cli: ^3.0.4 => 3.2.1 react: 17.0.2 => 17.0.2 react-native: 0.67.4 => 0.67.4 react-native-macos: Not Found npmGlobalPackages:

vivekverma1993 commented 1 year ago

@Soliy0u did you find any solution for this

Soliy0u commented 1 year ago

@Soliy0u did you find any solution for this

I still stuck on this issue.