RobertyBob RobertyBob - 26 days ago 21
iOS Question

Pod update has fatally altered app

My perfectly working app used to have an Xcode Project Navigator as shown below.

Project Navigator Old

iOS 10 requirements meant I had to upgrade Xcode to 8.1, which meant upgrading the entire Mac OS to Sierra and also translating the whole app to Swift 2.3.

Needless to say, this caused errors, one of which was an issue with PubNub. However, apart from this new build error the app structure was the same and everything seemed ok after dealing with all the layout issues.

I was requested to run the following steps to try to solve the PubNub pod error despite me warning that previous attempts to deal with the pod file caused fatal errors that were ultimately unrecoverable.


  1. Install all iOS simulators after Xcode update

  2. Open Xcode preferences (Cmd+,) and navigate to ”Locations” tab where will be shown path to ”DerivedData” folder

  3. Click on small circle with arrow on the right side of shown ”DerivedData” path to open it in Finder

  4. Quit Xcode

  5. Remove ”DerivedData” folder

  6. Clean up CocoaPods (if integrated with it) caches by entering this in Terminal:
    rm -rf ~/Library/Caches/CocoaPods

  7. From project root (where Podfile is located) run this in Terminal:
    pod deintegrate MyApp.xcodeproj

  8. Remove from project root (where Podfile is located) Podfile.lock file

  9. From project root (where Podfile is located) run this in Terminal: pod update

  10. Launch Xcode (hit Shift + Cmd + K just in case)

  11. Try build project



After doing all this my Project Navigator now looks like this.

Project Navigator New

As you can see, I've lost a load of stuff including the pod file etc. As suspected, my app is now fatally wounded.

My bridging header is red, Restkit.h is red and all pod references gone.

My project root in Finder has the Pods folder and pod file etc, however if I try to drag folders into the project from Finder they do not show as they used to - e.g., folders are blue color not yellow.

I'm on Xcode 8.1 and Cocoapods 1.1.1.

How can I recover my app?

EDIT: If it helps, here is the link to my unsolved question in January which was the last time I dared touch the pod file at all until now. The consequences of this situation are the same as before - the difference is that in January I was ditching 2 weeks work, now I'm looking at ditching 10 months' work.

RestKit.h never found in Xcode project

Podfile:

pod 'RestKit', '~> 0.24.0'
pod 'SimpleKeychain'
pod 'AWSS3'
pod 'VideoCore'
pod 'SDWebImage', '~>3.7'
pod 'SVPullToRefresh'
pod 'PubNub', '~> 3.7.11'
pod 'MZFormSheetController'


Result of pod update in Terminal:

Update all pods
Updating local specs repositories
Performing a deep fetch of the
master
specs repo to improve future performance
warning: inexact rename detection was skipped due to too many files.
CocoaPods 1.2.0.beta.1 is available.
To update use:
sudo gem install cocoapods --pre

[!] This is a test version we'd love you to try.
For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.2.0.beta.1

Analyzing dependencies
[!] The dependency
RestKit (~> 0.24.0)
is not used in any concrete target.
The dependency
SimpleKeychain
is not used in any concrete target.
The dependency
AWSS3
is not used in any concrete target.
The dependency
VideoCore
is not used in any concrete target.
The dependency
SDWebImage (~> 3.7)
is not used in any concrete target.
The dependency
SVPullToRefresh
is not used in any concrete target.
The dependency
PubNub (~> 3.7.11)
is not used in any concrete target.
The dependency
MZFormSheetController
is not used in any concrete target.

Answer

From the pod update logs seems like CocoaPods can't find any target where the libraries have to be applied.

Can you try something like this in your Podfile?

target 'YOUR_TARGET_NAME' do
    pod 'RestKit', '~> 0.24.0'
    pod 'SimpleKeychain'
    pod 'AWSS3'
    pod 'VideoCore'
    pod 'SDWebImage', '~>3.7'
    pod 'SVPullToRefresh'
    pod 'PubNub', '~> 3.7.11'
    pod 'MZFormSheetController'
end

Not sure if it will fix the error you have.