1

I recently had a problem after updating Xcode where I couldn't build the project.

Multiple commands produce '/Users/username/Library/Developer/Xcode/DerivedData/appname-code/Build/Products/Release-iphoneos/appname.app':

I followed the instructions in these answers: https://stackoverflow.com/a/52452590/4838107 https://stackoverflow.com/a/35316717/4838107

$ sudo gem install cocoapods-deintegrate
$ sudo gem install cocoapods-clean
$ pod deintegrate
$ pod clean
$ pod install

When I try 'pod install' it gives me this:

The following pods are integrated into targets that do not have the same Swift version:
Alamofire required by [target] (Swift 3.0)

I can't open the project anymore because .xcworkspace is gone so any solution that involves the project open in Xcode won't be any use. I've searched for answers on stackoverflow and this is a problem, for example here.

Podfile:

#Uncomment this line to define a global platform for your project
platform :ios, '9.0'
# Uncomment this line if you're using Swift
use_frameworks!
post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = 'NO'
            config.build_settings['EMBEDDED_CONTENT_CONTAINS_SWIFT'] = 'NO'
        config.build_settings['SWIFT_VERSION'] = '3.0.1'
        end
    end
end
def standard_pods
    pod 'Alamofire'
    ...
end


target '[target]' do
    standard_pods
end
Questioner
  • 2,451
  • 4
  • 29
  • 50
  • Specify pod version in Podfile that works for the version your app is using – Satish Oct 03 '18 at 12:25
  • @AshleyMills I edited my question – Questioner Oct 03 '18 at 12:38
  • Have you tried pointing to an older version of the Alamofire pod? One that was built for Swift 3? – Ashley Mills Oct 03 '18 at 12:39
  • I have 13 pods. Will I look up all of them manually or is there a way to do this automatically? – Questioner Oct 03 '18 at 12:40
  • You'll need to do it manually, but it's not a big job. Just check the Releases tab on GitHub. Of course, you'll lose any new features of the pods. Alternatively, update your app to Swift 4. You'll have to do it sooner or later. – Ashley Mills Oct 03 '18 at 12:47
  • @AshleyMills I checked GitHub and put this in my Podfile: ` pod 'Alamofire', '~> 4.0'` I then tried pod install, pod update etc and I'm still getting the same error: `Alamofire required by [target] (Swift 3.0)` – Questioner Oct 03 '18 at 13:25
  • @AshleyMills I updated the targets to Swift 4.2 and I was able to successfully install pods. But now it's giving me 'No such module - Alamofire' even though it's right there – Questioner Oct 03 '18 at 14:11

1 Answers1

0

In my case i missed to migrate other built targets like unit tests and ui tests :)

ergunkocak
  • 3,334
  • 1
  • 32
  • 31