How to rebuild development pod changes?

IosXcodeCocoapods

Ios Problem Overview


I have a development pod that I connect to the my app locally using :path => '~/Projects/Swift/pod'. When I make changes inside the application code in that development pod, this changes are not included after build. It's like I'm build cached code, not my code changes.

For include code changes into build I have to run the command "Clean Build Folder", but after that build takes a very long time, for 10 minutes, which is not very productive.

Literally, I comment on a line of code and wait 10 minutes to see the changes.

What is the problem?

I was trying to run "pod install/pod update" after any changes, but it has no effect.

Ios Solutions


Solution 1 - Ios

I'm using to below.

Product -> Schemes -> EditScheme -> Build -> Add a development Pods ("+" sign)

Solution 2 - Ios

I had the same issue with Xcode 10.0 (10A255). Changing back to the legacy build system (in File -> Project/Workspace Settings) worked for me to resolve the issue for now, until this is fixed by either Cocoapds or Xcode.

Solution 3 - Ios

While Changing back to the legacy build system works, the build time might increase in some large projects. An alternate solution is to add this run script find "${SRCROOT}/Pods" -type f -name *frameworks.sh -exec bash -c "touch \"{}\"" \; to touch all framework scripts under your project's Build Phases->Embed Pods Framework. This should pickup your new changes until this bug is fixed.

Solution 4 - Ios

As a workaround I've been manually "cleaning" out my development pods.

  1. In the Pods project open Products select the development pod framework(s)
  2. In the inspector on the right I select the arrow which opens Finder
  3. Delete the framework(s)
  4. Build/Run

Hope that helps, and that Apple fixes this soon...

P.S. Will definitely be writing a simple script to do this.

Update 9/25/18

Also seems like sometimes I must delete the Intermediate build(s) as well.

Update 9/23/19

Looks like it was fixed in CocoaPods 1.8.0 (Wow, it been a whole year...)

Solution 5 - Ios

I have not yet a practical automatic solution for this. But manually you can do CMD + shift + k or product -> clean build folder.

But then the entire project needs to be build again. If you have a lot of pods/frameworks or source code this can take some time to recompile.

Like other people mention it seems to be a bug related to the new build system. So you can switch back to the old system.

Both not really good solutions. But that is the price we pay for working with apple ;).

Solution 6 - Ios

I tried accepted answer and it didnt work, then I added install! 'cocoapods', :disable_input_output_paths => true to podfile and it is working now.

use_frameworks!

install! 'cocoapods', :disable_input_output_paths => true

target 'TargetName' do
  # ...
end

Solution 7 - Ios

There's a cleaner fix provided here on this Github issue provided by Andrés Cecilia Luque and it also worked for me on Xcode 11.5 too. Very convenient.

Solution 8 - Ios

I'm working with development pods for a while, it works fine at most of the time. Changes don't take effect like you only happens a few times.

Delete the Pods folder and reinstall might fix the problem.


Update:

I have to declare that my answer is not for the situation after Xcode 10. For Xcode 10, CocoaPods may not support the new build system at this time. They had fixed it https://github.com/CocoaPods/CocoaPods/issues/8073

In my case (before Xcode 10), most of the time it works well, except few.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionGikasView Question on Stackoverflow
Solution 1 - IoswonView Answer on Stackoverflow
Solution 2 - IosAhtiView Answer on Stackoverflow
Solution 3 - IosAlibabaView Answer on Stackoverflow
Solution 4 - IosnickgzzjrView Answer on Stackoverflow
Solution 5 - IosSaren IndenView Answer on Stackoverflow
Solution 6 - IosRenetikView Answer on Stackoverflow
Solution 7 - IoscdescoursView Answer on Stackoverflow
Solution 8 - IosBB9zView Answer on Stackoverflow