Pod update has fatally altered app - ios

My perfectly working app used to have an Xcode Project Navigator as shown below.
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.
Install all iOS simulators after Xcode update
Open Xcode preferences (Cmd+,) and navigate to ”Locations” tab where will be shown path to ”DerivedData” folder
Click on small circle with arrow on the right side of shown ”DerivedData” path to open it in Finder
Quit Xcode
Remove ”DerivedData” folder
Clean up CocoaPods (if integrated with it) caches by entering this in Terminal:
rm -rf ~/Library/Caches/CocoaPods
From project root (where Podfile is located) run this in Terminal:
pod deintegrate MyApp.xcodeproj
Remove from project root (where Podfile is located) Podfile.lock file
From project root (where Podfile is located) run this in Terminal: pod update
Launch Xcode (hit Shift + Cmd + K just in case)
Try build project
After doing all this my Project Navigator now looks like this.
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.

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.

Related

Swift app downloaded from source control doesn't run on my machine, runs on coworkers

The bounty expires in 3 days. Answers to this question are eligible for a +50 reputation bounty.
Oscar A Garcia wants to draw more attention to this question.
A coworker and I are taking over an iOS app hosted on GitLab. This app utilizes cocoapods, and the Pods directory is included in the repo. My understanding is we should be able to pull the repo and run it on Xcode without issues.
My coworker is able to download the app from source control and run it on his machine. Mine is getting errors such as "Cannot find type 'AnimationView' in scope". He is running an M1 MacBook, I'm running an intel-based MacBook air. I'm opening the workspace file that was generated by CocoaPods, not xcodepro.
Here's a list of things I've tried:
Regenerating the pods via the command line by running pod reintegrate, then pod update, opening Xcode and cleaning the build folder, and then running again.
Changing the minimum iOS deployment target on Xcode to the highest deployment target of the pods in my podfile.
Changing the architectures on the app build settings to i386 and x86_64 rather than the default.
Clicking "Update to recommended settings" when Pods throws a warning.
None of these seem to work, I'm at a loss at this point. Since it runs on my coworker's machine I'm assuming there must be something wrong with how my app is detecting the libraries or how it's compiling.
Here's my podfile:
# Uncomment the next line to define a global platform for your project
platform :ios, '13.0'
target 'projectname' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for projectname
pod 'Purchases'
pod 'Firebase/Analytics'
pod 'Firebase/Core'
pod 'Firebase/Storage'
pod 'Firebase/Database'
pod 'Firebase/Firestore'
pod 'Firebase/Auth'
pod 'SwiftyJSON'
pod 'CleanyModal'
pod 'MagicTimer'
pod 'lottie-ios'
pod 'FBSDKCoreKit'
end
I suspect the problem is not related to pods.
The reason for this is if you start a fresh iOS Xcode project, called emptyproj, and then close the iOS project in Xcode, you can then go to that project directory and place in a Podfile into that directory with your above contents but with the name projectname replaced with emptyproj, you can then do
pod install
and then once it has created emptyproj.xcworksapce open it in Xcode.
You will notice that there is no symbol called AnimationView. There is only LottieAnimationView.
So the missing symbol must be in the actual app on GitLab, not the pod dependencies.
What I suggest is to look at any build phases in the build of the project to see if any scripts that are architecture-specific get run.
Another debugging strategy is to get your co-worker onto your machine and do the setup herself on your machine, which might succeed (an unmentioned step) or fail (stronger evidence that it is a machine or architecture related matter).
This looks like you have different version of lootie , ask your coworker to check version he is currently using
for this you can use command:
pod outdated
When you run pod outdated, CocoaPods will list all pods that have newer versions that the ones listed in the Podfile.lock
then
use pod with specyfic version like this:
pod 'lottie-ios', '3.5.0'
instead of:
pod 'lottie-ios'
If you didn't add version when you run 'pod install' you will get newest available version.
and AnimationView is part of lottie liblary.
After adding version number run 'pod install'.
In such a case you can ask for the Podfile.lock of your co-worker and can check for the already installed specific version of the relevant pod, and if there any mismatch with there installed version with yours, update your pod file by adding that version and then pod install. and also if you guys don't need to work with latest version of the pods it is always better to use pod with versions.

Cocoapods "Framework not found Pods_<my_project_name>"

I am trying to set up Cocoapods with my project for the first time, to use one framework that only comes as a pod. I already have an xcworkspace file, so I specified that in the Podfile. When I run pod install, it adds a reference to a framework Pods_<my_project_name>, but Xcode can't find that framework at build time. I can't find it on disk either. I see the framework for my one included pod framework in the Pods directory, but no Pods_<my_project>.framework.
If I delete the reference to the errant framework I can build, but it comes back if I run pod install again.
My issue is very similar to this reported issue, but I am definitely opening and building via my xcworkspace file.
When I first ran pod install it warned about some things, like including a reference to their xcconfig file in mine and setting $(inherited) in some settings I had values for - I fixed all those, and pod install no longer produces any warnings.
What is this framework supposed to be / do? Where is it supposed to live?
EDIT: Here's the Podfile:
platform :ios, '12.0'
workspace 'iOS'
target "MyProject" do
use_frameworks!
pod 'AdaptiveCards', '1.2.7'
end

Xcode 10, not building pods can't build project

After updating to the latest Xcode to support ios12
I can't build my project
It seems that none of the pods are being compiled.
I'm getting an error for unknown import such as "file not found" (ex 'SDWebImage/UIImageView+WebCache.h' file not found)
(if I comment everything related to this, it's just showing an error for the next package that does not exist)
for plugins installed from pod.
if I add the pod scheme and compile it, and then compile my project all the imports are working fine
but then I get this compiler error for every package:
Showing Recent Messages
:-1: ignoring file
/Users/administrator/Library/Developer/Xcode/DerivedData/XXXProject-
ajmnddfiwycmqihdrqgzcltbrovs/Build/Products/Debug-
iphonesimulator/Pods_XXXProject.framework/Pods_XXXProject, file was
built for archive which is not the architecture being linked (i386):
/Users/administrator/Library/Developer/Xcode/DerivedData/XXXProject-
ajmnddfiwycmqihdrqgzcltbrovs/Build/Products/Debug-
iphonesimulator/Pods_XXXProject.framework/Pods_XXXProject
My pod file is very simple, my projects have 3 extensions
It worked fine before the update.
I've tried removing, installing few times, updated my pod to 1.5.3
Nothing seems to work.
(tried even with the pod beta version 1.6)
Tried both Legacy and New System build getting same error for both.
In the project build phases, everything seems fine and should be copied.
(using use_frameworks!)
This is how my podfile looks like
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
target ‘XXXXX’ do
pod 'GoogleAnalytics'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'FBAudienceNetwork'
pod 'FBSDKLoginKit'
pod 'Fabric', '~> 1.7.6'
pod 'Crashlytics', '~> 3.10.1'
pod 'AccountKit'
pod 'SDWebImage', '~> 4.0'
pod 'BEMCheckBox'
end
Any ideas what's wrong?
This is the problem of your previous cache store in the derived data folder.
Go to the DerivedData folder.
Close XCode.
Delete your apps from DerivedData folder.
Reopen XCode, clean project and run again.
XCode preference > Locations > Derived Data (click right side icon in the directory path, it will open DerivedData folder)
Select your pod from the left project navigator. > Select Target. >
Select "Build Settings". > Build Active Architecture Only to No
Here is another case: make sure "Scheme" > "Build" > "Find Implicit Dependencies" is turned on.
I turned it off (tried to fix another problem) and spent quite some time trying to fix the build.
In my case
pod deintegrate
pod clean
pod install
then rebuild the project works.
My XCode = 11.3.1
I had the same problem with Xcode 10 and newly added pods.
I've noticed new pod was not added to Target -> Build Phases -> Link Binary With Libraries. When I added new pod-framework manually, archiving worked ok.

I have an error with pod install Kanna

Screen my Terminal
Whats the problem with my podfile?
I add it to my Podfile:
use_frameworks!
pod 'Kanna', '~> 1.1.0'
P.S. JSON and Alamofire works are excellent!
The console output from cocoapods reads:
Analyzing dependencies
[!] The dependency `Kanna (~> 1.1.0)` is not used in any concrete target.
Without seeing your podfile I'm only really guessing here, but from my experience that error means that your podfile isn't formatted correctly. Recently they made some changes to the podfile structure so if you have an old podfile but updated Cocoapods to a new version it is likely that your podfile won't work.
Everything in the podfile now needs to be explicitly attached to a target by placing it in that target's block. If you run pod init the podfile generated should have a couple of blocks that look like this:
Target 'Your App' do
end
You may also have targets for Your App iOSTests and Your App iOSUITests. If you open Xcode you'll see these targets correspond to the top-level folders in your project.
You'll want to place the pod 'Kanna', '~> 1.1.0' between the Target and end to attach it to that specific target.
If you have an old podfile without these targets I would recommend starting again with a fresh one generated by running pod init, though if you want you could reformat it to be in the above format.

Cocoapods missing pod include files when removing all test pods

I have an iOS project I've been working on for some time, successfully, in which I used several pods for my main target, and then a couple more for my test target. Everything went swimmingly.
I was using a pod for tests, Expecta, because I needed to test asynchronous code. Now that Apple has added support for asynchronous testing in the latest Xcode, I rewrote my tests to use that, and want to remove Expecta from my project.
After doing that, my tests no longer compile, with errors about the header files from the pods no longer being found. For instance, `'FacebookSDK/FacebookSDK.h' file not found' error compiling one of my tests.
I've tried deleting all the Cocoapod-generated stuff and redoing it from pod install with no luck.
Versions: Cocoapods 0.35.0, Xcode 6.1.1, OS X 10.10.1.
My new, no-test-pods Podfile is:
# Uncomment this line to define a global platform for your project
platform :ios, '7.0'
target 'Meow' do
pod 'AFNetworking', '2.4.1'
pod 'TestFlightSDK', '3.0.2'
pod 'AWSiOSSDKv2/S3', '2.0.11'
pod 'Facebook-iOS-SDK', '3.20.0'
pod 'TTTAttributedLabel', '1.10.1'
pod 'DTCoreText', '1.6.14'
pod 'ReactiveCocoa', '2.3.1'
end
target 'MeowTests' do
end
Removing the MeowTests target hasn't helped either.
While I was typing the above :) I found this question; which says to add a link_with line to my podfile, and change the configuration file setup in the Info pane of my Project.
However, because I was removing the last pod from my test target, I also needed to delete the CocoaPods-specific phases from my test target. In the Build Phases tab, I removed Check Pods Manifest.lock and Copy Pods Resources.
Now my tests run fine. (And I can start rewriting them in Swift :) )

Resources