Xcode 13 Swift Package Manager Dependency Command CompileSwiftSources failed with a nonzero exit code Error - ios

I'm getting a build error when trying to build my Swift Package Manager package:
Command CompileSwiftSources failed with a nonzero exit code
This always occurs on the dependencies of my package such as KeychainSwift & ReactiveKit (tho I've seen it on other dependencies).
I have tried deleting derived data, restarting Xcode, restarting my computer, going to File > Packages > Reset Package Caches, tried on both Xcode 13.2 beta 2 & Xcode 13.1. Additionally I have verified that my package dependencies are up to date, with no success.

Turns out as I was writing this question, I decided to create a new package to see if I could reproduce it. Just copying the Package.swift file worked fine and didn't reproduce the error.
But after copying my path/source files I got a completely different error about how I can't use macOS storyboards in an iOS target.
On that example project I was able to add the following to the target:
exclude: [
"ViewControllers/macOS"
],
This fixed the build issues on that example package. So I replicated that on the primary package, and it worked perfectly, no build errors.
I have absolutely no idea why Xcode showed a random error message instead of a detailed one that could help me debug further. But hopefully this advice helps someone. Try creating a brand new package, and seeing if that produces a better error message, and ensure that you aren't mixing platform specific code into one target.

Related

XCode build error /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

I am trying build an IOS app written in ReactNative. The application written using XCode 11.4. Then I got a new Macbook with XCode version 12.5 installed. So I cloned the project from the git and run npm install and tried to run the project using XCode. Then I got the following error.
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
I checked any issues as suggested by the accepted answer in this link,https://stackoverflow.com/questions/10373016/command-xcode-app-contents-developer-toolchains-xcodedefault-xctoolchain-usr-bi. But there is nothing wrong with it.
Also, I tried cleaning the project and building the project again. It did not solve the problem as well.
Then I tried deleting the project targets that are for tests well and tried to clean and build the project again. But it did not work either.
I tried deleting everything in the Derived Data folder and tried building the project again as well. It did not work either.
When expand the log, this is the error I am seeing.
In file included from /Users/xandasupport/Desktop/Wais/PCL/pcl-app/node_modules/react-native/ReactCommon/jsi/JSIDynamic.cpp:6:
In file included from /Users/xandasupport/Desktop/Wais/PCL/pcl-app/node_modules/react-native/ReactCommon/jsi/JSIDynamic.h:8:
/Users/xandasupport/Desktop/Wais/PCL/pcl-app/node_modules/react-native/React/../third-party/folly-2018.10.22.00/folly/dynamic.h:63:10: fatal error: 'boost/operators.hpp' file not found
#include <boost/operators.hpp>
^~~~~~~~~~~~~~~~~~~~~
1 error generated.
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
Why am I getting that error and I can I possibly fix it?

Flutter App can't run on IoS simulator with cycle inside runner, and domain=NSPOSIXErrorDomain, code=63

I am having problems since the IoS 14 update. At first it was the deployment target 8.0 and it could temporalily fixed by updating GoogleInfoPlist every time I pulled from our repo in Git. but after a while this temporary fix doesn't work anymore. I got header problem for my FlutterFire plugins.
warning: double-quoted include "FLTFirebaseCorePlugin.h" in framework header, expected angle-bracketed instead [-Wquoted-include-in-framework-header]
#import "FLTFirebaseCorePlugin.h"
^~~~~~~~~~~~~~~~~~~~~~~~~
<firebase_core/FLTFirebaseCorePlugin.h>
I have updated my deprecated Firebase core,auth and firestore plugin to the newest one with the help of the flutterfire migration guide. after that the firebase plugin problem was fixed. but i still got problems with 2 plugins: Google Maps Flutter and Image Picker. Waht i did to fix the problem was updating Cocoapods to the beta version for the Google Maps plugin but ther was still a problem with the image picker for the moment i deleted the plugin form my app.
After that i got 3 errors. the first one is the CodeSign cycle inside Runner Error :
error: Cycle inside Runner; building could produce unreliable results.Target 'Runner': CodeSign /Users/user/StudioProjects/app/build/ios/Debug-iphonesimulator/Runner.app
○ Target 'Runner' has copy command from '/Users/vaisatriani/StudioProjects/kuliner_11_app/build/ios/Debug-iphonesimulator/Runner.app' to
I searched for a fix and i found that flutter clean can fix that error. The error did go away but one new error popped out :
error: '/Users/Username/StudioProjects/appname/build/ios/Debug-iphonesimulator/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/GoogleService-Info.plist' is longer than filepath buffer size (1025). (in target 'Runner' from project 'Runner')
And i somehow fixed it by removing Runner as Target from Product in XCode. but now i'm stuck with this one error.
Unable to install /Users/user/StudioProjects/app/build/ios/iphonesimulator/Runner.app on FFF556AF-19DB-4B7B-93BF-A67EE0EA8621. This is sometimes caused by a malformed plist file:
ProcessException: Process exited abnormally:
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=63):
copyfile of file:///Users/user/StudioProjects/app/build/ios/iphonesimulator/Runner.app/ to file:///Users/user/Library/Developer/CoreSimulator/Devices/FFF556AF-19DB-4B7B-93BF-A67EE0EA8621/data/Containers/Shared/SystemGroup/systemgroup.com.apple.installcoordinationd/Library/InstallCoordination/PromiseStaging/EF2DB4B2-5512-4C14-BCA3-FA7667170000/Runner.app failed: File name too long
Unhandled error domain NSPOSIXErrorDomain, code 63
Command: /usr/bin/xcrun simctl install FFF556AF-19DB-4B7B-93BF-A67EE0EA8621 /Users/user/StudioProjects/app/build/ios/iphonesimulator/Runner.app
I couldn't fix it by deleting Derived Data. Does somebody knows how to fix this?? i'm stuck with this problem for a while now. Any help would be appreciated. Thank you so much.
Found a fix for this error. what i did was to reset the simulator (Device -> Erase All Content and Settings), and then run $ flutter clean after that rebuild your app.
delete → Runner.xcworkspace → xcuserdata folder
delete → Pods folder on inside ios folder
delete → ios → flutter → Flutter.podspec
run flutter clean
flutter run

Xcode Swift Parse Framework Installation Issue (Command PhaseScriptExecution failed)

I'm having lots of trouble installing the 'Parse' Cocoapod library/framework on Xcode. (version 10.3)
What I did:
After initializing a podfile with "pod init", and adding "pod 'Parse'" into the file, I ran "pod install" from terminal and integrated the pod into Xcode. There are no compiler errors and the pod library is showing up and looking fine with autocomplete working on it as well
The issue:
Upon trying to run the app, it gives me an error:
Command PhaseScriptExecution failed with a nonzero exit code
More specifically, it gives me:
[filepath].../Pods-Real Estate App-frameworks.sh: eval: line 131: unexpected EOF while looking for matching `''
Things I've tried already:
Completely reinstalling and reintegrating pods
Restarting Xcode
Restarting my computer
Unlocking and relocking the login keychain
I tried installing pods and bolts just by downloading the framework files but they generated different errors (I think because the two frameworks weren't linked together properly doing it that way? I couldn't figure out how to fix that either)
Weird solution that I don't even know how I came across:
The issue was that a directory that contained my project had an apostrophe in it. I fixed it by renaming the directory, and then deleting the derived data folder in my project, cleaning the project and then running it.

Xcode 8.3 Archive error: Linker command failed with exit code 1

I started getting this error only after upgrading from Xcode 8.2 to Xcode 8.3, and only when making an archive build (debug builds work fine).
When I do the archive via Xcode, the only message I get is "Linker command failed with exit code 1 (use -v to see invocation).
I build with the command line xcodebuild -scheme MyProduct
When I built this way, I found a number of issues (again, only when doing Archive):
I had to add import UIKit to practically every swift file.
all the pods had issues
remove everything from app-Bridging-Header.h
add a few things back into app-Bridging-Header.h
My current issue is with the AWS pod, using version 2.5.3
So my app-Bridging-Header.h has #import <AWSS3/AWSS3.h>
Here is the error from the command line build:
error: 'AWSS3/AWSS3.h' file not found with <angled> include; use "quotes" instead
#import <AWSS3/AWSS3.h>
^
The error log continues after that. I also tried the crazy suggestion of switch in the import to "AWSS3/AWSS3.h"...that didn't work either.
What is going on?
More INFO
This really appears to be an issue with one of my pods. I built a new solution, imported a subset of my pods and everything built. Then when I updated with the full list of pods it broke.
For me it is coming due to Bitcode enable in my project and i have used a custom framework with disabled bitcode.
Two things you can do :
Either disable bitcode in your project
OR
Build framework with bitcode enable
NOTE: If you click on error and it doesn't show anything then right click on error and select Reveal in Log. You will get error for this issue
At long last I was able to figure out this was a pod issue...just had to figure out which one it was.
I created a brand new project and started adding my pods in one by one (actually, 3 by 3...one by one would have taken too long).
Conclusion: localytics 4.3.1 has a bug in it somewhere. I downgraded to 4.3.0 and the problem went away.
I got a problem like this. My suggestion is that you should remove the version of 8.3 and download any old version from this link: https://developer.apple.com/download/more/
I hope that it will work.

Xcode from Unity: "Linker command failed with exit code 1 (use -v to see invocation)"

I am getting a "Linker command failed with exit code 1 (use -v to see invocation)". As far as I understand, it is telling me that I am missing some framework.
1. I have added all the frameworks manually:
:
After cleaning and trying again, the error still persists but it complains about another framework!
2. I have also set the 'Search Path' in 'Build Settings' to recursive:
Every time I try and built it on my ipad I get the same error but complaining about a different framework despite 1&2. Has come across this?
I am working on Xcode Version 7.3.1
The error screenshot:
Directort Structure:
UPDATED Search Path:
I think that Can You check Project Target>Buil Phases>Link Binary with librarys in more than one time it is define or podfile is define multiple time some frameworks.
I was having the same issue w/ my project. I install my pods via CocoaPods, once I open up the workspace project created, I import the modules to the file. At first there will be an error, but once you Build the project, it will sweep the error. That's how I fixed my issue.
In the end, removing the all the problematic frameworks (those starting with QT) allowed me to build the app and didn't cause any noticeable issues. Its not a particularly satisfying solution, but it worked ...

Resources