question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Archive fails on XCode 13.1 with React Native 0.66.1 and use_frameworks!

See original GitHub issue

Description

Archive of the app fails with an error:

ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Showing Recent Messages
Dylib (/Users/vytautas/Library/Developer/Xcode/DerivedData/TestApp-ferjgbytfspgkvgspawguupwmviq/Build/Intermediates.noindex/ArchiveIntermediates/TestApp/BuildProductsPath/Release-iphoneos/fmt/fmt.framework/fmt) was built for newer iOS version (10.0) than being linked (9.0)
Ignoring file /Users/vytautas/Library/Developer/Xcode/DerivedData/TestApp-ferjgbytfspgkvgspawguupwmviq/Build/Intermediates.noindex/ArchiveIntermediates/TestApp/BuildProductsPath/Release-iphoneos/DoubleConversion/DoubleConversion.framework/DoubleConversion, building for iOS-armv7 but attempting to link with file built for iOS-arm64
Ignoring file /Users/vytautas/Library/Developer/Xcode/DerivedData/TestApp-ferjgbytfspgkvgspawguupwmviq/Build/Intermediates.noindex/ArchiveIntermediates/TestApp/BuildProductsPath/Release-iphoneos/glog/glog.framework/glog, building for iOS-armv7 but attempting to link with file built for iOS-arm64
Undefined symbol: double_conversion::DoubleToStringConverter::ToPrecision(double, int, double_conversion::StringBuilder*) const
Undefined symbol: double_conversion::DoubleToStringConverter::ToShortestIeeeNumber(double, double_conversion::StringBuilder*, double_conversion::DoubleToStringConverter::DtoaMode) const
Undefined symbol: double_conversion::DoubleToStringConverter::ToExponential(double, int, double_conversion::StringBuilder*) const
Undefined symbol: double_conversion::DoubleToStringConverter::ToFixed(double, int, double_conversion::StringBuilder*) const
Undefined symbol: google::base::CheckOpMessageBuilder::CheckOpMessageBuilder(char const*)
Undefined symbol: double_conversion::StringToDoubleConverter::StringToIeee(char const*, int, int*, bool) const
Undefined symbol: google::base::CheckOpMessageBuilder::ForVar2()
Undefined symbol: google::LogMessageFatal::LogMessageFatal(char const*, int)
Undefined symbol: google::base::CheckOpMessageBuilder::~CheckOpMessageBuilder()
Undefined symbol: google::LogMessageFatal::LogMessageFatal(char const*, int, google::CheckOpString const&)
Undefined symbol: google::base::CheckOpMessageBuilder::NewString()
Undefined symbol: google::LogMessage::stream()
Undefined symbol: void google::MakeCheckOpValueString<char>(std::__1::basic_ostream<char, std::__1::char_traits<char> >*, char const&)
Undefined symbol: google::LogMessageFatal::~LogMessageFatal()

Version

0.66.1

Output of react-native info

System:
    OS: macOS 11.6.1
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 656.85 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.17.4 - ~/.nvm/versions/node/v14.17.4/bin/node
    Yarn: 1.22.11 - ~/.nvm/versions/node/v14.17.4/bin/yarn
    npm: 6.14.14 - ~/.nvm/versions/node/v14.17.4/bin/npm
    Watchman: 2021.09.06.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.2 - /Users/vytautas/.rvm/gems/ruby-2.7.2/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.0.1, iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0
    Android SDK: Not Found
  IDEs:
    Android Studio: Arctic Fox 2020.3.1 Patch 3 Arctic Fox 2020.3.1 Patch 3
    Xcode: 13.1/13A1030d - /usr/bin/xcodebuild
  Languages:
    Java: 14.0.1 - /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

  • Create new app with react-native init;
  • Update Podfile:
    • Add use_frameworks!;
    • Remove use_flipper!();
  • Reinstall pods with pod install;
  • Archive the app.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:15

github_iconTop GitHub Comments

6reactions
VytautasLozickascommented, Nov 10, 2021

I’ve resolved the issue by dropping the armv7 support.

Added this to my Podfile:

post_install do |installer|
  ...

  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ARCHS'] = '${ARCHS_STANDARD_64_BIT}'
    end
  end
end

And set ARCHS = "${ARCHS_STANDARD_64_BIT}"; in the target’s build settings.

1reaction
rohail111commented, May 16, 2022

@gHashTag No need to remove the react-native purchase plugin all you have to do is just replace your pod file with following code.

post_install do |installer| react_native_post_install(installer) fix_library_search_paths(installer) end end

def fix_library_search_paths(installer) def fix_config(config) lib_search_paths = config.build_settings[“LIBRARY_SEARCH_PATHS”] if lib_search_paths if lib_search_paths.include?(“$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)”) || lib_search_paths.include?(“”$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)“”) # $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) causes problem with Xcode 12.5 + arm64 (Apple M1) # since the libraries there are only built for x86_64 and i386. lib_search_paths.delete(“$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)”) lib_search_paths.delete(“”$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)“”) if !(lib_search_paths.include?(“$(SDKROOT)/usr/lib/swift”) || lib_search_paths.include?(“”$(SDKROOT)/usr/lib/swift"")) # however, $(SDKROOT)/usr/lib/swift is required, at least if user is not running CocoaPods 1.11 lib_search_paths.insert(0, “$(SDKROOT)/usr/lib/swift”) end end end end

projects = installer.aggregate_targets .map{ |t| t.user_project } .uniq{ |p| p.path } .push(installer.pods_project)

projects.each do |project| project.build_configurations.each do |config| fix_config(config) end project.native_targets.each do |target| target.build_configurations.each do |config| fix_config(config) end end project.save() end end

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native app first archive after updated to Xcode 13.1
99. I change iOS deployment target to 9.0 and try to archive again. I got this error : xxx/ios/Pods/Headers ...
Read more >
Xcode 13 archive Error | Apple Developer Forums
Errors occur only when xcode13 is used for archive ... I use both Xcode 13.1 and Xcode 13.2 beta, but I still see...
Read more >
Troubleshooting - React Native
If running on device from Xcode, you can do this by updating ... If you encounter an error such as npm WARN locking...
Read more >
command phasescriptexecution failed with a nonzero exit ...
Xcode version 13. "react-native": "0.66.1",. enter image description here. error. Open side panel ... Unable to build ios archive at xcode and react...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found