ioscocoapodsxcode-workspacexcode9.4

Workspace warning : Target Pods cannot link framework Foundation.framework


When building the workspace throws a warning:

Target Pods - {AppName} product Pods_{AppName} cannot link framework Foundation.framework

Screenshot

This started after updating to Xcode 9.4. I updated CocoaPods to the latest version, v1.5.3, but it didn’t resolve the warning.


Solution

  • This is due to using the new build system in Xcode. The issue has not been resolved in the latest version of CocoaPods yet, v1.5.3 as of writing this.

    For now, you can resolve the warning by adding this post_install action to your pod file:

    post_install do |installer|
        podsTargets = installer.pods_project.targets.find_all { |target| target.name.start_with?('Pods') }
        podsTargets.each do |target|
            target.frameworks_build_phase.clear
        end
    end
    

    After updating your pod file run pod install again.

    Source: CocoaPods: Cannot link framework Xcode warning