我有一个古玩问题.
我有一个项目,我已经工作,并始终从XCode IDE构建,它工作正常.现在我正在设置Bamboo来构建项目,因此我正在从命令行构建它.
问题是,如果我从GIT中检查我的代码,然后使用xcodebuild来构建它,它说无法找到该方案,但如果我打开该项目,它会构建,如果我然后尝试从命令行再次构建它使用相同的命令,它的工作原理.
当我打开项目或者我做了一些愚蠢的事情时,XCode做了什么魔术,可能在我的.gitignore中排除了一个我不应该的文件?
我将混合语言框架链接到项目时遇到问题.
1)我使用Swift和Objective-C类创建框架.
2)主逻辑存储在Swift文件中.例如,带有调用NSLog的方法的类("调用Swift日志").
3)Objective-C文件有一个类,它有一个方法,我创建一个Swift类的实例并调用Swift-log方法.
4)我将此框架与我的Objective-C项目相关联,我可以在此项目中调用我需要的所有内容,但是当我想构建此项目时,我收到错误" linker command failed with exit code 1 (use -v to see invocation)"
并警告:
ld: warning: Could not find auto-linked library 'swiftFoundation'
ld: warning: Could not find auto-linked library 'swiftDarwin'
ld: warning: Could not find auto-linked library 'swiftCoreFoundation'
ld: warning: Could not find auto-linked library 'swiftCore'
ld: warning: Could not find auto-linked library 'swiftCoreGraphics'
ld: warning: Could not find auto-linked library 'swiftObjectiveC'
ld: warning: Could not find auto-linked library 'swiftDispatch'
ld: warning: Could not find …
我对 Xcode 开发还比较陌生。本质上,我正在开发的项目使用了PolarBleSdk库,该库也具有 RxSwift 依赖项。我将它们添加为框架/编译模块,上周两者都运行正常。今天我去运行我的项目并得到以下错误:
Module compiled with Swift 5.2 cannot be imported by the Swift 5.3 compiler: /Users/admin/eva-official/eva/eva/ios/PolarBleSdk.framework/Modules/PolarBleSdk.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
Run Code Online (Sandbox Code Playgroud)
我查看了 SO 上的错误,发现几个相同的问题都具有相同的解决方案,最详细的答案如下:
使用 Swift 5.1 编译的模块无法被 Swift 5.1.2 编译器导入
因此,当我尝试此解决方案时,BUILD_LIBRARY_FOR_DISTRIBUTION = YES;我收到此错误:
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'Runner' from project 'Runner')
cd /Users/admin/eva-official/eva/eva/ios
export DEVELOPER_DIR\=/Applications/Xcode.app/Contents/Developer
export SDKROOT\=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -incremental -module-name Runner -Onone -enable-batch-mode -enforce-exclusivity\=checked @/Users/admin/Library/Developer/Xcode/DerivedData/Runner-bqvaekbapdxicmavikgdqxwzdbni/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/x86_64/Runner.SwiftFileList -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk -target x86_64-apple-ios12.4-simulator -g -module-cache-path /Users/admin/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -Xfrontend -serialize-debugging-options -enable-testing -index-store-path /Users/admin/Library/Developer/Xcode/DerivedData/Runner-bqvaekbapdxicmavikgdqxwzdbni/Index/DataStore -enable-library-evolution -swift-version 5 -I /Users/admin/Library/Developer/Xcode/DerivedData/Runner-bqvaekbapdxicmavikgdqxwzdbni/Build/Products/Debug-iphonesimulator -F /Users/admin/Library/Developer/Xcode/DerivedData/Runner-bqvaekbapdxicmavikgdqxwzdbni/Build/Products/Debug-iphonesimulator -F …Run Code Online (Sandbox Code Playgroud) 我正在开发一个离子应用程序,但是当我尝试构建它时,它给了我以下错误
xcodebuild: error: The project named "SnapHome" does not contain a scheme named "SnapHome". The "-list" option can be used to find the names of the schemes in the project.
Run Code Online (Sandbox Code Playgroud)
以下是可用的方案
Information about workspace "SnapHome":
Schemes:
SnapHome
Run Code Online (Sandbox Code Playgroud)
我使用下面的脚本和企业配置文件来构建应用程序,我使用相同的脚本来构建其他cordova应用程序
cordova build
projectname='xxxxx'
provisionprofilename="xxxxxxx"
outoutdirectory="xxxxxxx"
xcodeprojectdirectory="yyyyyy/snapapp/platforms/ios"
rm -f "$outoutdirectory"/"$projectname".xcarchive
rm -f "$outoutdirectory"/"$projectname".ipa
xcodebuild clean -project "$xcodeprojectdirectory"/"$projectname".xcodeproj -configuration Release -alltargets
xcodebuild -workspace "$xcodeprojectdirectory"/"$projectname".xcworkspace -list
xcodebuild archive -project "$xcodeprojectdirectory"/"$projectname".xcodeproj -scheme "$projectname" -archivePath "$outoutdirectory"/"$projectname".xcarchive
xcodebuild -exportArchive -archivePath "$outoutdirectory"/"$projectname".xcarchive -exportOptionsPlist exportPlist.plist -exportPath "$outoutdirectory"/"$projectname".ipa
Run Code Online (Sandbox Code Playgroud)
能告诉我这是什么问题以及如何解决这个问题.我使用的是xcode …