Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embed Pods Frameworks build phase not reliably executed with Xcode 10 / New Build System #8151

Closed
nickdowell opened this Issue Oct 2, 2018 · 4 comments

Comments

Projects
None yet
5 participants
@nickdowell
Copy link

nickdowell commented Oct 2, 2018

Report

What did you do?

  1. Create a new pod (with example project) using pod lib create
  2. Open example project in Xcode 10
  3. Add some code to the pod project
  4. Build & run
  5. Make some changes to the pod project code
  6. Build & run

What did you expect to happen?

Expect changes made in step 5 to take effect in the example project

What happened instead?

The example app continues to use the initially built version of the pod.

CocoaPods Environment

Stack

   CocoaPods : 1.5.3
        Ruby : ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]
    RubyGems : 2.5.2.3
        Host : Mac OS X 10.14 (18A391)
       Xcode : 10.0 (10A255)
         Git : git version 2.17.1 (Apple Git-112)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ a30768897a075978084398f2dee09206c2cced5c

Installation Source

Executable Path: /usr/local/bin/pod

Plugins

cocoapods-deintegrate : 1.0.2
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.3.1
cocoapods-try         : 1.1.0
slather               : 2.4.5

Podfile

use_frameworks!

target 'Foobar_Example' do
  pod 'Foobar', :path => '../'

  target 'Foobar_Tests' do
    inherit! :search_paths

    pod 'FBSnapshotTestCase' , '~> 2.1.4'
  end
end

Project that demonstrates the issue

This can be reproduced with any cocoapods library, but here is a simple example that demonstrates the issue - Foobar.zip

Further discussion

This problem only happens when using Xcode's "New Build System" which is the default as of Xcode 10. Reverting to the Legacy Build System is a workaround.

Removing the Input Files and Output Files from the [CP] Embed Pods Frameworks build phase works around the issue when using the New Build System.

screenshot 2018-10-02 at 09 44 25

The [CP] Embed Pods Frameworks build phase is not executed by Xcode's New Build System after making a change to a (development) pod:

screenshot 2018-10-02 at 10 04 28

@mjholgate

This comment has been minimized.

Copy link
Contributor

mjholgate commented Oct 2, 2018

Another workaround I found, which doesn't require using the old build system or deleting those input/output source files after each pod install is to add an additional Script Build Phase just before the "[CP] Embed Pod Frameworks" one which just touches the shell script:

# Hopeful workaround for: https://github.com/CocoaPods/CocoaPods/issues/8151
touch "$SRCROOT/Pods/Target Support Files/Pods-TARGETNAME/Pods-TARGETNAME-frameworks.sh"

@dnkoutso

This comment has been minimized.

Copy link
Contributor

dnkoutso commented Oct 2, 2018

This a known issue with the new build system. Apple is aware of it and it has been tracked here #8073 with a PR that allows you to disable input/output paths here #8105 which is not yet released but you can use Bundler to point to a SHA for CocoaPods.

Going to close as the other issue since there are now 2 workarounds (use legacy build system or use the flag from #8105).

@dnkoutso dnkoutso closed this Oct 2, 2018

@OleksandrKucherenko

This comment has been minimized.

Copy link

OleksandrKucherenko commented Jan 28, 2019

A small workaround bash script that will remove from modified by cocoapods project.pbxproj file wrong output file line (example based on Instabug framework):

PROJECT_NAME=MyAppProject

sed -i '' 's#"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Instabug.framework",##' ${PROJECT_NAME}.xcodeproj/project.pbxproj

execute this script after pod install build step

@ralfebert

This comment has been minimized.

Copy link

ralfebert commented Feb 4, 2019

I documented the issue here:
https://www.ralfebert.de/ios/blog/cocoapods-clean-input-output-files/

I wondered, has it been considered to disable the input/output folders in the build phase by default until the Xcode bug is fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.