I am using CocoaPods with swift, therefor I need a pre release. I'm not sure whether I found a bug or maybe it's just a wrong thing I do.
If I want to remove a pod, I simly remove it from the podfile and call pod install again.
This works, but afterwards, the remaining frameworks are not recognized as frameworks anymore.
Is this the right way to remove pods and am I missing something? E.g. cleaning up my workspace or so?
Thanks
#Christian, removing from Podfile and running pod install at the command line should work. It sounds like a bug.
Can you post one or more errors about the frameworks so we have more to work with? Also, you should consider reporting it.
Related
I need to use CocoaPods for a specific library. However I don't want to use it for any other because it usually forces me to add React and its dependencies to the Podfile as well, which is a nuisance and can lead to several issues as in previous experiences.
In React Native documentation (https://facebook.github.io/react-native/docs/linking-libraries-ios) it is specifically said:
If your iOS project is using CocoaPods (contains Podfile) and linked
library has podspec file, then react-native link will link library
using Podfile. To support non-trivial Podfiles add # Add new pods
below this line comment to places where you expect pods to be added.
Is there any way to prevent this? If not, what is the best Podfile configuration that doesn't break (when RN is updated for example)?
The solution that I use is really a workaround. It is not great but it works for me. Ideally it would be nice if react-native link offered a -noPods flag but it doesn't.
react-native link checks to see if there is a Podfile, if there is no Podfile it links the dependency as normal.
So what I do is the following:
Make sure I have committed all the changes to git.
I then install the dependency using yarn or npm.
I delete the Podfile.
I run react-native link dependency_name
I then discard the changes to the Podfile (effectively undeleting it)
Alternatively you rename the Podfile to something else, and then rename it back after you have linked.
forgive my ignorance I am not too familiar with SWIFT but my developers sent me the package for one of our iOS apps. I wanted to make a small adjustment but everytime it's run it cannot find all the modules associated with Cocopods
When I originally received the files it came with a podfile and podfile.lock
I installed cocopods then in the directory I tried
pod install
When I try to compile it none of the modules can be found.
I tried removing the podfile and podfile.lock even starting from scratch doing a pod init and replacing the text.
I tried a
pod update and still no luck either. Any ideas what I need to be doing ?
So the answer of open xcworkspace instead of xcodeproj did the trick. Thanks
As you may be aware of it, Google now switch to Firebase instead of Google Analytics. So I tried to integrate it to my current working project. Admob is also integrated to my project with Pods.
I have followed Google's document and created a new pod and re-install with firebase. After it , now my project does not build.
Here is error
Use of unresolved identifiers "GADBannerView"
Try switching your imports to just:
#import GoogleMobileAds;
Everything should work as it was before, but using the module map is a great a way to pull in the headers rather than directly importing.
I have resolved it with:
-delete all pod related files from my project folder
-pod init
-re-add my required pods
-pod install
So I get this error as well with GADRequest errors even on Google's sample Banner project.
I fixed it with #Ian Barber's suggestion with #batgun's answer, of updating cocoapod version to 1.0.0 by running
$ [sudo] gem install cocoapods
https://guides.cocoapods.org/using/getting-started.html
then deleting all cocoapod items then install them again.
When I was in cocoapod version lower than 1.0.0, when I run pod install again, I still had errors, like "Use of unresolved identifier 'GADRequest'"
I retyped the whole thing and worked perfectly. When I was still not in cocoapod 1.0.0 version (i think it was 0.39 version), I can only find GADRequestError and not GADRequest.
When I retry extracting the original project now, do pod install and run the app, It doesn't throw any errors now.
I believe this has something to do with cocoapod version but it is not in google admob instruction to update it on.
I was trying to figure this out since the day of the release and losing hope for firebase because it was the sample basic banner project and it doesn't work!
VERIFIED!
I can verify it has something to do with cocoapod version.
I was trying to do the Google's Codelab 'FriendlyChatSwift' practice project since the release and throws a bunch of errors after running pod, not finding bunch of classes.
Steps:
$ [sudo] gem install cocoapods
I deleted the existing downloaded pods and related (ProjectName.xcworkspace, PodFile.lock, /Pods)
Run pod install
Build and Run of the project
It worked perfectly. I also tried running the project before doing this steps and It had bunch of errors.
I had this same issue and this helped me get setup the way I needed it but I don't think anyone touched on my exact issue. Thought I'd provide that just in case someone was looking.
After I cleared everything out and ran pod init I noticed that the generated pod file has use_frameworks! set in it. Once I added that everything was solved. Stupid mistake on my part since you need use_frameworks! for swift projects but leaving that out lead to a lot of random not found errors showing up and going away at random. Hope this helps someone.
I have a xcode (iOS) project in which i am cocoapods.
I have couple of pods installed:
SwiftHTTP & SwiftyJSON.
Now for some reason I decided to try another pod namely EZAlertController. Nothing wrong with the pod. But i decided not to use it. So I need to uninstall this pod from my project.
So far whatI have done:
remove pod 'EZAlertController', '0.3'from the podfile
run pod install which gave me the message of
Removing EZAlertController
No EZAlertController folder in the Pods folder either. So far so good.
Now i closed the xcode and reran the .xcworkspace file.
clean & build routine - all good - Again
P.S.(also tried pod update)
The Problem:
I am still able to import EZAlertController into the project and run. What is really annoying is that I forgot to take a git snapshot. So can't just revert back without loosing considerable amount of code.
Any idea on how to completely get rid of EZAlertController even after removing as there is still some linking with xcode :(
Try to clean the project: Product -> Clean and also Product -> (hold option key) Clean Build Folder
Maybe deleting the derived data could resolve your issue
I wouldn't remove the pod. I've had this problem before. I tried blowing away all the pods but continued to experience the problem. What I would do is blow away all the pods, reinstall Cocoapods to the project, then try installing it again.
Alternatively you can add the framework you need manually.
I have a currently working cocoapods, however whenever I want to add frameworks and run pod install I get this warning in the terminal and the project does not compile.
I have followed what it is suggesting, I already had the inherited flag in my build settings, and I tried deleting the EMBEDDED_CONTENT_CONTAINS_SWIFT from target build settings.
I have to run a git reset --hard to go back to my working cocoapods after removing the framework I wanted to add.
Edit: Added my podfile
Okay, so after a lot of pain and suffering, I found the solution.
We cannot have frameworks in cocoapods use other frameworks in your podfile. I was using Atlas but added custom implementation that included MBProgressHUD which was the issue. I cannot import MBProgressHUD into Atlas because thats what was causing the issues above.
Not sure why but that was all there was to it.