ioscocoapods

Invalid Podfile file specifying multiple post_install hooks is unsupported


I'm using cocoapods 1.1.1 and in my podfile I have more than one post_install hooks. And I'm getting this error :

[!] Invalid `Podfile` file: [!] Specifying multiple `post_install` hooks is unsupported..
-------------------------------------------
 #
 >  post_install do |installer|
 #      installer.pods_project.targets.each do |target|

Did anyone face the same problem before? And Yes! I have 1 post_install in my 1 target and another in global scope. I could move in one, but why?


Solution

  • Solution 2023

    When I removed my code from my main target and moved in global scope's post_install block it's works like charm.

    For some reason if you add multiple post_install (global and 1 target for instance) move them in same global block and add if-else statements for managing targets.