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

Flipper doesn't build with Xcode 12.5 RC #2215

Closed
matiaskorhonen opened this issue Apr 21, 2021 · 78 comments
Closed

Flipper doesn't build with Xcode 12.5 RC #2215

matiaskorhonen opened this issue Apr 21, 2021 · 78 comments

Comments

@matiaskorhonen
Copy link

matiaskorhonen commented Apr 21, 2021

🐛 Bug Report

Flipper in a React Native project fails to build with the following error:

~/MyProject/ios/Pods/Headers/Private/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h:1051:5: 'atomic_notify_one<unsigned long>' is unavailable
Build log
[... TRUNCATED ...][]

In file included from ~/MyProject/ios/Pods/Flipper-Folly/folly/synchronization/DistributedMutex.cpp:17:
In file included from ~/MyProject/ios/Pods/Headers/Private/Flipper-Folly/folly/synchronization/DistributedMutex.h:344:
~/MyProject/ios/Pods/Headers/Private/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h:1051:5: error: 'atomic_notify_one<unsigned long>' is unavailable
    atomic_notify_one(state);
    ^
~/MyProject/ios/Pods/Headers/Private/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h:1573:5: note: in instantiation of function template specialization 'folly::detail::distributed_mutex::wakeTimedWaiters<std::__1::atomic<unsigned long>>' requested here
    wakeTimedWaiters(&state_, proxy.timedWaiters_);
    ^
In file included from ~/MyProject/ios/Pods/Flipper-Folly/folly/synchronization/DistributedMutex.cpp:17:
In file included from ~/MyProject/ios/Pods/Headers/Private/Flipper-Folly/folly/synchronization/DistributedMutex.h:19:
In file included from ~/MyProject/ios/Pods/Headers/Private/Flipper-Folly/folly/Optional.h:58:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/c++/v1/functional:504:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/c++/v1/memory:681:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/c++/v1/atomic:2140:6: note: 'atomic_notify_one<unsigned long>' has been explicitly marked unavailable here
void atomic_notify_one(atomic<_Tp>* __o) _NOEXCEPT
     ^
1 error generated.

[... TRUNCATED ...]

Build failed    21.4.2021, 11.51    34.5 seconds

Cleaning the Xcode build folder didn't help, nor does updating Flipper and Flipper-Folly to the latest versions.

To Reproduce

  1. Install Xcode 12.5 RC from Apple
  2. Open a React Native project with Flipper enabled
  3. Try to build that project
  4. The build fails

Environment

  • Xcode 12.5 RC
  • React Native 0.63.4
  • Pods:
    • Flipper (0.85.0)
    • Flipper-DoubleConversion (1.1.7)
    • Flipper-Folly (2.5.1)
    • Flipper-Glog (0.3.6)
    • Flipper-PeerTalk (0.0.4)
    • Flipper-RSocket (1.3.1)
    • FlipperKit (0.85.0)
@avery-pierce
Copy link

I'm getting the same error in our React Native app. Here's some related issues I was able to dig up:

facebook/folly#1527

facebook/react-native#31179

Looks like the underlying issue was resolved (here: facebook/folly@8477e25), but it hasn't been published to cocoapods yet.

@OceanFlooor
Copy link

Same as you. I feel no hope right now.
after tried every each solution, issue is still fucking there.

@baveku
Copy link
Contributor

baveku commented Apr 27, 2021

xCode 12.5 has released yesterday, this error still here. I hope we will be resolve the error for the next version

@jonathanroze
Copy link

Same issue by updating Xcode and my devices. Try many solutions but no one work.

@baveku
Copy link
Contributor

baveku commented Apr 27, 2021

Same issue by updating Xcode and my devices. Try many solutions but no one work.

I read facebook/folly@8477e25, the issue has resolved but flipper does not update yet

@naicky-whiterain
Copy link

same issue but why even I still disabled flipper on ios and I'm still getting a build error?

@j2teamlbh
Copy link

j2teamlbh commented Apr 27, 2021

Now, i just need update this file and it run normally. Hope it will be resolve in the next version.
This file in:
{project-name}/ios/Pods/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h

Screen Shot 2021-04-27 at 15 25 12

facebook/folly@8477e25#diff-65ad309ca9c636ba81eb7953fce06e6963c51296a60dc25eb4a5b1463482c6da

@AlexHooperDev
Copy link

same issue but why even I still disabled flipper on ios and I'm still getting a build error?

Me too - I get the following:

CompileC /Users/alex.hooper/Library/Developer/Xcode/DerivedData/Espresso-brgntaoyjolqyfdzcsunjlqtzzum/Build/Intermediates.noindex/Espresso.build/Debug-iphoneos/Espresso.build/Objects-normal/arm64/AppDelegate.o /Users/alex.hooper/Documents/figloo-bank-mobile/ios/Espresso/AppDelegate.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler

@naicky-whiterain
Copy link

Anyways, I was able to fix this by downgrading to XCode Version 12.4. It seems the issue for me happens when I updated my Xcode to the latest 12.5 version. until there's a patch to fix this, i will continue using 12.4 version

@chrisid
Copy link

chrisid commented Apr 27, 2021

This disables Flipper, but it's a quick workaround if you (like me) need the project working again.

  1. Podfile, comment Flipper:
#   use_flipper!()
#   post_install do |installer|
#     react_native_post_install(installer)
#   end
  1. cd ios and delete the 'Pods folder' folder and 'Podfile.lock'
  2. pod install

@naicky-whiterain
Copy link

This disables Flipper, but it's a quick workaround if you (like me) need the project working again.

  1. Podfile, comment Flipper:
#   use_flipper!()
#   post_install do |installer|
#     react_native_post_install(installer)
#   end
  1. cd ios and delete the 'Pods folder' folder and 'Podfile.lock'
  2. pod install

However this ain't working, tried numerous times there's still a build error. :(

AlexHooperDev referenced this issue in facebook/folly Apr 27, 2021
Summary:
`std::atomic_wait()` and `std::atomic_notify_one()` are marked as unavailable.
Not really sure what that means, but it seems to be breaking some open source
builds #1527.  Explicitly qualify the
calls into those functions to try and fix the build break.

Since we cannot conditionally import either of the above (because they are
marked as unavailable), we can't rely on the standard implementations.  To
prevent ADL from kicking in when the standard-library defines these, we fully
qualify these and use `tag_invoke` for the customization points used in tests.

Reviewed By: davidtgoldblatt

Differential Revision: D26742072

fbshipit-source-id: 9f44bbfd37530f5ecffa3e03d673cfb1df953299
@AlexHooperDev
Copy link

Managed to use the temporary code fix above posted by j2teamlbh, what made it finally work was ensuring that in the podfile you specify that you're using use_flipper!({ 'Flipper-Folly' => '2.3.0' })

@blueberry6401
Copy link

Sucks.

@olie-chan
Copy link

olie-chan commented Apr 28, 2021

Managed to use the temporary code fix above posted by j2teamlbh, what made it finally work was ensuring that in the podfile you specify that you're using use_flipper!({ 'Flipper-Folly' => '2.3.0' })

@AlexHooperDev you wouldn't happen to know where I would put that change in my Podfile would you? I'm using using react native 62

platform :ios, '10.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'foobarbazapp' do
  # Pods for foobarbazapp
  pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
  pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
  pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/'
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'

  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'



  pod 'Firebase/Messaging', '~> 6.13.0'
  pod 'Firebase/Core', '~> 6.13.0'
  pod 'Firebase/DynamicLinks', '~> 6.13.0'


  rn_maps_path = '../node_modules/react-native-maps'
  pod 'react-native-google-maps', :path => rn_maps_path
  pod 'GoogleMaps'
  pod 'Google-Maps-iOS-Utils'

  pod 'react-native-geolocation', path: '../node_modules/@react-native-community/geolocation'

  pod 'TrustKit', '~> 1.5.3'
  pod 'RNAzureNotificationHub', :podspec => '../node_modules/react-native-azurenotificationhub/RNAzureNotificationHub.podspec'


  target 'foobarbazappTests' do
    inherit! :search_paths
    # Pods for testing
  end

  use_native_modules!
end

target 'foobarbazapp-tvOS' do
  # Pods for foobarbazapp-tvOS

  target 'foobarbazapp-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

@AlexHooperDev
Copy link

Managed to use the temporary code fix above posted by j2teamlbh, what made it finally work was ensuring that in the podfile you specify that you're using use_flipper!({ 'Flipper-Folly' => '2.3.0' })

@AlexHooperDev you wouldn't happen to know where I would put that change in my Podfile would you? I'm using using react native 62

platform :ios, '10.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'foobarbazapp' do
  # Pods for foobarbazapp
  pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
  pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
  pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/'
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'

  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'



  pod 'Firebase/Messaging', '~> 6.13.0'
  pod 'Firebase/Core', '~> 6.13.0'
  pod 'Firebase/DynamicLinks', '~> 6.13.0'


  rn_maps_path = '../node_modules/react-native-maps'
  pod 'react-native-google-maps', :path => rn_maps_path
  pod 'GoogleMaps'
  pod 'Google-Maps-iOS-Utils'

  pod 'react-native-geolocation', path: '../node_modules/@react-native-community/geolocation'

  pod 'TrustKit', '~> 1.5.3'
  pod 'RNAzureNotificationHub', :podspec => '../node_modules/react-native-azurenotificationhub/RNAzureNotificationHub.podspec'


  target 'foobarbazappTests' do
    inherit! :search_paths
    # Pods for testing
  end

  use_native_modules!
end

target 'foobarbazapp-tvOS' do
  # Pods for foobarbazapp-tvOS

  target 'foobarbazapp-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

It's up to you but I would put it below use_native_modules! end then run pod install

@priteshrnandgaonkar
Copy link
Contributor

I will take a look at this by today or tomorrow and will release a new Flipper-Folly version.

@priteshrnandgaonkar
Copy link
Contributor

The newer version of Folly depends on new dependency called fmt. So we will have to add a cocoapod dependency for that as well. Right now I am stuck at an issue from fmt where the xcode is not able to find the definition of the compile function.

The changes related to flipper-folly pod and fmt pod can be found here.

When I run pod spec lint Flipper-Folly.podspec --use-libraries --allow-warnings --verbose --skip-import-validation --sources=https://github.com/CocoaPods/Specs It gives me the following error

    - ERROR | [iOS] xcodebuild:  Headers/Public/Flipper-Fmt/fmt/compile.h:904:29: error: no matching function for call to 'compile'

Any idea how can I solve this ?

@priteshrnandgaonkar
Copy link
Contributor

I have solved the above error. Now fixing the other errors.

@priteshrnandgaonkar
Copy link
Contributor

I have released a new Flipper-Folly version of 2.5.2. Give it a try. It points to the latest Folly release. The latest folly release also depends on a fmt library, the pod of which is also published as Flipper-Fmt.

Do try using Flipper-Folly version of 2.5.2 and let me know if it fixes the issue.

@shamilovtim
Copy link

[!] CocoaPods could not find compatible versions for pod "Flipper-Folly":
  In Podfile:
    Flipper-Folly (= 2.5.2)

None of your spec sources contain a spec satisfying the dependency: `Flipper-Folly (= 2.5.2)`.

You have either:
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

How are we to update Flipper-Folly?

@priteshrnandgaonkar
Copy link
Contributor

Run pod repo update and then run pod install.

@esinanturan
Copy link

tried but still same error

@my-name-is-nheo
Copy link

@priteshrnandgaonkar deleted the podfile-lock and folder, those commands still led me to install 2.5.1

@shamilovtim
Copy link

I seem to get 2.5.1 no matter what, and I don't have a hash in the lockfile locking it to that version

@my-name-is-nheo
Copy link

my-name-is-nheo commented Apr 28, 2021

@avery-pierce Yea @nicholasc 's advise on downgrading back to 2.5.1 and following #2215 (comment) did not work for me. I'm trying to get my app on testflight. (product->analyze) hopefully this is the case for some of you

@shamilovtim
Copy link

For now I've disabled Flipper on iOS and our project builds now

@lParraMediaCurrent
Copy link

For now I've disabled Flipper on iOS and our project builds now

What specifically you did for it?

@priteshrnandgaonkar
Copy link
Contributor

As a hotfix I have patched 2.5.1 with the above mentioned patch in Flipper-Folly 2.5.3

I will follow up with RN folks regarding consolidating Flipper-Folly and RCT-Folly into one and have a consistent workflow of maintaining it.

But for now Flipper-Folly 2.5.3 should unblock.

@teajohnson90
Copy link

This disables Flipper, but it's a quick workaround if you (like me) need the project working again.

  1. Podfile, comment Flipper:
#   use_flipper!()
#   post_install do |installer|
#     react_native_post_install(installer)
#   end
  1. cd ios and delete the 'Pods folder' folder and 'Podfile.lock'
  2. pod install

However this ain't working, tried numerous times there's still a build error. :(

This worked for me, thanks!

@shamilovtim
Copy link

For now I've disabled Flipper on iOS and our project builds now

What specifically you did for it?

In Podfile comment the following:

//1
#  pod 'react-native-flipper', :path => '../node_modules/react-native-flipper/react-native-flipper.podspec', :configuration => 'Debug'

//2
#  use_flipper!({'Flipper' => '0.87.0', 'Flipper-Folly' => '2.5.2'})

//3
#    flipper_post_install(pi)

Then npx pod-install afterwards

@shamilovtim
Copy link

It would be nice if you could get with them and get them to commit to removing Flipper from CRNA and expo init. This package is below 1.0, is woefully slow and plagued by instability and performance variance between different versions and frequently has breaking changes. It doesn't belong in starter templates and it shouldn't be a requirement for getting started with React Native. The amount of downtime, CI slowness, failed and slowed builds it has caused could probably be valued in the hundreds of thousands of $$$, all because someone made the decision to make the RN community guinea pigs for this tool. Reactotron is infinitely better despite being created by a third party, not updated for 2 years and swizzling APIs that Facebook didn't open to it. I have a 2020 MBP and Flipper performs terribly on it. What audience is this tool really intended for if it can't perform on a new MBP, breaks frequently, and slows down people's builds? Now lets say it finally performs like its contemporaries, tools like VSCode or whatever else. Then I'd understand, and I'd probably even use it. But why is it in production now in the state that it is?

@smooney211993
Copy link

This worked for me. On react native 0.63.4
use_flipper!({ 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.87.0', 'Flipper-RSocket' => '1.3.1' })

@smooney211993
Copy link

As a hotfix I have patched 2.5.1 with the above mentioned patch in Flipper-Folly 2.5.3

I will follow up with RN folks regarding consolidating Flipper-Folly and RCT-Folly into one and have a consistent workflow of maintaining it.

But for now Flipper-Folly 2.5.3 should unblock.

THANKS

@kkelley-leftbrain
Copy link

kkelley-leftbrain commented Apr 29, 2021

This worked for me. On react native 0.63.4
use_flipper!({ 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.87.0', 'Flipper-RSocket' => '1.3.1' })

Trying the above got me past the errors others described, but I'm now running into Unknown type name 'BN_ULONG' which I've (potentially) ran down to a versioning issue on the dependency of OpenSSL-Universal

from the Podfile.lock:

  - Flipper-Folly (2.5.3):
    - boost-for-react-native
    - Flipper-DoubleConversion
    - Flipper-Glog
    - libevent (~> 2.1.12)
    - OpenSSL-Universal (= 1.1.180)

A somewhat recent issue on the subject is here

I'm newish to react-native when it comes to custom managing the versions like this, does anyone have any advice on how I can resolve?

@my-name-is-nheo
Copy link

@priteshrnandgaonkar will check it out later. thank you for staying on top of this.

@debianw
Copy link

debianw commented Apr 29, 2021

After updating to Flipper-Folly 2.5.3 I'm getting this build error: event2/event-config.h file not found

@willgriffiths
Copy link

willgriffiths commented Apr 29, 2021

@kkelley-leftbrain I got past OpenSSL issues by adding the version of OpenSSL-Universal in the Podfile:

target 'MyApp' do
  ...
  pod 'OpenSSL-Universal', '~>1.1.180' 
  ...  
  use_flipper!({ 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.87.0', 'Flipper-RSocket' => '1.3.1' })
  post_install do |installer|
    flipper_post_install(installer)
  end
end

In my case it was previously pinned to an older version.

@ShivamJoker
Copy link

Still getting the same error after updating and reinstalling pods ?
any workaround you guys did ? my flipper config is already commented in podfile

❌  /Users/shivam/Documents/ReactNative/SQL-Playground/ios/Pods/Headers/Private/RCT-Folly/folly/synchronization/DistributedMutex-inl.h:1051:5: 'atomic_notify_one<unsigned long>' is unavailable

    atomic_notify_one(state);
    ^

@umang-simform
Copy link

Still getting the same error after updating and reinstalling pods ?
any workaround you guys did ? my flipper config is already commented in podfile

❌  /Users/shivam/Documents/ReactNative/SQL-Playground/ios/Pods/Headers/Private/RCT-Folly/folly/synchronization/DistributedMutex-inl.h:1051:5: 'atomic_notify_one<unsigned long>' is unavailable

    atomic_notify_one(state);
    ^

Yes because they have updated Flipper-folly not RCT-folly,
You will need to add these lines to your podfile

use_flipper!({ 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.87.0', 'Flipper-RSocket' => '1.3.1' })


  # Define find-and-replace function
  def find_and_replace(dir, findstr, replacestr)
    Dir[dir].each do |name|
        text = File.read(name)
        replace = text.gsub(findstr,replacestr)
        replaced = text.index(replacestr)
        if replaced == nil && text != replace
            puts "Fix: " + name
            File.open(name, "w") { |file| file.puts replace }
            STDOUT.flush
        end
    end
    Dir[dir + '*/'].each(&method(:find_and_replace))
  end

  post_install do |installer|
    react_native_post_install(installer)
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
        end
    end
    
#     Fix for Flipper-Folly on iOS 14.5
#    These are no longer required as Flipper-folly is updated
#   find_and_replace("Pods/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h",
#                    "atomic_notify_one(state)", "folly::atomic_notify_one(state)")

#   find_and_replace("Pods/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h",
#   "atomic_wait_until(&state, previous | data, deadline)", "folly::atomic_wait_until(&state, previous | data, deadline)")

  find_and_replace("Pods/RCT-Folly/folly/synchronization/DistributedMutex-inl.h",
                   "atomic_notify_one(state)", "folly::atomic_notify_one(state)")

  find_and_replace("Pods/RCT-Folly/folly/synchronization/DistributedMutex-inl.h",
  "atomic_wait_until(&state, previous | data, deadline)", "folly::atomic_wait_until(&state, previous | data, deadline)")

    
  end

@IronTony
Copy link

This worked for me. On react native 0.63.4
use_flipper!({ 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.87.0', 'Flipper-RSocket' => '1.3.1' })

This works perfectly! Just do pod install --repo-update and everything will be fine! Thank you!

@ShivamJoker
Copy link

@umang-simform the solution you gave is giving me open ssl error while installing/updating pods.

[!] Error installing OpenSSL-Universal
[!] /usr/bin/git clone https://github.com/krzyzanowskim/OpenSSL.git /var/folders/p8/8d4bmlwn6858cz1x0szgzv940000gn/T/d20210429-20276-18dmikn --template= --single-branch --depth 1 --branch 1.1.180

Cloning into '/var/folders/p8/8d4bmlwn6858cz1x0szgzv940000gn/T/d20210429-20276-18dmikn'...
error: 7467 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: index-pack failed

@AlixH
Copy link

AlixH commented Apr 29, 2021

This worked for me. On react native 0.63.4
use_flipper!({ 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.87.0', 'Flipper-RSocket' => '1.3.1' })

After doing this, I am getting the following error:

Undefined symbols for architecture x86_64:
  "Swift._ArrayBuffer._copyContents(initializing: Swift.UnsafeMutableBufferPointer<A>) -> (Swift.IndexingIterator<Swift._ArrayBuffer<A>>, Swift.Int)", referenced from:
      generic specialization <serialized, Swift._ArrayBuffer<Swift.Int8>> of Swift._copyCollectionToContiguousArray<A where A: Swift.Collection>(A) -> Swift.ContiguousArray<A.Element> in libCharts.a(ChartUtils.o)
ld: symbol(s) not found for architecture x86_64

Any ideas ?

@priteshrnandgaonkar
Copy link
Contributor

Those getting RCT-Folly errors, please follow facebook/react-native#31179

I am closing this as the issue from Flipper side is resolved.

@tomphilbin
Copy link

Yes because they have updated Flipper-folly not RCT-folly,
You will need to add these lines to your podfile

use_flipper!({ 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.87.0', 'Flipper-RSocket' => '1.3.1' })


  # Define find-and-replace function
  def find_and_replace(dir, findstr, replacestr)
    Dir[dir].each do |name|
        text = File.read(name)
        replace = text.gsub(findstr,replacestr)
        replaced = text.index(replacestr)
        if replaced == nil && text != replace
            puts "Fix: " + name
            File.open(name, "w") { |file| file.puts replace }
            STDOUT.flush
        end
    end
    Dir[dir + '*/'].each(&method(:find_and_replace))
  end

  post_install do |installer|
    react_native_post_install(installer)
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
        end
    end
    
#     Fix for Flipper-Folly on iOS 14.5
#    These are no longer required as Flipper-folly is updated
#   find_and_replace("Pods/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h",
#                    "atomic_notify_one(state)", "folly::atomic_notify_one(state)")

#   find_and_replace("Pods/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h",
#   "atomic_wait_until(&state, previous | data, deadline)", "folly::atomic_wait_until(&state, previous | data, deadline)")

  find_and_replace("Pods/RCT-Folly/folly/synchronization/DistributedMutex-inl.h",
                   "atomic_notify_one(state)", "folly::atomic_notify_one(state)")

  find_and_replace("Pods/RCT-Folly/folly/synchronization/DistributedMutex-inl.h",
  "atomic_wait_until(&state, previous | data, deadline)", "folly::atomic_wait_until(&state, previous | data, deadline)")

    
  end

Thanks @umang-simform this worked great for our team, we just had to add the following line before calling find_and_replace:

system('chmod +rw Pods/RCT-Folly/folly/synchronization/DistributedMutex-inl.h')

@jonathanroze
Copy link

Hey guys they push a new version.

You just need to edit your code to that

  use_flipper!({ 'Flipper' => '0.87.0' })
  post_install do |installer|
    flipper_post_install(installer)
  end

And run npx pod-install

@my-name-is-nheo
Copy link

@AlixH did you find a solution to this? been getting the same error.

@guillewu
Copy link

@my-name-is-nheo @AlixH I'm having a very similar error. I ended up giving up and just downgraded back to xcode 12.4 😞

@JuanpaG94
Copy link

Guys please stop asking, read the comments, they already fixed it and they give the solution

@AlixH
Copy link

AlixH commented Apr 29, 2021

@AlixH did you find a solution to this? been getting the same error.

facebook/react-native#31179 (comment)

@azuxx
Copy link

azuxx commented Apr 29, 2021

Guys please stop asking, read the comments, they already fixed it and they give the solution

sorry, but where we can find this final solution? Would be great if someone can pin it for us please.

I updated to Big Sur, so I have now XCode Version 12.5 (12E262), I also updated from 0.63.4 to 0.64.0 but XCode build still fails. Would be great if we can build our app again and ship them to the clients in the very next few days.

Thanks

@jonathanroze
Copy link

Hey guys they push a new version.

You just need to edit your code to that

  use_flipper!({ 'Flipper' => '0.87.0' })
  post_install do |installer|
    flipper_post_install(installer)
  end

And run npx pod-install

@azuxx

@facebook facebook locked as resolved and limited conversation to collaborators Apr 29, 2021
@mweststrate
Copy link
Contributor

Locking now since the original issue is solved. Please see the comment directly above and this one. For RTC-Folly issues please follow up in facebook/react-native#31179. For any new issues open a fresh issue including Podfile & lock file

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests