Bot lipo error in Mac PRO - ios

We are developing an ios app with cocoapods. We have more than 60 pods and build times are around 1 hour using bots.
We have a Mac PRO machine with XCode 9.2 and Cocoapods 1.4.0 to build the app. The bot (archive and export ipa) fails intermittently while archiving. The error is related to lipo not finding a pod like this one:
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't move temporary file: /Users/admin/Library/Caches/XCSBuilder/Bots/a179c8572b00bdeb1f9bbce2d702aadd/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/SCHEME/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/somePod.framework/somePod to file: /Users/admin/Library/Caches/XCSBuilder/Bots/a179c8572b00bdeb1f9bbce2d702aadd/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/SCHEME/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/somePod.framework/somePod.lipo (No such file or directory)
The strange thing is that the error is not thrown always by the same pod. So we have different builds with lipo errors related to different pods.
Even more strange, a build using a Mac mini always works using also a bot.
We are guessing Mac Pro could be using threads in a different way than Mac Mini, but we don't have any way to check this.
Is there any limitation to lipo for large apps? Is there any configuration or tunning for the Mac Pro? Has anybody experienced this kind of issue?

Thanks to Jacek Suliga (Linkedin) we realized that our pod dependency tree was not set up properly. In the Mac PRO, builds are faster and parallelization becomes more relevant than in a Mac mini. In our case, a pod was built before its pod dependencies due to this parallelization. Since parallelization depends on more items than just code, hence the intermittent build failures.
In particular, we removed some pod subspecs and created dedicated podspec files.

Related

Xcode commands are taking a long time within Flutter projects

Some context
I'm working with Flutter, but after doing a couple of changes to the iOS Podfile, .plist files, and Runner.xcworkspace things "stopped" working. The problem I'm having is that everything Xcode related is taking a very long time to run in all of my Flutter projects.
To give some context the app I was building when Xcode started giving me problems uses Cloud Firestore. For this to compile faster I added the following code to my Podfile, this was suggested by Google in some docs.
platform :ios, '16.1'
target 'Runner' do
# Code to reduce compile time for iOS.
pod 'FirebaseFirestore/WithLeveldb', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '10.2.0'
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
After doing this change and importing the Firestore package a file called GoogleService-Info.plist was created and I added this file to the Runner.xcworkspace as a Runner. This step was mentioned in another Google document for activating sign-in with Google.
A weird thing about all of this is that if I try to run open Runner.xcworkspace the Xcode app also takes forever to open (it's been over an hour since I ran it and it has not been opened). This worked earlier as I was able to open this directory to make the aforementioned change (make GoogleService-Info.plist a Runner file).
Attempts to solve this
After identifying the error I tried doing the following things, but nothing has worked so far:
Uninstall Xcode Command Line Tools and install them back on.
Uninstall Flutter and install it back on.
Uninstall Xcode completely and install it back on.
Restart my computer.
Try to build the project in another computer, but now this other computer is having the same issue.
I've tried to run things on both an Intel-based Mac and an Apple Silicon Mac, but in both computers Xcode "stopped" working for Flutter.
Reproducing this problem
The problem occurs when I try to run flutter clean, flutter run, or open Runner.xcworkspace. After running the first two commands in --verbose mode the problem comes up when the following commands appear:
xcrun xcodebuild -list
xcrun xcodebuild -workspace $PATH/Runner.xcworkspace -scheme Flutter Assamble clean
xcrun xcodebuild -workspace $PATH/Runner.xcworkspace -scheme Runner clean
The first command is currently running on the Apple Silicon Mac and its already been over an hour since it's been stuck there (Intel-based Mac already finished running this command). The second command follows the first one and it took over 20 minutes for it to run in the Intel computer. The third command is currently running on the Intel-based computer and it's been there for over 40 minutes.
Final details
This problem is persistent in all of my Flutter projects, it doesn't matter if the project has the Firebase packages or not. I don't know what I could have changed in my Xcode configuration for things to stop working so abruptly, but I hope someone is able to help me out.
P.S. I already tried compiling a native Swift project and everything seems to work, this issue seems to affect the Flutter projects exclusively. Obviously if I try to run the commands listed earlier outside of the Flutter execution they take a very long time as well.
After running more tests I realized that the problem was iCloud. For some reason working on both computers at the same time made my local computers work very slowly. The problem was hard to find because the iCloud bird process didn't appear to use more resources than it usually would.
To solve this I had to kill iCloud on both computers and restart the service. I recently updated both computers to Ventura 13.0.1 so I think the problem might be somewhere along those lines.

Xcode Cloud fail on ci_post_clone.sh

Couldn't find enough information about Xcode cloud and is wondering if anyone is facing any issues using cocoapods with Xcode cloud.
I am aware that I need to add a file called ci_post_clone.sh if I have cocoapods.
Almost every time, my Xcode cloud build will fail on the ci_post_clone.sh script where according to the log, installing some cocoa pod fail. And the cocoa pod fail varies, each time, a different cocoapod will fail.
For example, below is the log. I never have problem getting AMPopTip, GooglePlaces error, and this is the first time.I am aware that AMPopTip SDK is quite old and its not updated regularly.
I am just trying to understand how common this problem is and how have any of you bypass it.
Some of the things I have done is,
Clean, rebuild via Xcode Cloud
Run multiple times, each time, error varies and if I am lucky, the build will succeed. So far, I only manage to get 1 successful build out of 5 tries.
First build
Second build
Third build
Xcode cloud environment are
Xcode version: 13.4.1
macOS version: macOS Monterey 12.4
Local machine environment are
Xcode version: 13.4.1
macOS version: macOS Monterey 12.4
cocoapods version 1.11.3

XCode 12.5 w/ MacOS 11.3 - Fails to Archive: Illegal Instruction: 4

This question has been asked a few times in the past, but none of those answers seem to match what is currently going on.
I have an app (SwiftUI) that builds, runs, tests fine on simulators and devices. But when attempting to Archive for iOS and/or MacOS, the archiving fails with a vague error "Illegal instruction: 4". The compiler then lists a bunch of files and directories which offer no help.
ERROR MESSAGE SNIPPET:
CompileSwift normal arm64 (in target 'App Name' from project 'App Name')
...Lists a bunch of directories
error: Illegal instruction: 4 (in target 'App Name' from project 'App Name')
The weird thing is that prior to the XCode and MacOS update, this app will Archive fine. So I am left to assume something was deprecated in this latest release.
My question is: What are some debugging tools to help me start to find where in my code this may be happening? Why would the app build and run fine on simulators and devices but not Archive? makes no sense to me.
I did test this by attempting to Archive on another MacBook with MacOS 11.0.1 and XCode 12.2, and it Archives fine.. Although, this is really useless since you cant upload a binary compiled with an older version of XCode.. *I was able to upload the binary using the older Xcode version, not sure if it will let me release this, but I will try that for now.
I have considered deleting and reinstalling XCode, but I don't know if that would be a waste of time. Maybe something didn't update properly?
At a loss. Any insight is appreciated.
update
When I edit the scheme and change Archive from Release to Debug, it Archive's?!
What am I missing?
2nd update:
When changing the build settings, under the Project, Swift Compilier, Code Generation, Optimization level from Optimize for Speed -O to No Optimization -Onone, the app Archives with no issues.

Xcode build error when building onto device - Library not found for -lDoubleConversion

So my app has run and built successfully on the Xcode simulators. The app is a react native app
However when trying to put it onto a device I get the error.
What steps do I need to take to get this to work?
Library not found for -lDoubleConversion
Notes:
-I am running the Xcode workspace file
-I did try use_framework! in the Podfile but I don't think that was right and caused more issues
also tried adding it to the podfile
The reason I had this error is that my iOS version required in my podfile was not the same as that as the min version in xcode.
The error generated by xcode wasn't helpful in this case and pretty ambiguous given the range of answers on the internet

MongoSwift Pod contains 100 compiler errors. Unable to build after install

I have an iOS app I am planning on integrating with MongoDB. After installing the pod files, upon build I get about 100 errors and I'm not really sure what's causing it or how to fix them.
Added a screenshot of some of the errors. They are all almost exactly the same.
I have tried reinstalling the MongoDB cocoapod (pod 'StitchSDK', '~> 5.0.0') With the same results.
I'm using Xcode 10.2, set Swift language to 4.0, iOS target build to 11.0 (I may have done these completely wrong though.)
Expecting to be able to build the app with no errors.
You can now use the latest version, StitchSDK 6.0.0.
You will need to wait for the SDK to be updated. Meanwhile, you can download a previous version of Xcode. You will be able to test iOS apps with iOS 12.1.4, but NOT 12.2 and up
https://github.com/mongodb/stitch-ios-sdk/issues/156.

Resources