No such module error after copy - swift

I have a working Xcode project, with cocoapods. I made a copy of my project to do some testing of new code. This was done to still be able to fix bugs, in the original, that users point out. But after i copied the project i can't build and run it anymore. The issue is a cocoa pod, SearchTextField to be specific, i get the error message 'No such module'.
To clarify, i didn't change any code yet. Just did a copy of the project and tried to run it.
I have done a clean before the build, but it did not help. Also i have reinstalled my pods, that also didn't help.
Why is it that i can't copy my project and run it? Could anybody, at least, point me in the right direction?
EDIT:
I now use the SearchTextField class without importing, by moving the swift file into my project. But now i have the same problem with IDZSwiftCommonCrypto, i think something is seriously wrong with my project. Removing and reinstalling of the pods does nothing.
Now i gradually disabled als imports and it seams like i have the same problem for all my pods. I think Xcode doesn't look at the right place for them, is that possible?

Related

SwiftUI builds successfully but preview fails

I'm on the latest OS and Xcode version (11.2) and for some reason my canvas just will not build. I keep getting X is not a member of PROJECT error. It's driving me insane. It was working not that long ago and I have no idea what changed to make it fail like this. I've also tried deleting Derived Data, restarting laptop...
I've made sure that all my files are included in my target and everything looks like it should be working properly, the app itself builds perfectly fine it's just the preview
The solution to my problem was that I had a file within my project named the same as my project name. The error messaging was not useful at all in solving this, but once I had renamed that file, the preview began working again.
So I had this same issue except I found out it was because I have custom build configurations and it didn't like the custom module name Xcode made. The solution was to rename the module to the same thing as debug and release in Build Settings > Product Module Name
I hope this helps someone

Swift - no such module PureLayout with manual installation AND cocoa pods? Its impossible?

I've tried everything. EVERYTHING. I have no. idea. what Im doing wrong here.
Ive downloaded test projects and followed every step under manual installation AND install using pods here: https://github.com/PureLayout/PureLayout#problems-suggestions-pull-requests
I already have Parse and some other modules installed via pods so I first went to pods. I first went to my pods file and wrote
use_frameworks!
pod 'PureLayout'
JUST as the working sample projects did. I then navigated to my project (I think I did this right - went to terminal did cd Desktop then cd my project name, didn't think I had to cd anywhere else) and ran pod install . After this nothing happened in terminal (I got no response no matter what I did) and no PureLayout files were added to my project.
I still got no such module Purelayout when trying to trying to import PureLayout so then I tried manual.
I have dragged the files here https://github.com/PureLayout/PureLayout/tree/master/PureLayout/PureLayout into my project and imported in my bridging header:
Tell me if Im missing something. I still get no such module - even checked in my build settings that it had the right bridging header. I can continue without this and have no ideas - What am i doing wrong?
Is this an impossible problem?

Xcode upgrade: PBXContainerItemProxy missing containerPortal key

I just upgraded my Xcode, now when I try to open my project, I get this error:
Project /Users/xxx/xxxx/xxxxx/xxxxxx/xxxxxxxx.xcodeproj cannot be opened: PBXContainerItemProxy (xxxxxxxxxxxxxxxxx) is missing a containerPortal key
I have searched the web and stackoverflow, but cannot get anything relevent to come up at all regarding this.
I do have Three20 as part of my project, I don't know if that matters. I just upgraded to xcode 4.4.1
Thanks for any insight.
-D
the project icon which we see i.e projectname.xcodeproj, is actually a directory, you do this
1. in terminal do cd yourproject.xcodeproj
2.ls
3.vi project.pbxproj
4. scroll down till /* Begin PBXContainerItemProxy section */
5.there you will see all sections check for the section which is missing a portal key edit it and save it :wq it will work
in image if you see the first section is missing container portal key.just pic it from other section and replace it..
it will work :D see this link
Now I should start with that I do not know the actual error, never seen it before, but I did find a reference to a "PBXContainerProxy"-error in this post (As soon as I add a project to XCode 4.0.2 it crashes) and thought you might try the solutions from there?
"Apparently this is due to the new version of XCodeProjects. I found a
work around by pre-compiling the library that was causing the issue
and then using the linker to link to the .a file. I also had to copy
the .a library into the DerivedData path.
The real solution was to remove the project and replace it with an
updated project for the new version of XCode."
Hope that helps somewhat :)
Never saw that error either, but if you're upgrading directly from XCode 3.X I'd suggest you to go to https://developer.apple.com/downloads/index.action?name=Xcode
and download/install a previous version of Xcode somewhere else. (You can have several different copies installed on your machine, just google it if you don't know how but just remember to use xcode-select to pick the one you want to use). Repeat with all the versions back to 4.0.1 until (hopefully) it works. I know it's tedious but it might help.
If it does, validate the project settings and try to open it with 4.4.1. That should work.
Good luck

Xcode 4 crashes when we run a project at the same time on two machines with Git

We have two developers working on the same project. This project is integrated with Git.
When one developer is working on the project and other developer tries to run the project, Xcode 4 crashes as shown.
What could be wrong and how to rectify it?
Thanks!
I think what has happened is that your project.pbxproj file has gone some merge conflict stuff embedded in it. Open it in a text editor and look for lines like:
>>>>>>>
If you see that, it means you need to clean up the file.
There's no way for git to be doing anything across systems while both developers are just working, so the issue is something someone checked in...
Another issue is that if a project file is changed by another developer, and someone pulls the changes with the project open, they have to re-open the project to see all of the targets as they are meant to be used in the project. I have not seen that cause a crash though.

Upgrade to iPhone SDK 3.0 Causing UIKit Problems

I have an existing project that I was working on, and I recently decided to update my iPhone SDK and updated to the latest 3.0 SDK.
I update my SDK and go to open my existing project. Sure enough, there are some problems including some certificate problems and so on. Anyway, google and I were able to solve most of them, but I haven't had any luck on what I hope to be the last of my problems.
When running my program in the simulator, I now get
dyld: Library not loaded:
/System/Library/Frameworks/UIKit.framework/UIKit
Referenced from:
/Developer/iGameLib/iGameLib/build/Debug-iphonesimulator/iGameLib.app/iGameLib Reason: image not found
Now, I discovered the UIKit has moved to
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0sdk/
System/Library/FrameWorks/UIKit
and I have updated my target and project settings to point to that new framework location, but still when I build it, no luck.
I have also tried clearing out the simulator's applications and settings, still no luck.
The referencing .app is cleared when I run the "clean" menuitem, I have confirmed this, so clearly something in my project settings are still pointing to use the old UIKit location.
Where should I be looking?
I've gone as far as I can to help myself but I'm afraid I'm at a loss here. I don't see it under the target settings, or the project settings, or the plist, or any of the other files within my project.
I was getting the same error
dyld: Library not loaded: /System/Library/Frameworks/UIKit.framework/UIKit
The solution on my case was simply quit Xcode and try again.
OK, SO I HAVE THE ANSWER!!!
Quite simply, Xcode is not changing all of the variables correctly in the actual .xcodeproj file. So, here are the steps I took.
Get out of Xcode, you've got to do this job at the terminal. Bring up a terminal and go to where your project is. Find your .xcodeproj and go into it as if it were a directory. It looks like an actual file in finder, but it is one of those package directories.
Now, I couldn't get textedit to allow me to edit it, but you can go into nano, so like I did
sudo nano project.pbxproj which is under my .xcodeproj file/folder/package/whatever.
In this file, you need to find where the SDKROOT is set. Chances are there are a few places it is referenced, but you're looking for SDKROOT = iphoneos2.2.1 or something similar. Change ALL OF THESE (there are a few) to SDKROOT = iphoneos3.0
Now, you're half way there. do ctrl x and save the file. Next you're going to do ls and find out what the .pbxuser file is. Mine is myname.pbxuser. run the same command of
sudo nano myname.pbxuser
In this file, there are a HUGE number of references to the 2.1 iphone sdk directory. Do a search/replace of iPhoneSimulatorOLDVERSION.sdk, in my case it was iPhoneSimulator2.1.sdk
and change the 2.1 to 3.0. Be very careful with this though, I wouldn't want to know what happens when you mess this file up.
Save it and open xcode. CLEAN the project and build and run. Presto!
Check your target settings
Make sure you're actually linking to all of those frameworks in the Target (check under "link binary with libraries")
Make sure you've chosen the 3.0 sdk as your base SDK
Create a blank project and add your frameworks as before; if you still have issues, probably a borked SDK install
BTW, you shouldn't have to re-add sdk frameworks, as the paths are relative to the current SDK
Just trying to be helpful… not sure I can debug from here :)
I have had some similar problems with Xcode that seem to have no apparent cause. The fact of the matter is that Xcode does still have bugs here and there and sometimes you WILL run into a wall.
My Experience: Similar to your situation somewhat, on one particular occasion, an Xcode project I was working just stopped building for whatever mysterious reason, and no amount of cleaning, googling or SO-ing provided me any answers. So I simply created a FRESH, NEW project and filled the source-code from my corrupt project into that of the new project. The new project used the SAME source, libraries, resources, settings, mind you -- and yet it built with no problems. It took about 20-25 minutes to make the transfer but considering that I had spent several HOURS trying to address a bug that would not reveal itself in the corrupt project, the time was well worth it.
So, I'd suggest doing what I did: Maybe try creating a fresh project and transfer your old source and resources over.
Good Luck
I just deleted the UIKit.framework from the 'Frameworks' folder, right-clicked and added it back again.
Clean build, and no problem..
I had the same problem using Xcode 3.2.1 but it was solved in an easier manner. I realized I had recently disabled my target's environment variables, specifically ones to do with memory debugging (NSDebugEnabled, NSZombieEnabled, NSAutoreleaseFreedObjectCheckEnabled, MallocStackLogging, MallocStackLoggingNoCompact). The app ran once in the simulator after removing the environment variables but never again after that.
Quitting Xcode, the Simulator, restarting Xcode and doing a complete clean of the target (including it's dependencies off course) brought me back to a good state.
Same problem when launching my application without debugging.
In my experience the produced binary does not seem to be the culprit.
I created an app from the xcode wizard which does launch OK in the simulator (let's call it testApp, my application being called myApp), I tried to figure out where is the difference with my app.
otool -L myApp
gives correct (relative paths) to the frameworks, same as testApp
ps -E
DYLD_ROOT_PATH, DYLD_FALLBACK_FRAMEWORK_PATH, DYLD_FRAMEWORK_PATH, DYLD_LIBRARY_PATH environment variables needed by ld to locate the framework
are OK for myApp compared to the values of these variables when testApp is launched
I suspect that the problem lies somewhere in the communicartion between XCode and the simulator once the app is launched ... altough I can't find what's wrong ...
The solution that worked (at least for me) have certainly some big side effects but here it is :
quit xcode
browse the content of the package myApp.xcodeproj
unlock .model1v3 and .pbxuser for modification (the lock in the information panel (cmd-I on the file))
delete these two files
start xcode and retry to launch your application from there