Building/archiving for release hangs indefinitely in Xcode 11 - ios

I'm trying to release an iOS app - it builds fine on simulator or device in Xcode 11, and can be archived fine in Xcode 10, but when I try to archive it for release in the App Store the build hangs indefinitely. I hit Product > Archive, it completes 3960 out of 4040 steps, and then hangs in indefinitely at the stage of "Archiving Firebase/Firestore". This is happening on 4 different Xcode 11 versions - 3,6,7 and most recently the GM that was released earlier today.
I've tried flipping a bunch of the build settings - the Optimization flags, incremental/whole modules, enabling Bitcode, exclusive memory, and have also reinstalled Xcode with different 11 versions a few times. I've also tried this with various versions of cocoapods, including the Firebase/Firestore pod that is being compiled when the build hangs (i.e., I've used an old version and tried updating to the latest version of the pod) Nothing I've done has worked. Does anyone have any advice for other things I could try to stop this from hanging?

#leonluc-dev tracked this infinite loop down to a Swift compiler bug building the SwiftSoup CocoaPod.
Full description here.
See this answer for a screen shot of disabling optimization of Swift Soup to work around.

It seems to be a bug with Xcode 11. I reported the issue to the Firebase team over here:
https://github.com/firebase/firebase-ios-sdk/issues/3884#issuecomment-533663539
and I also reported the issue to Apple using feedback assistant (bug FB7303206). I'll update this answer when Apple responds.

If you're also using Firebase Crashlytics, moving
"${PODS_ROOT}/FirebaseCrashlytics/run"
after
"${PODS_ROOT}/FirebaseCrashlytics/upload-symbols"
in your Run Script phase should solve the issue.

Related

dyld`__abort_with_payload error and Thread 1 signal SIGABRT when running app on my iPad but runs fine on simulator [duplicate]

Every time I try to run this application it builds OK and installs, but as soon as it runs, the application breaks and prints this error message:
dyld: Library not loaded: #rpath/StandardCyborgFusion.framework/StandardCyborgFusion
Referenced from: /private/var/containers/Bundle/Application/2292CCF2-800F-4E28-AF10-A1B98081DD0A/StandardCyborgExample.app/StandardCyborgExample
Reason: no suitable image found. Did find:
/private/var/containers/Bundle/Application/2292CCF2-800F-4E28-AF10-A1B98081DD0A/StandardCyborgExample.app/Frameworks/StandardCyborgFusion.framework/StandardCyborgFusion: code signature invalid for '/private/var/containers/Bundle/Application/2292CCF2-800F-4E28-AF10-A1B98081DD0A/StandardCyborgExample.app/Frameworks/StandardCyborgFusion.framework/StandardCyborgFusion'
I saw many similar posts here and on the App Developer forums about this problem but no one has an explanation or a valid fix.
I tried:
Cleaning and building
Restarting XCode
Restarting the Mac
Completely resetting Keychain
Verifying all Keychain certs Trust settings are on "Use System Defaults"
Factory resetting my Mac
It appears to be an issue with my iOS device. The application can start on a simulator, but the simulator is not good for my development purposes so I need to make this work on my device. I recently updated my iPhone XR to iOS 13.3.1.
"Running new app on actual iOS (13.3.1) device crashes on startup: code signature invalid for "path/to/Flutter.framework/Flutter" #49504" seems to be the same issue.
I'm using XCode 11 and iOS 13.
This is an issue with iOS 13.3.1. All dynamic frameworks being compiled to the newest release of iOS 13.3.1 are experiencing this issue when run on a personal provisioning profile/developer account. The solution, copied from jmagman from Github, is below.
You can:
Use a non-Personal Team provisioning profile (paid developer account).
Run on the 13.3.1 simulator.
Test on a real iOS device running 13.3 or lower.
Install the beta profile on your test device and install iOS 13.4 beta 3. (Fixed)
Wait for iOS 13.4 to be released.
Hopefully this issue will be fixed soon.
I'm using CocoaPods, and for me this fixes the error (Wasa22's Answer on github issue):
Open the podfile
Comment out use_frameworks!
Add use_modular_headers!
In Terminal, do a pod update -> pod install
In Xcode, Clean (Command-Shift-K) -> Build and Run.
Source:
https://github.com/Alamofire/Alamofire/issues/3051
This appears to be fixed on iOS 13.4 beta 3. You can install the beta profile or wait for the release of iOS 13.4.
I see 2 way to fix it.
Downgrade to iOS 13.3. iOS 13.3.1 breaks third parties signature unless you have a paid developer account. If possible (get a cheap iphone dedicated to development)
Update Mac OS, Xcode, and iOS to latest Beta version (Update anyone of them alone will not work, because iOS beta requires latest Xcode beta, and Xcode requires latest Mac OS Catalina)
I had the same issue using a local framework. After hours of debugging, all I had to do what change the default "Do Not Embed" to "Embed & Sign" and the error went away. Worth a try! :)
If you run from Xcode you will see an error like:
/private/var/containers/Bundle/Application/D0BD5694-A7D6-4820-A146-
A49DF0C0F0B1/Runner.app/Frameworks/Flutter.framework/Flutter: code signature
invalid for '/private/var/containers/Bundle/Application/D0BD5694-A7D6-4820-
A146-A49DF0C0F0B1/Runner.app/Frameworks/Flutter.framework/Flutter'
solution provided by jmagman on Github
jmagman has escalated to Apple (FB7562472) and will let everyone know if they hear anything. more details on github
I encountered this issue when trying to build to my actual iOS device (but it worked fine in the simulator). I spent at least 10 hours trying to fix this bug. Tried everything in all the forums, nothing worked. But this is what finally worked for me!
Upgrading from iOS 13.3.1 to iOS 13.4.1
I couldn't have imagined this, but its true that iOS 13.3.1 breaks the third parties signature unless you have a paid developer account!
I had the same error message with GoogleUtilities.framework. My problem occurred when trying to run on the simulator. On the device, it ran fine. The problem is that CylancePROTECT antivirus software on my MacBook is quarantining the file and this causes the app to crash. Check if your device is running CylancePROTECT or some other antivirus software that is blocking the framework you need.
This is an Apple's problem. I solved this issue by upgrade my device to iOS 13.4.1
Also, if you don't want upgrade ios system,and you also use Podfile, you can do flow ways:
Comment out use_frameworks! in Podfile.
Add use_modular_headers!
pod deintegrate + pod install.
Clean (Command-Shift-K) -> Build and Run.

Xcode 11 GM Seed 2 freezes while building workspace/project

I have recently downloaded new Xcode 11 GM Seed 2 so that i can update my project to support Dark mode. (I am already on MacOS Catalina latest beta version-19A558d).
I have my project(workspace with pods) working 100% fine with Xcode 10.2. When I have started building same project with newly installed Xcode 11 GM Seed 2, It randomly freeze while building with title Building X of Y tasks. It randomly stops building any file at anytime. As per my different observations, It stops building while it is building library from my Pods.
I have already tried cleaning, manually deleting derived data files. Also, i have tried by reinstalling Xcode. Also restarted Mac to give try. All trial get failed. If anyone faced same issue and know the solution, please post here.
Disable the Swift Optimizer for SwiftSoup:
I were trying all day hard to solve this issue. Finally issue get resolved.
Actually i tried to build/compile the app via Terminal. Then i found that it got struck/freezed while compiling the files from installed 3rd party libraries from pods. The 3rd party library named SwiftSoup was making problem. Then i removed that pod, and commented out the code related to that. And tried compiling/building the app again. And It worked successfully this time.
UPDATE:
I followed #Paul's Answer, that works without removing pod, keeping same pod and code working. Just need to update settings as described by him. But make sure, that you need to change this setting every time you update your pods.

How to change Xcode sdk compiling version

I have tried to build an app through to the AppStore but they rejected it due to the app using sdk 11.4. Stating that it needs to use the updated version of 12.1.
The current Xcode I have installed is 10.1 or 10B61 which is the latest without making use of a Beta. I have searched through the settings trying to find how to update the sdk as well as maybe target that newer base SDK.
Things I have tried:
Searched for newer Xcode (stated above)
Searched through settings for the base SDK version number so it can be changed.
Went to AppStore to find any updates for Xcode (there were none)
Tried googling how to change/update the sdk, but none give an explicit answer on where this can be done. It merely states that Xcode 10 should come with a base SDK of 12.1, but that does not seem to be the case here.
Please note that this is not to target the minimum version. I know where that is and it is set accordingly. No issues there.
EDIT:
I have run $> xcodebuild -showsdks and it shows that sdk 12.1 is the sdk that is installed.
However, it seems that it is somehow overriding it to 11.4 when it is trying to build to AppStore. Not sure why.
The issue did not seem to be with Xcode itself but rather Bitrise that we were using to build and publish the app to the AppStore. Once the correct stack was selected for the building/publishing, it managed to build, however, we then found a different issue.
Using Xcode 10.1 we built the app in iOS 12.1, however, Bitrise seems to have an issue with React-Native third-party dependencies when it comes to Xcode 10.0+. It just doesn't seem to install them correctly and throws an error while compiling. (dependency: double-conversion)
The only advice we could find online was to downgrade xCode to 9.4 and then manually add the Device Support files (from targeted SDK to 12.1) to the app. This is something we don't want to do.
We are waiting for Bitrise to sort their stuff out, but in the meantime, we are looking into building straight from Xcode or Fastlane.

Xcode 8 no longer builds to device

I'm currently running Xcode 8.1 beta and have a stable release of Xcode 8 installed as well.Out of nowhere, without modifying any code inside the project, I am unable to build my project and run on a device.iOS version is 10.1 beta but the issue was not present when originally working with this version. Xcode 8 and 8.1 are experiencing the same issue and I previously did not have a problem running the project on a physical device.The provisioning profiles were up to date and I created new ones throughout the troubleshooting process.I have also gone through the basic troubleshooting options (restart the machine, restart the device, cleaned project, tried different lightning cable/USB port, reinstalled Xcode, and deleted Xcode preference files).The project builds and runs very quickly to the simulator and when attempting to run on the device I received no errors.When trying to run on a device, the build goes through the first tenth of the process and just sits there until I cancel it. I've even created new test projects to test against a known good and the issue persists.If anyone has experienced, a similar issue your insight would be greatly appreciated.
I was facing the same issue but installed latest Xcode 8.1 and issue got resolved
When you have multiple versions of Xcode installed the command line tools loses track of which Xcode to run. Make sure that this is set. Having multiple versions has always been troublesome for me.
The issue ended up being with a large number of dictionaries. The compiler was attempting to go through a rather large number of dictionaries and was unable to complete. I restructured my data model and the issue was resolved.

Xcode 7 ValidateEmbeddedBinary error Could not read data in foo-WatchKit-App.app

I am trying to do a full build on an iOS App with a WatchKit App as well.
When compiling the full project for Archive I am seeing the following
ValidateEmbeddedBinary DerivedData/lifa93/Build/Intermediates/ArchiveIntermediates/lifa93Dev/BuildProductsPath/Release-iphoneos/lifa93.app/Watch/lifa93-WatchKit-App.app
cd /Users/lordandrei/Projects/git/X7/lifa93
export PATH="/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
builtin-embeddedBinaryValidationUtility /Users/lordandrei/Projects/git/X7/lifa93/DerivedData/lifa93/Build/Intermediates/ArchiveIntermediates/lifa93Dev/BuildProductsPath/Release-iphoneos/lifa93.app/Watch/lifa93-WatchKit-App.app -signing-cert *9F…FB* -info-plist-path /Users/lordandrei/Projects/git/X7/lifa93/DerivedData/lifa93/Build/Intermediates/ArchiveIntermediates/lifa93Dev/InstallationBuildProductsLocation/Applications/lifa93.app/Info.plist
error: warning: Could not read data in /Users/lordandrei/Projects/git/X7/lifa93/DerivedData/lifa93/Build/Intermediates/ArchiveIntermediates/lifa93Dev/BuildProductsPath/Release-iphoneos/lifa93.app/Watch/lifa93-WatchKit-App.app
I have tried:
toggling between Debug and Release
toggling No Install and No Validate.
revoking and replacing all profiles (Signing, adhoc, dist)
So far nothing has made a dent.
Suggestions welcome as I am in a holding pattern trying to build.
Xcode: Version 7.0 beta 3 (7A152u)
iOS: 9.0 beta 3 (13A4293g)
Radar: 21975256
I had this issue when I was trying to build to my iPhone 6+ and Watch. I had just re-installed Xcode 7 Beta because I accidentally deleted one of the needed frameworks. I tried building several times and received the same "Could not read data..." error. I finally built to the simulator successfully, AND THEN built to both devices and it worked.
My issue now is that builds to Apple Watch seem to take forever to run or pass "Attaching...".
I don't know exact reason of your problem, but I created new project that includes WatchKit App target as well. And it works fine, no problems with building process.
I am using Xcode 7 beta (7A120f).
That's why I propose 3 potential ways to resolve the issue:
1. Create new new project from scratch and migrate source and resource files from your current project to new one. I had similar problems (it wasn't related to WatchKit app) previously and this trick helped me.
2. Install latest version of Xcode. Xcode 7 beta 4 is released on 21st of July.
3. Install Xcode (7A120f). This is version that I am using, you are using different one. I don't think that it will help, but who knows.

Resources