Can't use cocoa pod modules once installed into Xcode project - ios

I have install this cocoapod successfully and I am now running the workspace project instead of the Xcode project so I can successfully see the pod in the navigator.
I am now trying to import the module into my class by typing:
import OpenSphericalCamera
but I just get this error
No such module 'OpenSphericalCamera'
Are there further steps I need to do before being able to import modules into my class?

Please dont name your Project copied of the framework you installed. Or try Cmd + Shift + K (Clean build), or just Build it first (Cmd + B)

Try close xcode and reopen. Maybe the error gone ^_^

Related

Can't build on Xcode using 'capacitor js' commands

I'm practicing capacitor js, and was able successfully to package the (html, css & js) files and build them on 'android studio' according to the commands on 'https://capacitorjs.com/docs/android'.
Yet when i powered up macOS version 10.14 on VMware and tried to do the same steps 'https://capacitorjs.com/docs/ios' to build on Xcode, the following warnings and errors occured...
Bugs
I traced the path written in the error and couldn't find neither file nor folder named Pods....
The App folder
I'm using XCode version 11.3 and did install 'Node.js & Xcode command line tools' as mentioned as "capacitor js requirements" on the documentation, also installed CocoaPods.
It's my first time using macOS so I might have missed some additional steps that needed to be done.
Would be very thankful if anyone could guide me through that bug.
Looks like you've openend the .xcodeproj file. Don't do that, use the .xcworkspace exclusively. Also, if you don't have a Pods folder, you probably forgot to run pod install
Thanks to Gereon the step that was missing is to use the command pod install on the 'App' folder that has the 'Podfile.txt', it will extract some extra files including the required Pods folder.
App Folder After Using pod install
If after building you faced the following error...
failed to initiate service connection to simulator
Just clean the build folder and run again.
To clean the build folder you can use the shortcut Command+Option+Shift+K or Menu Bar → Product → Hold Option Key → Clean build Folder.

No Such Module 'Alamofire','SwiftyJson','UiKiT'

I am getting this build error on an existing project when I try to build project.
no such module 'Alamofire'
When I remove that line, then it start point to swiftyJson as
no such module 'SwiftyJson'
and when i remove that line and build again it start pointing UiKit as
no such module UiKit
Yesterday, I updated my xcode to 10.3 as I got a new update so installed that and after that I am getting this issue.
Then I downloaded previous version xcode 10.2.1 from apple developer site and now again I am getting this issue.
When I make a new project there is no issue like this.
i have tried reinstalling pods after some sort of search but not getting rid of this error.
delete derived data: go to Xcode -> preferences -> Locations -> then delete derived data
if that doesn't work try restarting your mac
Clean the project with 'command + shift + K'
or
if your project is uploaded in git repository, just remove whole project to trash and clone it

Xcode showing error 'No such module' even though I've installed Cocoapods and installed pod file of Dialogflow

I've been making a chatbot using Dialogflow formerly Api.AI but now encountering error while integrating the project to my app written in Swift in Xcode. I'd installed cocoapods using terminal "sudo gem install cocoapods" and using this version of Dialogflow to create the podfile.
All gone well but now when I'm importing inside Xcode in my app's AppDelegate.swift file using import ApiAI or import AI Xcode is showing me error that No such module. Please refer to image.
And on GitHub this library which is written in Swift, showing that it has depreciated and asking me to refer to API.AI's Apple Client library which is in Obj-C and unfortunately I've no expertise in Obj-C.
After installing a pod using Cocoa Pods, you must from that point forward open the workspace rather that the project file. The icons will appear differently in your project like so:
In the image you provided is clearly showing that you have opened the project file not the workspace one.
Go to Pods Build settings and set Build Active Architecture Only to NO. This always helps while using pods. After that clean the project once and then build.
After installing pod you should clean project (shift + command + k) and then builds (command + b) in it a few times. Repeat it a few times if it is not still working.
Hope this help!

linker command failed with exit code 1 (use -v to see invocation) swift

I had SwiftyJson installed via cocoapods. Then i removed it accidentally then installed it again now it is giving me this error. I really don't know what to do now. I tried everything. But no use. Anybody can with any clues or hints?
Try cleaning your project, it usually fixes problems like this, in your tool bar go to Product > Clean or press shift + cmd + k
otherwise reinstall your cocoapods with pod install in terminal while in the directory of your project
I want to thank all who helped me to solve this issue. I just wanted to say that i resolved the case. All the problem was that i had old pod dependency files left in the .xcodeproj original file. So every time the pod was installed the .xcworkspace used the old pod file within the schema. So i had to delete the old files completely from the .xcodeproj first.
I think you need to clean your
~/Library/Developer/Xcode/DerivedData/
folder for your project
I faced same problem with Alamofire and other libraries. I try a lot of ways it was not success.
Swift legacy versions must be same with your target, I use Swift 2.3 each target and library. I explain with images below, I hope someone use this.
Select your pod project and your library
Select Build Settings
Set Use legacy swift language version to YES (it is 2.3)
Select your project target
Repeat again 3. step
clean & build, that is!
Please confirm that you have dragged the pod.xcodeproj into your main project.If not, do steps as below.
1.To find the root of your main project in Finder.
Shortcut: Right Click your view file -> Show in finder
2.Add the Pod.xcodeproj in your main project [Click to look at the picture]
Add the Pod project in your main proj
3.Product -> clean
4.Rebuild

Alamofire for Swift 1.2 generates error

After upgrading to the latest build of Xcode and downloading the newest Alamofire release, I am getting the following error:
Module file was created by an older version of the compiler
With the previous version of Alamofire I added the entire AF project into my app as recommended, however the install guide for the latest version of AF says just to copy the .swift file into the project.
I am still calling import Alamofire in the file that requires it. This is also where the error appears. If I remove the import my project generates 86 additional errors.
For me Cleaning up the Build folder Cmd ⌘ + Alt ⌥ + Shift ⇧ + K worked.
Alamofire is updated now for Xcode 6.3, until I know its creator merge the branch for Xcode 6.3 into the branch master in Github , you have to download it to correct the errors for the new Xcode.
But I strongly recommend you installing Alamofire using CocoaPods, I think is better, it's up to you.
I hope this help you.

Resources