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

[solved] IOS Missing deps - atomic_notify_one<unsigned long> is unavailable #2281

Closed
iddar opened this issue May 7, 2021 · 7 comments
Closed

Comments

@iddar
Copy link

iddar commented May 7, 2021

Solution

Remove Pods folder and Pods.lock file reinstall all dependencies and use lastest versions.

use_flipper!({ 'Flipper-Folly' => '2.6.7', 'Flipper-RSocket' => '1.4.3' , 'Flipper' => '0.88.0' })

and then make this changes use a script from here https://stackoverflow.com/a/67336115/10660145

# add before target 'xxxx' do
def find_and_replace(dir, findstr, replacestr)
  Dir[dir].each do |name|
      text = File.read(name)
      replace = text.gsub(findstr,replacestr)

      if text != replace
          puts "Fix: " + name
          system("chmod +w " + name)
          File.open(name, "w") { |file| file.puts replace }
          STDOUT.flush
      end
  end
  Dir[dir + '*/'].each(&method(:find_and_replace))
end

# ....
# ....

    flipper_post_install(installer)

   # add this line into post_install do |installer|
    find_and_replace("Pods/RCT-Folly/folly/synchronization/DistributedMutex-inl.h",
          "  atomic_notify_one(state);", "  folly::atomic_notify_one(state);")

🐛 Bug Report

I have a react native 0.64.0 project with fipper 0.88.0 if try build show this compile error

I follow steps in #2215 but don't resolve

▸ Compiling DistributedMutex.cpp

❌  /Volumes/disk/app/ios/Pods/Headers/Private/RCT-Folly/folly/synchronization/DistributedMutex-inl.h:1051:5: 
'atomic_notify_one<unsigned long>' is unavailable

    atomic_notify_one(state);
                   ^~~~~~~


▸ Compiling Demangle.cpp
** ARCHIVE FAILED **


The following build commands failed:
        CompileC /Users/user/Library/Developer/Xcode/DerivedData/aymbdgipiyzikgcwjklokmljfxvv/Build/Intermediates.noindex/ArchiveIntermediates/app/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/RCT-Folly.build/Objects-normal/arm64/DistributedMutex.o /Volumes/disk/app/ios/Pods/RCT-Folly/folly/synchronization/DistributedMutex.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
[12:23:33]: Exit status: 65

To Reproduce

Run Build

Environment

  • IOS target version 12.0
  • Mac OS 11.3 (20E232) (M1)
  • Xcode 12.5 (12E262)
  • react 17.0.1
  • react-native 0.64.0
  • Cocoa pods 1.10.1
  • Fastlane 2.182.0
@iddar iddar changed the title IOS Missing deps - atomic_notify_one<unsigned long> is unavailable [solved] IOS Missing deps - atomic_notify_one<unsigned long> is unavailable May 8, 2021
@iddar iddar closed this as completed May 8, 2021
@kieran-osgood
Copy link

@iddar did you manage to resolve this? currently experiencing the same issue if you don't mind sharing?

@waltermvp
Copy link

@iddar ?

@kieran-osgood
Copy link

@waltermvp if you're having issues I'd suggest looking at this facebook/react-native#31480 This is where I got myself up and running again

@iddar
Copy link
Author

iddar commented May 24, 2021

Sorry for the delay guys @kieran-osgood @waltermvp , the solution is in a top off issues

Solution

Remove Pods folder and Pods.lock file reinstall all dependencies and use lastest versions.

use_flipper!({ 'Flipper-Folly' => '2.6.7', 'Flipper-RSocket' => '1.4.3' , 'Flipper' => '0.88.0' })

and then make this changes use a script from here https://stackoverflow.com/a/67336115/10660145

.....

@ithustle
Copy link

ithustle commented Jun 8, 2021

Solution

Remove Pods folder and Pods.lock file reinstall all dependencies and use lastest versions.

use_flipper!({ 'Flipper-Folly' => '2.6.7', 'Flipper-RSocket' => '1.4.3' , 'Flipper' => '0.88.0' })

and then make this changes use a script from here https://stackoverflow.com/a/67336115/10660145

# add before target 'xxxx' do
def find_and_replace(dir, findstr, replacestr)
  Dir[dir].each do |name|
      text = File.read(name)
      replace = text.gsub(findstr,replacestr)

      if text != replace
          puts "Fix: " + name
          system("chmod +w " + name)
          File.open(name, "w") { |file| file.puts replace }
          STDOUT.flush
      end
  end
  Dir[dir + '*/'].each(&method(:find_and_replace))
end

# ....
# ....

    flipper_post_install(installer)

   # add this line into post_install do |installer|
    find_and_replace("Pods/RCT-Folly/folly/synchronization/DistributedMutex-inl.h",
          "  atomic_notify_one(state);", "  folly::atomic_notify_one(state);")

🐛 Bug Report

I have a react native 0.64.0 project with fipper 0.88.0 if try build show this compile error

I follow steps in #2215 but don't resolve

▸ Compiling DistributedMutex.cpp

❌  /Volumes/disk/app/ios/Pods/Headers/Private/RCT-Folly/folly/synchronization/DistributedMutex-inl.h:1051:5: 
'atomic_notify_one<unsigned long>' is unavailable

    atomic_notify_one(state);
                   ^~~~~~~


▸ Compiling Demangle.cpp
** ARCHIVE FAILED **


The following build commands failed:
        CompileC /Users/user/Library/Developer/Xcode/DerivedData/aymbdgipiyzikgcwjklokmljfxvv/Build/Intermediates.noindex/ArchiveIntermediates/app/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/RCT-Folly.build/Objects-normal/arm64/DistributedMutex.o /Volumes/disk/app/ios/Pods/RCT-Folly/folly/synchronization/DistributedMutex.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
[12:23:33]: Exit status: 65

To Reproduce

Run Build

Environment

  • IOS target version 12.0
  • Mac OS 11.3 (20E232) (M1)
  • Xcode 12.5 (12E262)
  • react 17.0.1
  • react-native 0.64.0
  • Cocoa pods 1.10.1
  • Fastlane 2.182.0

Great!!

@mweststrate
Copy link
Contributor

For reference, the most up to date solution with latest RN can always be found here: https://github.com/facebook/flipper/blob/master/react-native/ReactNativeFlipperExample/ios/Podfile#L26

We keep this project in sync with latest RN and verify that it compiles. The config will change over time a bit, depending how quickly shared libs get merged into RN, so for example after the next RN release, the version overrides will be shorter again.

@stazrad
Copy link

stazrad commented Oct 4, 2021

I got an error trying to use this:

use_flipper!({ 'Flipper-Folly' => '2.6.7', 'Flipper-RSocket' => '1.4.3' , 'Flipper' => '0.88.0' })

but I did go to the individual dependencies in add_flipper_pods! and updated the versions to the above^

that worked for me- good luck!

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

No branches or pull requests

6 participants