Project build fails on Xcode 12, tips appreciated

Bitrise Build Issue Report template

Description of the issue

My react native project build is failing during build phase with the following error:

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

I have tried several approaches to fix this problem with not avail, i’ve been struggling with this problem for the last 2 days and I’m not able to fix it on my own.

This is probably something others have also faced when upgrading to Xcode 12, so I’d love to know more if someone have gone through this, I’m currently very frustrated with looking at a build error log that is not very detailed enough to point me in the right direction and I have a very tight deadline now.

Here is the project package.json: { "name": "regroop", "version": "0.0.1", "private": true, "scripts": - Pastebin.com

One important thing to notice
For some reason, after the project is installed (yarn install + pod install) several project files are changed by pod install, see below:
image
I was really not expecting Xcode to need to make those changes, but thats probably related.
The most striking changes for me are:

  1. Pods.pbxproj / project.pbxproj is basically entirely changed
  2. Pods-regroop.[release/debug].xcconfig changed the libraries search path, why would Xcode need to change that is a mistery to me, see below

Caching could help me…
I have the cache steps enabled, maybe they are not well configured, but the build time for this project is around staggering 70 minutes. I am connecting remotely to the machine through VNC to have a look around but from the time the build fails to the 90 minute timeout I have a very short window to investigate, If I could decrease the build time drastically I could try to run the build on the machine in xcode directly, that probably would help.
Any tips on how to cache node modules and Pods folder?

Environment:

Xcode 12.4.x macOS 10.15.7
PS: I could try another XCode12 stack combination, but I’m using this as a colleague has the same stack and is able to run the project locally

Which build Step causes the issue and which version of the step?

running fastlane build_app for distribution

Reproducibility

This issue does not happen on my machine but it’s not so relevant as it’s a different stack( Macos Catalina 10.15.3 with Xcode 11.7)

I’m not using cache, don’t think that is the problem.
Rebuild does not help, I tried serveral times
The issue happens every time

Local reproduction

Not sure about local reproduction, a colleague is able to build this project on his machine, but I’m not assuming this is guaranteed for everyone, I’m not sure how he achieved this.

Build log

I was able to fix my problem after adding this to my podfile:

post_install do |installer|
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
        config.build_settings["ONLY_ACTIVE_ARCH"] = "YES"
      end
    end
  end

Then I noticed that the Pods folder was committed by accident to this project, and just making a new pod install did not update the necessary files to allow the project to build and link correctly.
So I deleted the Pods folder and also Podfile.lock to allow the server to create all those by its own.

Last but I’m not sure if that was a problem or not, but seems more correct to me, there was a .ruby-version file on the project root folder, created by rbenv while developing locally, and also removed that file in order to allow the default ruby version of the build machine to do the pod install.

Everything works after that, hope it helps someone

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.