Build Failed Task failed with exit code 65 - swift

I am working on a project that uses Carthage, it’s been a couple of months since the last time the project was opened. Now I am trying to move dependencies to .xcframeworks because with the old .framework, it wasn’t working. I encountered various errors and fixed them but there’s one dependency that I can’t fix, 

SwinjectStoryboard
.

I tried using this workaround and setting command line tools
I have also tried creating an empty project with only Swinject and SwinjectStoryboard dependency
but still, my build is failing with the following message
Build Failed Task failed with exit code 65: /usr/bin/xcrun
xcodebuild -project
/Users/abu/Developer/xcframework_2/Carthage/Checkouts/SwinjectStoryboard/SwinjectStoryboard.xcodeproj
-scheme SwinjectStoryboard-iOS -configuration Release -derivedDataPath /Users/abu/Library/Caches/org.carthage.CarthageKit/DerivedData/12.5_12E262/SwinjectStoryboard/2.2.0
-sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive VALIDATE_WORKSPACE=NO
-archivePath /var/folders/g9/rjxzfx7d2s51_sr6stdkpc5c0000gn/T/SwinjectStoryboard
SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO
CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO
FRAMEWORK_SEARCH_PATHS=$(inherited)
/var/folders/g9/rjxzfx7d2s51_sr6stdkpc5c0000gn/T/carthage-xcframework-HTlC
(launched in
/Users/abu/Developer/xcframework_2/Carthage/Checkouts/SwinjectStoryboard)
This usually indicates that project itself failed to compile. Please
check the xcodebuild log for more details:
/var/folders/g9/rjxzfx7d2s51_sr6stdkpc5c0000gn/T/carthage-xcodebuild.Tafjce.log
I am running the following command to build the dependencies
carthage.sh update --use-xcframeworks --platform iOS
here's my contents of my Cartfile
github "Swinject/Swinject"
github "Swinject/SwinjectStoryboard"
I am stuck on this problem for a couple of days now and would appreciate any help

Related

xcodebuild command fails due to syncfusion_flutter_pdfviewer library

Xcode build fails when executing:
xcodebuild -scheme "Runner" BUILD_DIR=".../_appcircle_temp/appcircle_build_ios_simulator/SimulatorBuildDir" -derivedDataPath ".../_appcircle_temp/appcircle_build_ios_simulator/SimulatorDerivedData" -configuration "Debug" COMPILER_INDEX_STORE_ENABLE=NO ONLY_ACTIVE_ARCH=NO -arch x86_64 -quiet -workspace ".../_appcircle_temp/Repository/ios/Runner.xcworkspace"
Error:
error: Build input file cannot be found: '....syncfusion_flutter_pdfviewer/syncfusion_flutter_pdfviewer.framework/syncfusion_flutter_pdfviewer'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it? (in target 'syncfusion_flutter_pdfviewer' from project 'Pods')
I have tried adding syncfusion_flutter_pdfviewer to my POD file, but it stills failing (And documentation doesn't require to adding to pod file)
Any ideas how to solve this?

ObjectMapper: Module compiled with Swift 4.2 cannot be imported in Swift 4.1.2:

I am facing this issue on Xcode 9.4.1
I tried with
github "Hearst-DD/ObjectMapper" ~> 3.1.0 //(tried with 3.3.0)
but this error.
Module compiled with Swift 4.2 cannot be imported in Swift 4.1.2 comes every-time.
I tried below things:
Deleting the .resolved file
Deleted the build and checkout folder
Deleted the framework folder from builds inside cathage
tried with carthage bootstrap --platform iOS.
Updated: Below error keep on coming.
Build Failed Task failed with exit code 65: /usr/bin/xcrun
xcodebuild -workspace
/Users/xx/Documents/tal1.14.1/Carthage/Checkouts/mixpanel-swift/MixpanelDemo/MixpanelDemo.xcworkspace
-scheme Mixpanel -configuration Release -derivedDataPath /Users/xx/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4.1_9F2000/mixpanel-swift/v2.5.4
-sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath
/var/folders/82/_m5xwhxx4795wyxlhtw40ch509_hqq/T/mixpanel-swift
SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO
CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in
/Users/xx/Documents/tal1.14.1/Carthage/Checkouts/mixpanel-swift)
This usually indicates that project itself failed to compile. Please
check the xcodebuild log for more details:
/var/folders/82/_m5xwhxx4795wyxlhtw40ch509_hqq/T/carthage-xcodebuild.2MxUDl.log
BLDM3295-MAC:tal xx$
You need to do carthage bootstrap --no-use-binaries to make Carthage compile the frameworks locally, using the Swift 4.2 compiler that your project uses.
To fix what I did, I was having success build in Jenkins Server I kept the the same version and copied the build project and framework for the same. then run
carthage bootstrap platform iOS
I know this something hack, but this is how I am able to solve.

Uber SDK installed but can't be import in project using COCOAPOD

I want to use uber SDK in my project .i am using Xcode 8.3.3
I have installed it with cocoa pod method. it includes user scripts in the project but doesn't import its library in the project. I have also tried cartage method but it shows
"* Fetching rides-ios-sdk
Fetching ObjectMapper
Downloading rides-ios-sdk.framework binary at "v0.6.0"
Checking out rides-ios-sdk at "v0.6.0"
Checking out ObjectMapper at "1.5.0"
* xcodebuild output can be found in /var/folders/hc/bcjcqz9x2hb84g5_2786z85w0000gn/T/carthage-xcodebuild.vE5KMz.log
*** Building scheme "ObjectMapper-iOS" in ObjectMapper.xcworkspace
Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild -workspace /Moghees/Driver_APP/Carthage/Checkouts/ObjectMapper/ObjectMapper.xcworkspace -scheme ObjectMapper-iOS -configuration Release -derivedDataPath /Users/mac/Library/Caches/org.carthage.CarthageKit/DerivedData/ObjectMapper/1.5.0 -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean build (launched in /Moghees/Driver_APP/Carthage/Checkouts/ObjectMapper)
This usually indicates that project itself failed to compile. Please check the Xcode build log for more details: /var/folders/hc/bcjcqz9x2hb84g5_2786z85w0000gn/T/carthage-xcodebuild.vE5KMz.log"
Help me out.

xcodebuild fails to create Archive due to SymLink error with Alamofire

This is really winding me up now, all I am trying to do is an Xcode CLI build using the Xcode command line tools.
The flow is as follows:
App Code is cloned from Git
Info Plist and my own custom plist are generated and copied to project folder
A new app icon set copied over into the assets directory
Xcode Archive build is executed
Xcode generate IPA build is executed
The issue is the Archive part keeps failing, and I cannot get it working. Annoyingly it works fine if I open the project in Xcode and Archive it through there, but that defeats the point of this automated process.
This is the command xcodebuild -verbose -scheme EpicHRV1.1.0 -archivePath ios/app.xcarchive archive
And here is the constant resultant error. I really can't figure out what its complaining about, I mean, it says something to do with Alamofire and missing modules, but why would this work in Xcode but not the command line?
Command failed: xcodebuild -verbose -scheme EpicHRV1.1.0 -archivePath ios/app.xcarchive archive
2017-01-07 20:24:04.255 xcodebuild[43780:2460638] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTFrameworks/DVTFrameworks-11754/DVTFoundation/Utilities/DVTFileSystemUtilities.mm:142
Details: lstat('/Users/Justin/Library/Developer/Xcode/DerivedData/EpicHR-dgdtmzwowkyxgkfzmizhuhiaxkrt/Build/Intermediates/ArchiveIntermediates/EpicHRV1.1.0/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Alamofire.framework/Modules') failed with errno 2 (No such file or directory)
Function: DVTRecursiveMkdirResult dvt_recursiveMkdir_returningErrorString(NSString *__strong, NSString *__autoreleasing *)
Thread: <NSThread: 0x7f90e8ae7cf0>{number = 7, name = (null)}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
** ARCHIVE FAILED **
Here is another lovely error which also randomly appears, but not every time...
The following build commands failed:
SymLink /Users/Justin/Library/Developer/Xcode/DerivedData/EpicHR-dgdtmzwowkyxgkfzmizhuhiaxkrt/Build/Intermediates/ArchiveIntermediates/EpicHRV1.1.0/BuildProductsPath/Release-iphoneos/Alamofire.framework /Users/Justin/Library/Developer/Xcode/DerivedData/EpicHR-dgdtmzwowkyxgkfzmizhuhiaxkrt/Build/Intermediates/ArchiveIntermediates/EpicHRV1.1.0/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Alamofire.framework
And another error that sometimes appears. With all of the above the only consistent thing is Alamofire is mentioned in the error..
The following build commands failed:
Strip /Users/Justin/Library/Developer/Xcode/DerivedData/EpicHR-dgdtmzwowkyxgkfzmizhuhiaxkrt/Build/Intermediates/ArchiveIntermediates/EpicHRV1.1.0/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Alamofire.framework/Alamofire
So I solved it with the following commands:
xcodebuild -scheme EpicHRV1.1.0 -archivePath ../ios/app.xcarchive archive
xcrun xcodebuild -exportArchive -exportOptionsPlist exportPlist.plist -archivePath ../ios/app.xcarchive -exportPath ../ios/ipa/

Error: "no such module <Swift Cocoapod name>" with Jenkins

I'm trying to setup Jenkins slave, to build my Swift project that uses a Swift pod called "Freddy".
The problem is the build failed with error:
error: no such module 'Freddy'
This is my Podfile:
platform :ios, '8.0'
use_frameworks!
target 'MyProject' do
pod 'AFNetworking', '~> 3.0'
pod 'Freddy'
end
CocoaPods version 0.39.0
Xcode 7.2.1 (no problems while building from Xcode directly)
PS. Same problem had happened with Alamofire pod before I replaced it with AFNetworking.
PSS. Jenkins executes following xcodebuild:
xcodebuild -scheme MyProject -workspace MyProject.xcworkspace -configuration Debug clean build CONFIGURATION_BUILD_DIR=jenkinsOutput "CODE_SIGN_IDENTITY=iPhone Developer: Andrei Kadochnikov (XXXXXXXX)" -destination "platform=iOS Simulator,name=iPhone 6,OS=latest"
PSSS. I've tried to execute this command from terminal by myself, got same error as Jenkins shows me.
Figured that the build was failed because of parameter CONFIGURATION_BUILD_DIR=jenkinsOutput. I've got rid of it and build succeeded.
Confusing error message.
I have encountered this error recently,"no such module" and I finally found it course by the xcodebuild is a project not workspace.
Check the advanced settings on xcode plugin set the workspace path.
That solved the problem.