安装包 socket.io-client-swift xcode 12
install package socket.io-client-swift xcode 12
我需要用 carthage 安装包 https://github.com/socketio/socket.io-client-swift
Xcode 12 个项目。
我有一个 CartFile :
github "socketio/socket.io-client-swift" ~> 15.0.0
我试过这个命令:
carthage update --platform iOS --use-xcframeworks
我试试 :
- 在我的主项目中修改“NO”上的“Buid archicture only”
- 修改依赖“红蜘蛛”项目中“NO”的“Buid archicture only”
但我总是有同样的错误:
CompileSwift normal i386 (in target 'SocketIO' from project 'Socket.IO-Client-Swift')
cd /Users/admin/Documents/test2/Carthage/Checkouts/socket.io-client-swift
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c /Users/admin/Documents/test2/Carthage/Checkouts/socket.io-client-swift/Source/SocketIO/Engine/SocketEngine.swi$
/Users/admin/Documents/test2/Carthage/Checkouts/socket.io-client-swift/Source/SocketIO/Engine/SocketEngine.swift:27:8: error: could not find module 'Starscream' for target 'i386-apple-ios-simulator'; found: arm64, armv7-$
import Starscream
也许我需要在某些环境中创建一个 ${ARCHS_STANDARD} or/and 自定义文件?
我发现迦太基在很多情况下都没有正确设置FRAMEWORK_SEARCH_PATHS
,这对我来说导致Socket.IO在编译时找不到红蜘蛛。
这是一个变通脚本,您可以使用它来设置 FRAMEWORK_SEARCH_PATHS
:
# carthage.sh
# Usage example: ./carthage.sh build --use-xcframeworks --platform iOS
set -euo pipefail
xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
trap 'rm -f "$xcconfig"' INT TERM HUP EXIT
echo "FRAMEWORK_SEARCH_PATHS=$(inherited) $(pwd)/Carthage/Build" >> $xcconfig
# echo 'BUILD_LIBRARY_FOR_DISTRIBUTION=YES' >> $xcconfig # You may or may not need this depending on your project setup
export XCODE_XCCONFIG_FILE="$xcconfig"
carthage "$@"
我需要用 carthage 安装包 https://github.com/socketio/socket.io-client-swift Xcode 12 个项目。
我有一个 CartFile :
github "socketio/socket.io-client-swift" ~> 15.0.0
我试过这个命令:
carthage update --platform iOS --use-xcframeworks
我试试 :
- 在我的主项目中修改“NO”上的“Buid archicture only”
- 修改依赖“红蜘蛛”项目中“NO”的“Buid archicture only”
但我总是有同样的错误:
CompileSwift normal i386 (in target 'SocketIO' from project 'Socket.IO-Client-Swift')
cd /Users/admin/Documents/test2/Carthage/Checkouts/socket.io-client-swift
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c /Users/admin/Documents/test2/Carthage/Checkouts/socket.io-client-swift/Source/SocketIO/Engine/SocketEngine.swi$
/Users/admin/Documents/test2/Carthage/Checkouts/socket.io-client-swift/Source/SocketIO/Engine/SocketEngine.swift:27:8: error: could not find module 'Starscream' for target 'i386-apple-ios-simulator'; found: arm64, armv7-$
import Starscream
也许我需要在某些环境中创建一个 ${ARCHS_STANDARD} or/and 自定义文件?
我发现迦太基在很多情况下都没有正确设置FRAMEWORK_SEARCH_PATHS
,这对我来说导致Socket.IO在编译时找不到红蜘蛛。
这是一个变通脚本,您可以使用它来设置 FRAMEWORK_SEARCH_PATHS
:
# carthage.sh
# Usage example: ./carthage.sh build --use-xcframeworks --platform iOS
set -euo pipefail
xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
trap 'rm -f "$xcconfig"' INT TERM HUP EXIT
echo "FRAMEWORK_SEARCH_PATHS=$(inherited) $(pwd)/Carthage/Build" >> $xcconfig
# echo 'BUILD_LIBRARY_FOR_DISTRIBUTION=YES' >> $xcconfig # You may or may not need this depending on your project setup
export XCODE_XCCONFIG_FILE="$xcconfig"
carthage "$@"