The
AppName [Debug]target overrides theSWIFT_VERSIONbuild setting defined in `Pods/Target Support Files/Pods-AppName/Pods-AppName.debug.xcconfig'. This can lead to problems with the CocoaPods installation
How can I fix this?. Is this will make any issues for my code?
Delete SWIFT_VERSION it from your .xcodeproj on that target configuration then let CocoaPods set it as part of pod install
Can you provide a sample project that reproduced the issue? Without further information, it does seem like @dnkoutso's suggestion should do the trick.
@dnkoutso I have removed. but it doesn't work. after I pod install. It still warning.
Sorry to reverse on this, but you should actually set the SWIFT_VERSION in your target by setting "Use Legacy Swift Language Version" to the appropriate value. Once you have that set properly, make sure you haven't accidentally set something manually in the Pods xcodeproj. You could try running pod deintegrate and then pod install once you have your "Use Legacy Swift Language Version" set as well.
These issues should be resolved in CocoaPods 1.1.1. Please update and file a new issue if you're still experiencing this. Thanks!
@benasher44 I'm still seeing this warning with CocoaPods 1.1.1 for all of my targets (app, unit test, frameworks). In my understanding however it is required to set the SWIFT_VERSION in the project settings, since CocoaPods cannot infer this?
Hey @Ben-G! I don't think CP should be setting SWIFT_VERSION anywhere except in the targets in the Pods project (i.e. not your project or your project's targets), but given that this keeps coming up I might be wrong. Can you post the contents of your Pods/Target Support Files/Pods-<target-name>/Pods-<target-name>.debug.xcconfig for one of the targets in question (scrubbed of any private information)?
Note: That <target-name> will be the hyphen-separated path in the target tree to your target in the Podfile. So, if you have a Podfile like:
abstract_target 'Shared' do
target 'App'
end
then your <target-name> will be Shared-App resulting in a path like Pods/Target Support Files/Pods-Shared-App/Pods-Shared-App.debug.xcconfig.
Also, if you have any post_install hooks, the contents of those hooks (scrubbed of private info) would be great to see too.
Thanks!
@benasher44 Here we go:
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PODS_ROOT)/PSPDFKit/**" "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking" "$PODS_CONFIGURATION_BUILD_DIR/Amplitude-iOS" "$PODS_CONFIGURATION_BUILD_DIR/BSGridCollectionViewLayout" "$PODS_CONFIGURATION_BUILD_DIR/BSImagePicker" "$PODS_CONFIGURATION_BUILD_DIR/Bugsnag" "$PODS_CONFIGURATION_BUILD_DIR/Cartography" "$PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack" "$PODS_CONFIGURATION_BUILD_DIR/FMDB" "$PODS_CONFIGURATION_BUILD_DIR/FMDBMigrationManager" "$PODS_CONFIGURATION_BUILD_DIR/KSCrash" "$PODS_CONFIGURATION_BUILD_DIR/PDKeychainBindingsController" "$PODS_CONFIGURATION_BUILD_DIR/PEGKit" "$PODS_CONFIGURATION_BUILD_DIR/ReactiveCocoa" "$PODS_CONFIGURATION_BUILD_DIR/ReactiveObjC" "$PODS_CONFIGURATION_BUILD_DIR/ReactiveSwift" "$PODS_CONFIGURATION_BUILD_DIR/Result" "$PODS_CONFIGURATION_BUILD_DIR/SSZipArchive" "$PODS_CONFIGURATION_BUILD_DIR/SlackTextViewController" "$PODS_CONFIGURATION_BUILD_DIR/TTTAttributedLabel" "$PODS_CONFIGURATION_BUILD_DIR/UIImageViewModeScaleAspect" "$PODS_CONFIGURATION_BUILD_DIR/sqlite3" "${PODS_ROOT}/AppsFlyerFramework" "${PODS_ROOT}/Optimizely-iOS-SDK" "${PODS_ROOT}/PSPDFKit"
GCC_ENABLE_CPP_EXCEPTIONS = YES
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(SDKROOT)/usr/include/libxml2 $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AppsFlyerFramework" "${PODS_ROOT}/Headers/Public/Optimizely-iOS-SDK" "${PODS_ROOT}/Headers/Public/PSPDFKit"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -DFMDB_SQLITE_STANDALONE $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking/AFNetworking.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Amplitude-iOS/Amplitude_iOS.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/BSGridCollectionViewLayout/BSGridCollectionViewLayout.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/BSImagePicker/BSImagePicker.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Bugsnag/Bugsnag.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Cartography/Cartography.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack/CocoaLumberjack.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FMDB/FMDB.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FMDBMigrationManager/FMDBMigrationManager.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/KSCrash/KSCrash.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PDKeychainBindingsController/PDKeychainBindingsController.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PEGKit/PEGKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/ReactiveCocoa/ReactiveCocoa.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/ReactiveObjC/ReactiveObjC.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/ReactiveSwift/ReactiveSwift.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Result/Result.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SSZipArchive/SSZipArchive.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SlackTextViewController/SlackTextViewController.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/TTTAttributedLabel/TTTAttributedLabel.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/UIImageViewModeScaleAspect/UIImageViewModeScaleAspect.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/sqlite3/sqlite3.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AppsFlyerFramework" -isystem "${PODS_ROOT}/Headers/Public/Optimizely-iOS-SDK" -isystem "${PODS_ROOT}/Headers/Public/PSPDFKit"
OTHER_LDFLAGS = $(inherited) -ObjC -l"c++" -l"icucore" -l"xml2" -l"z" -framework "AFNetworking" -framework "AVFoundation" -framework "Accelerate" -framework "AdSupport" -framework "Amplitude_iOS" -framework "AppsFlyer" -framework "AssetsLibrary" -framework "AudioToolbox" -framework "BSGridCollectionViewLayout" -framework "BSImagePicker" -framework "Bugsnag" -framework "CFNetwork" -framework "Cartography" -framework "CocoaLumberjack" -framework "CoreGraphics" -framework "CoreImage" -framework "CoreMedia" -framework "CoreTelephony" -framework "CoreText" -framework "FMDB" -framework "FMDBMigrationManager" -framework "Foundation" -framework "GLKit" -framework "ImageIO" -framework "JavaScriptCore" -framework "KSCrash" -framework "MediaPlayer" -framework "MessageUI" -framework "MobileCoreServices" -framework "OpenGLES" -framework "Optimizely" -framework "PDKeychainBindingsController" -framework "PEGKit" -framework "PSPDFKit" -framework "QuartzCore" -framework "QuickLook" -framework "ReactiveCocoa" -framework "ReactiveObjC" -framework "ReactiveSwift" -framework "Result" -framework "SSZipArchive" -framework "Security" -framework "SlackTextViewController" -framework "SystemConfiguration" -framework "TTTAttributedLabel" -framework "UIImageViewModeScaleAspect" -framework "UIKit" -framework "iAd" -framework "sqlite3"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}/../Pods
SWIFT_VERSION = 3.0
It indeed seems like various Swift specific flags are also set in the main target.
Post install steps:
# Required for being able to build on CI without a developer provisioning profile / certificate
# Source: https://github.com/CocoaPods/CocoaPods/issues/4011
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
config.build_settings['CLANG_ENABLE_OBJC_WEAK'] ||= 'YES'
end
end
CocoaPods version is 1.1.1. I've also deleted the Target Support Files folder and re-ran pod install just to avoid the chance of a caching issue.
Just in case it's useful, here's the definition of the main target for which I shared the generated config above:
target 'PlanGrid' do
project 'PlanGrid/PlanGrid.xcodeproj'
shared_pods
app_shared_pods
legacy_pods
pod 'Amplitude-iOS', '3.7.1'
pod 'AppsFlyerFramework', '4.4.0'
pod 'Optimizely-iOS-SDK', '1.4.2'
pod 'SlackTextViewController', '1.9.1'
pod 'TTTAttributedLabel', '1.13.4'
pod 'Cartography', '1.0.1'
pod 'BSImagePicker', :git => '[email protected]:plangrid/BSImagePicker.git', :commit => 'b1019a572e5e67f315ae5e01deaf77eeaaa038e2'
end
shared_pods, etc. also just contain plain pod requirements, but happy to share more if it could be helpful.
I spoke with @Ben-G privately, and we determined that CocoaLumberjack is setting SWIFT_VERSION = 3.0 in its podspec's xcconfig setting. This causes CocoaPods to set SWIFT_VERSION = 3 for each target in your project, in which CocoaLumberjack is integrated. I've filed an issue for CocoaLumberjack specifically here.
For others reading/experiencing this issue, please check your pods (ones listed in your Podfile specifically) to see if your pods' podspecs contain SWIFT_VERSION = <version> in either the xcconfig or user_target_xcconfig setting. If you see that, you should file one similar to the one I filled with CocoaLumberjack with the related project.
@benasher44, what if I have SWIFT_VERSION = 3.0 in Pods-AppName.debug.xcconfig?
For those of you who find this on DuckDuckGo:
(Xcode 9.2)
-Go to your xcodeproj
-For all of your TARGETS:
-Go down to Swift Compiler - Language, select the entry and hit DELETE
That will fix it. It's not enough to set them to unspecified, you need to click the entry and hit delete. That's what got me.
Note: Do Not do this in your project under PROJECTS. Doing so will fail to compile, I was able to set mine to Swift 4.0 there after deleting it elsewhere and both compile + no warnings from cocoapods.
If remove Swift Compiler pod install doesn't give me more warning, but the project won't compile.
Most helpful comment
Delete
SWIFT_VERSIONit from your .xcodeproj on that target configuration then let CocoaPods set it as part ofpod install