Carthage fails when trying to install FontAwesomeSwift in iOS project - ios

I am trying to install FontAwesome.Swift in my Xcode project (Swift) so I created a Cartfile with the following line
github "thii/FontAwesome.swift" >= 0.4.1
as described here. Then I ran
carthage update and this happened :
==> carthage update
*** Fetching FontAwesome.swift
*** Checking out FontAwesome.swift at "0.6.0"
*** xcodebuild output can be found in /var/folders/fr/sn4l2f393_v_ytcwkb0lx7_40000gp/T/carthage-xcodebuild.4QnCto.log
*** Building scheme "FontAwesome" in FontAwesome.xcodeproj
** BUILD FAILED **
The following build commands failed:
CompileSwift normal x86_64 <path_to_project>/<ProjectName>/Carthage/Checkouts/FontAwesome.swift/FontAwesome/FontAwesome.swift
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
(2 failures)
<path_to_project>/<ProjectName>/Carthage/Checkouts/FontAwesome.swift/FontAwesome/FontAwesome.swift:72:61: error: 'String.Index' does not have a member named 'advancedBy'
A shell task failed with exit code 65:
** BUILD FAILED **
The following build commands failed:
CompileSwift normal x86_64 <path_to_project>/<ProjectName>/Carthage/Checkouts/FontAwesome.swift/FontAwesome/FontAwesome.swift
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
(2 failures)

I deduce from the error message:
'String.Index' does not have a member named 'advancedBy'
that you are still using Xcode 6.x? The advancedBy API is only available as of Swift 2.0 which ships with Xcode 7.
So, you have two options:
Upgrade your project to Xcode 7 / Swift 2.0
Edit your project's Cartfile so that it fetches a version of FontAwesome.swift that is compatible with you Xcode version. It seems FontAwesome.swift migrated to Swift 2.0 with version 0.6, so specifying a version < 0.6 (instead of >= 0.4.1) might do it.
In case you have both versions of Xcode installed, then Carthage may still use the command line tools from Xcode 6.x instead of the newer ones. You could fix this with the xcodeselect command in Terminal, but it's also possible to switch to the desired version of the tools in the Xcode Preferences (Locations tab).

Related

Xcode 11.6 fails with: Command PhaseScriptExecution failed with a nonzero exit code

I have a flutter application using Firebase / Firestore. In my flutter application flutter build iOS is working but in Xcode the Archive and building in General fails with
Command PhaseScriptExecution failed with a nonzero exit code
I already tried:
keychain access -> right click on login -> lock & unlock again -> clear Xcode project and make build again.
also pod deintegrate etc. is not working
But it is not working. Also tried setting up new project but after firestore integration it fails.
The domain/default pair of (/Users/username/Library/Developer/Xcode/DerivedData/Runner-bhnxzkbbayxxhjauqwbcxaiedcis/Build/Products/Debug-iphonesimulator/Runner.app/Frameworks/App.framework/flutter_assets/ios/Flutter/App.framework/Info.plist, CFBundleExecutable) does not exist
fatal error: lipo: can't map input file: /Users/username/Library/Developer/Xcode/DerivedData/Runner-bhnxzkbbayxxhjauqwbcxaiedcis/Build/Products/Debug-iphonesimulator/Runner.app/Frameworks/App.framework/flutter_assets/ios/Flutter/App.framework/ (Invalid argument)
fatal error: lipo: can't map input file: /Users/username/Library/Developer/Xcode/DerivedData/Runner-bhnxzkbbayxxhjauqwbcxaiedcis/Build/Products/Debug-iphonesimulator/Runner.app/Frameworks/App.framework/flutter_assets/ios/Flutter/App.framework/ (Invalid argument)
Failed to extract x86_64 for /Users/username/Library/Developer/Xcode/DerivedData/Runner-bhnxzkbbayxxhjauqwbcxaiedcis/Build/Products/Debug-iphonesimulator/Runner.app/Frameworks/App.framework/flutter_assets/ios/Flutter/App.framework/. Running lipo -info:
fatal error: lipo: can't map input file: /Users/username/Library/Developer/Xcode/DerivedData/Runner-bhnxzkbbayxxhjauqwbcxaiedcis/Build/Products/Debug-iphonesimulator/Runner.app/Frameworks/App.framework/flutter_assets/ios/Flutter/App.framework/ (Invalid argument)
Command PhaseScriptExecution failed with a nonzero exit code
ok so in my case the problem occurred after a flutter upgrade. My app is on the stable channel and I updated it to the current stable version.
before that it was running on 1.17.5 there everything was working fine, the error occurred on 1.20.0
so the solution was a downgrade back to 1.17.5
In my case it worked when set Excluded Architectures -> arm64

React Native getting start project IOS build failed

I am getting following errors while creating first React Native project (AwesomeProject). I have run this project on Android and it is working as expected. Please find the attached snapshots and guide me what is going wrong with IOS.
I was using Xcode 8 when getting errors I also updated my Xcode to 9.0 and Node etc.. but nothing got worked and all errors are same as I am getting since from start.
** BUILD FAILED **
The following build commands failed:
CompileC /Users/clines291/RNProjects/AwesomeProject/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/third-party.build/Objects-normal/x86_64/Conv.o/Users/clines291/RNProjects/AwesomeProject/node_modules/react-native/third-party/folly-2016.09.26.00/folly/Conv.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/clines291/RNProjects/AwesomeProject/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/third-party.build/Objects-normal/x86_64/StringBase.o /Users/clines291/RNProjects/AwesomeProject/node_modules/react-native/third-party/folly-2016.09.26.00/folly/StringBase.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)
Installing build/Build/Products/Debug-iphonesimulator/AwesomeProject.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug- iphonesimulator/AwesomeProject.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Attachments:
Visual Code build failed error
Xcode build failed errors
Versions:
Xcode: 9.0
Node: v8.6.0
Homebrew: 1.3.5
Watchman: 4.9.0
react-native-cli: 2.0.1
react-native: 0.49.3
npm: 5.3.0
have you tried using xcode 8 rather than xcode 9?
or if you still want to use xcode 9
try this
rm -r ~/.rncache/
cd node_modules/react-native/third-party/glog-0.3.4/
./configure --host arm-apple-darwin
I found this solution on below mentioned link:
https://github.com/facebook/react-native/issues/14368
react-native init [PROJECT_NAME] --version 0.44.0
This is C compiler problem
open xcode, select Build Settings > Build options,
then enable c compiler works me.

Use CosmicMind material stable version with Swift 3 using carthage

I'am making an app with material design and this package looked really nice for that purpose. I have simply set up my Cartfile like this:
github "CosmicMind/Material" ~> 1.42.9
and then run:
carthage update
which gives me the following error:
*** Building scheme "Material iOS" in Material.xcworkspace
** 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 -workspace /Users/alex/TelenorApp/MyTelenor/Carthage/Checkouts/Material/Examples/Material.xcworkspace -scheme Material iOS -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)
I have set up the command line tools to use XCode 8, it is possible to build using Xcode 7.3 tools (xcode-select) but it wont link with my app that is using Swift 3 if I do that.
What is the reccomended way to use Material with Swift 3? Is it possible to make Material work with Swift 3 some other way? I would prefer to use a stable version of Material if that is possible.
Thankful for answers!
The master branch supports Swift 3. So all should work in that regard :)

Carthage setup fails with code 65

I'm installing carthage on a new machine.
$ brew install Carthage
[in project root] $ emacs Cartfile
# Alamofire
github "Alamofire/Alamofire"
# SwifyJSON
github "SwiftyJSON/SwiftyJSON"
$ carthage update
*** Fetching SwiftyJSON
*** Fetching Alamofire
*** Checking out Alamofire at "1.2.3"
*** Checking out SwiftyJSON at "2.2.0"
*** xcodebuild output can be found in /var/folders/8n/044rh7_j6nlcdtsb3cgp_snc0000gn/T/carthage-xcodebuild.log
*** Building scheme "Alamofire iOS" in Alamofire.xcworkspace
A shell task failed with exit code 65:
** BUILD FAILED **
The following build commands failed:
CompileSwift normal x86_64 [project root]/Carthage/Checkouts/Alamofire/Source/Request.swift
CompileSwift normal x86_64 [project root]/Carthage/Checkouts/Alamofire/Source/ResponseSerialization.swift
CompileSwift normal x86_64 [project root]/Carthage/Checkouts/Alamofire/Source/Manager.swift
CompileSwift normal x86_64 [project root]/Carthage/Checkouts/Alamofire/Source/Alamofire.swift
CompileSwift normal x86_64 [project root]/Carthage/Checkouts/Alamofire/Source/Validation.swift
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
(6 failures)
Building scheme "Alamofire iOS" in Alamofire.xcworkspace
for get before version write this to carthage
github "Alamofire/Alamofire" >= 4.2.0
see realese project in github for select version for your swift version
also you can select platform when run carthage
example
carthage update --platform iOS

Creating an iPA using command line for a Phonegap project

I used the following instructions http://docs.phonegap.com/en/2.0.0/guide_command-line_index.md.html#Command-Line%20Usage for setting up the command line tools for iOS.
But when I try to build the project with $ /path/to/my_new_cordova_project/cordova/debug
I get this:
In file included from /Users/jakob/Dropbox/Coding/phonegap/ios_project/ios_project/Classes/AppDelegate.m:28:
/Users/jakob/Dropbox/Coding/phonegap/ios_project/ios_project/Classes/AppDelegate.h:30:9: fatal error: 'Cordova/CDVViewController.h' file not found
#import <Cordova/CDVViewController.h>
^
1 error generated.
** BUILD FAILED **
The following build commands failed:
CompileC build/ios_project.build/Debug-iphonesimulator/ios_project.build/Objects-normal/i386/MainViewController.o ios_project/Classes/MainViewController.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC build/ios_project.build/Debug-iphonesimulator/ios_project.build/Objects-normal/i386/AppDelegate.o ios_project/Classes/AppDelegate.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)
When I build the project with Xcode everything works fine but I´d prefer to use the command line tools.
I got:
Xcode 5.0
PhoneGap 2.9.1 and I have tried in 3.4.0
This error appears probably by using the workspace file. Trying with the xcode project directory should resolve the problem.

Resources