Carthage prevents Xcode 9.2 from building - ios

I have been experimenting on a project with using Carthage.
Having installed Carthage I then attempted to add Nimble and Quick to the project through Carthage.
However, I get the following on carthage update:
user$ carthage update
*** Fetching Quick
*** Fetching Nimble
*** Checking out Nimble at "v5.1.1"
*** Checking out Quick at "v1.2.0"
*** xcodebuild output can be found in /var/folders/g_/h57q7zyj569cgs2rryp8cmk40000gp/T/carthage-xcodebuild.YUIvqk.log
*** Building scheme "Nimble-iOS" in Nimble.xcodeproj
Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild -project /Users/user/nbrownapp/Carthage/Checkouts/Nimble/Nimble.xcodeproj -scheme Nimble-iOS -configuration Release -derivedDataPath /Users/user/Library/Caches/org.carthage.CarthageKit/DerivedData/9.2_9C40b/Nimble/v5.1.1 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/g_/h57q7zyj569cgs2rryp8cmk40000gp/T/Nimble SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO (launched in /Users/user/nbrownapp/Carthage/Checkouts/Nimble)
This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/g_/h57q7zyj569cgs2rryp8cmk40000gp/T/carthage-xcodebuild.YUIvqk.log
The project itself fails to build with numerous Shell Script Invocation Errors. Uninstalling Carthage, removing the Cartfile, Cartfile.resolved and the Carthage folder from the project and deleting the script leads to the project building without any errors. However, I would like to use Carthage and can't see why I can't get it to build the dependencies? Or why the project won't build when Carthage is installed?
If I remove the above and try again I get the same error.
I've been following the Ray Wenderlich example:
https://www.raywenderlich.com/165660/carthage-tutorial-getting-started-2
Any help would be appreciated.

Related

Framework build failed with cocoapod pod lib lint with xcode 12.0

I try to update a existing pod, but when I did pod trunk push NAME.podspec, I got this error :
I try several solution from this post Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64_ but none worked(excluded architecture, only active arch).
There is no problem when I run the compilatiton on Xcode, my framework is well generated. The only problem is when I try to pod trunk, or pod lib lint
In my xcode project, In build phase, I run that script :
xcodebuild -target "${​TARGET_NAME}​" -configuration ${​CONFIGURATION}​ -sdk iphonesimulator -arch x86_64 -arch i386 ONLY_ACTIVE_ARCH=NO EXCLUDED_ARCHS="arm64" BUILD_DIR="${​BUILD_DIR}​" BUILD_ROOT="${​BUILD_ROOT}" clean build
If I put ONLY_ACTIVE_ARCH=TRUE, the error message is a bit different :

Error building Alamofire and Texture in same Cartfile using Xcode 10.1 + Carthage

I have an iOS project that uses both Alamofire and Texture. I haven't been able to build both at the same time using Carthage and Xcode 10.1.
With carthage update --platform ios, Alamofire fails with "thread-local storage is not supported for the current target"
With #Saik0s workaround script, Alamofire fails with no message at all (log below)
Has anyone else had success with Carthage, Alamofire, and Xcode 10.1?
Empty project exhibiting the failure is at github/kenstir/swift-samples/SadCarthage
Carthage Output
macken:SadCarthage kenstir$ ./carthage-update
*** Cloning Alamofire
*** Cloning texture
*** Cloning PINCache
*** Cloning PINRemoteImage
*** Cloning PINOperation
*** Cloning libwebp
*** Checking out Alamofire at "4.7.3"
*** Checking out PINCache at "3.0.1-beta.6"
*** Checking out texture at "2.7"
*** Checking out PINRemoteImage at "3.0.0-beta.13"
*** Checking out PINOperation at "1.1.1"
*** Checking out libwebp at "v0.6.0"
*** Downloading PINOperation.framework binary at "Just fixing some warnings"
*** Downloading PINCache.framework binary at "3.0.1-beta.6"
*** Downloading PINRemoteImage.framework binary at "3.0 beta 13: Animated WebP support / better GIF handling"
*** xcodebuild output can be found in /var/folders/r7/c4y6r2q156xbl58p59x61_740000gr/T/carthage-xcodebuild.H7FuEl.log
*** Building scheme "Alamofire iOS" in Alamofire.xcworkspace
Build Failed
Task failed with exit code 4:
/usr/bin/xcrun xcodebuild -workspace /Users/kenstir/Documents/xcode/swift-samples/SadCarthage/Carthage/Checkouts/Alamofire/Alamofire.xcworkspace -scheme Alamofire\ iOS -configuration Release -derivedDataPath /Users/kenstir/Library/Caches/org.carthage.CarthageKit/DerivedData/10.1_10B61/Alamofire/4.7.3 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/r7/c4y6r2q156xbl58p59x61_740000gr/T/Alamofire SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/kenstir/Documents/xcode/swift-samples/SadCarthage/Carthage/Checkouts/Alamofire)
This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/r7/c4y6r2q156xbl58p59x61_740000gr/T/carthage-xcodebuild.H7FuEl.log
xcodebuild log
macken:SadCarthage kenstir$ cat /var/folders/r7/c4y6r2q156xbl58p59x61_740000gr/T/carthage-xcodebuild.H7FuEl.log
/usr/bin/xcrun xcodebuild -workspace /Users/kenstir/Documents/xcode/swift-samples/SadCarthage/Carthage/Checkouts/Alamofire/Alamofire.xcworkspace -scheme Alamofire\ iOS -configuration Release -derivedDataPath /Users/kenstir/Library/Caches/org.carthage.CarthageKit/DerivedData/10.1_10B61/Alamofire/4.7.3 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/r7/c4y6r2q156xbl58p59x61_740000gr/T/Alamofire SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/kenstir/Documents/xcode/swift-samples/SadCarthage/Carthage/Checkouts/Alamofire)User defaults from command line:
IDEArchivePathOverride = /var/folders/r7/c4y6r2q156xbl58p59x61_740000gr/T/Alamofire
IDEDerivedDataPathOverride = /Users/kenstir/Library/Caches/org.carthage.CarthageKit/DerivedData/10.1_10B61/Alamofire/4.7.3
Build settings from command line:
CARTHAGE = YES
CLANG_ENABLE_CODE_COVERAGE = NO
CODE_SIGN_IDENTITY =
CODE_SIGNING_REQUIRED = NO
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO
ONLY_ACTIVE_ARCH = NO
SDKROOT = iphoneos12.1
SKIP_INSTALL = YES
STRIP_INSTALLED_PRODUCT = NO
Build settings from configuration file '/tmp/static.xcconfig.30m4Ve':
ONLY_ACTIVE_ARCH =
Update
I took a clue from the above message ONLY_ACTIVE_ARCH = (empty), so I edited the carthage-update script like so:
--- SadCarthage/carthage-update
+++ SadCarthage/carthage-update
## -8,7 +8,8 ## IFS=$'\n\t'
xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
trap 'rm -f "$xcconfig"' INT TERM HUP EXIT
-echo "ONLY_ACTIVE_ARCH[sdk=iphonesimulator*] = YES" >>$xcconfig
+echo "ONLY_ACTIVE_ARCH = YES" >>$xcconfig
export XCODE_XCCONFIG_FILE="$xcconfig"
+cat $xcconfig
carthage update --platform ios $#
Now it builds! I'm not convinced this is the final answer but it's working so far for me.

Weird Build Error: Facebook Swift SDK not building with Carthage in Blank project

Brand new ios project
NOTHING in the folder besides an empty view controller with base setup
touch Cartfile
added github "facebook/Facebook-SDK-Swift" to Cartfile
Ran carthage bootstrap --platform iOS --cache-builds
Got the following error message:
*** Checking out Bolts-ObjC at "1.9.0"
*** Checking out Facebook-SDK-Swift at "0.4.0"
*** Checking out facebook-objc-sdk at "sdk-version-4.36.0"
*** No cache found for Bolts-ObjC, building with all downstream dependencies
*** xcodebuild output can be found in /var/folders/0p/lqn6hy6s1d9389yjr_1b8jnw0000gn/T/carthage-xcodebuild.RN4jiZ.log
*** Building scheme "Bolts-iOS" in Bolts.xcodeproj
*** Building scheme "Bolts-iOS-Dynamic" in Bolts.xcodeproj
*** Building scheme "FBSDKCoreKit-Dynamic" in FacebookSDK.xcworkspace
*** Building scheme "FBSDKCoreKit-Universal" in FacebookSDK.xcworkspace
Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild -workspace /Users/keitzer/src/test/Test/Carthage/Checkouts/facebook-objc-sdk/FacebookSDK.xcworkspace -scheme FBSDKCoreKit-Universal -configuration Release -derivedDataPath /Users/keitzer/Library/Caches/org.carthage.CarthageKit/DerivedData/10.0_10A255/facebook-objc-sdk/sdk-version-4.36.0 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/0p/lqn6hy6s1d9389yjr_1b8jnw0000gn/T/facebook-objc-sdk SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/keitzer/src/test/Test/Carthage/Checkouts/facebook-objc-sdk)
This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/0p/lqn6hy6s1d9389yjr_1b8jnw0000gn/T/carthage-xcodebuild.RN4jiZ.log
Any ideas why this might be happening?
Carthage Version: 0.31.1
Xcode 10, App Store version
macOS 10.14 Mojave
In my case it was SwiftLint (v. 0.29.3) preventing the Facebook Swift SDK from building.
It was installed in my system via Brew.
Removing SwiftLint as a temporary solution helped.
P.S.
To uninstall all versions of SwiftLint run this command in the Terminal:
brew uninstall --force swiftlint

Carthage Build Failed after updating swift to version 4.0

Carthage build failed after updating swift to version 4.0 from version 3.2.
Here are the results of using the carthage update --platform iOS.
*** Fetching AlamofireImage
*** Fetching FSCalendar
*** Fetching Alamofire
*** Fetching ActiveLabel.swift
*** Fetching Toaster
*** Fetching PopupDialog
*** Fetching DKImagePickerController
*** Checking out DKImagePickerController at "3.6.1"
*** Checking out PopupDialog at "0.5.4"
*** Checking out Toaster at "2.1.0"
*** Checking out ActiveLabel.swift at "0.8.0"
*** Checking out Alamofire at "4.5.1"
*** Checking out FSCalendar at "2.7.9"
*** Checking out AlamofireImage at "3.3.0"
*** xcodebuild output can be found in /var/folders/6z/c0myz1fn4rsgy842p9vqqr700000gn/T/carthage-xcodebuild.my2Am1.log
*** Building scheme "ActiveLabel" in ActiveLabel.xcodeproj
Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild -project /Users/poqw/Documents/GitHub/nyg-ios/Carthage/Checkouts/ActiveLabel.swift/ActiveLabel.xcodeproj -scheme ActiveLabel -configuration Release -derivedDataPath /Users/poqw/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0_9A235/ActiveLabel.swift/0.8.0 -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES build (launched in /Users/poqw/Documents/GitHub/nyg-ios/Carthage/Checkouts/ActiveLabel.swift)
This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/6z/c0myz1fn4rsgy842p9vqqr700000gn/T/carthage-xcodebuild.my2Am1.log
And then $ tail /var/folders/6z/c0myz1fn4rsgy842p9vqqr700000gn/T/carthage-xcodebuild.my2Am1.log
I got this :
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:~/.local/bin:/usr/local/bin:/Users/poqw/miniconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Wireshark.app/Contents/MacOS:/opt/local/bin"
/usr/bin/ditto -rsrc /Users/poqw/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0_9A235/ActiveLabel.swift/0.8.0/Build/Intermediates.noindex/ActiveLabel.build/Release-iphoneos/ActiveLabel.build/Objects-normal/armv7/ActiveLabel.swiftdoc /Users/poqw/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0_9A235/ActiveLabel.swift/0.8.0/Build/Products/Release-iphoneos/ActiveLabel.framework/Modules/ActiveLabel.swiftmodule/arm.swiftdoc
** BUILD FAILED **
The following build commands failed:
CompileC /Users/poqw/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0_9A235/ActiveLabel.swift/0.8.0/Build/Intermediates.noindex/ActiveLabel.build/Release-iphoneos/ActiveLabel.build/Objects-normal/armv7/ActiveLabel_vers.o /Users/poqw/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0_9A235/ActiveLabel.swift/0.8.0/Build/Intermediates.noindex/ActiveLabel.build/Release-iphoneos/ActiveLabel.build/DerivedSources/ActiveLabel_vers.c normal armv7 c com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/poqw/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0_9A235/ActiveLabel.swift/0.8.0/Build/Intermediates.noindex/ActiveLabel.build/Release-iphoneos/ActiveLabel.build/Objects-normal/arm64/ActiveLabel_vers.o /Users/poqw/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0_9A235/ActiveLabel.swift/0.8.0/Build/Intermediates.noindex/ActiveLabel.build/Release-iphoneos/ActiveLabel.build/DerivedSources/ActiveLabel_vers.c normal arm64 c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)
And Here is What I have done for fix this problem.
Delete derived Carthage Cache.
Delete Carthage directory in project.
Uninstall Carthage and install again.
Download Xcode 8.3.2 and xcode-select --switch /Applications/Xcode8.app/Contents/Developer and use the xcrun command to make sure that the version has been changed to swift 3.0 and then update Carthage.
Clean Project and rebuild
Restart Xcode
I would appreciate if anyone can help me.
I'm using Xcode 8.3.1 and this is what I followed:
Deleted derived data.
Removed Carthage folder: rm -r ./Carthage
Updated Cartfile with:
github "facebook/facebook-sdk-swift" "master"
github "facebook/facebook-ios-sdk" "sdk-version-4.21.0"
Run Carthage command:
carthage update --platform iOS --no-use-binaries
Mac Senour’s solution didn't work for me; what worked was cleaning derived data of CarthageKit here: /Library/Caches/org.carthage.CarthageKit/DerivedData/

UberRides Carthage Issue

I want to use UberRides SDK in Objective-C Project. I checked pod for objective c but it is not available. So i tried Carthage.
Here is my Cartfile:
# UberRides
github "https://github.com/uber/rides-ios-sdk" ~> 0.5
I use carthage update --platform iOS this command to installation and i am using xCode 8. But after some installation i am getting some error and i don't know how to handle so please help me.
Here is log of terminal:
*** Fetching rides-ios-sdk
*** Fetching ObjectMapper
*** Checking out ObjectMapper at "1.5.0"
*** Downloading rides-ios-sdk.framework binary at "v0.5.2"
*** Checking out rides-ios-sdk at "v0.5.2"
*** xcodebuild output can be found in /var/folders/mt/_rpb6s913b54yl1gfk0dt2qh0000gn/T/carthage-xcodebuild.orgg88.log
*** Building scheme "ObjectMapper-iOS" in ObjectMapper.xcworkspace
*** Building scheme "UberRides" in UberRides.xcodeproj
** CLEAN FAILED **
The following build commands failed:
Check dependencies
(1 failure)
** BUILD FAILED **
The following build commands failed:
Check dependencies
(1 failure)
A shell task (/usr/bin/xcrun xcodebuild -project /Users/jayesh/Desktop/CarthageDemo/Carthage/Checkouts/rides-ios-sdk/source/UberRides.xcodeproj -scheme UberRides -configuration Release -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean build) failed with exit code 65:
** CLEAN FAILED **
The following build commands failed:
Check dependencies
(1 failure)
** BUILD FAILED **
The following build commands failed:
Check dependencies
(1 failure)
This is probably because the latest 0.5 release is still using Swift 2.2
try updating your Cartfile to use the experimental Swift 2.3 branch
# UberRides
github "https://github.com/uber/rides-ios-sdk" "swift-2.3-dev"

Resources