问题
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.
回答1:
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.
回答2:
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.
来源:https://stackoverflow.com/questions/35868257/error-no-such-module-swift-cocoapod-name-with-jenkins