Xcode error while archiving: No such file or directory - swift

I am trying to archive an App to generate an Adhoc version and I'm getting this error:
/Users/XX/Library/Developer/Xcode/DerivedData/XX-agdiwzkbuiqgyudhcwqimxlyeiqc/Build/Products/Debug-iphoneos/SQLite.swift/SQLite.framework: No such file or directory
I tried multiple solution from updating my Cocoapods to removing the Derived Data and nothing worked.
I'am using Xcode 8.2.1

If you are including frameworks or libraries in your project, make sure that you included them from the correct location. I ran into a similar situation where I was trying to embed a framework and it was pulling it from the DerivedData folder rather than the actual location.
It might be helpful to remove embedded frameworks in your Project file and then include them again. Make sure that the framework location is the actual path to the library relative to your project and not the simulator files.

How are you installing it? I guess you are using this right?
For Cocoapods are you using Xcode Beta. It seems that you need to work with the default one:
sudo xcode-select --switch /Applications/Xcode.app
If it doesn't work with cocoapods, try using it with Swift Package Manager

Ok so as SamG said, Xcode was actually pulling the SQLite.framework from the DerivedData for some reason.
Besides that, i removed the SQLite Pod and installed it manually following this
and now its working.

Related

Swift mongoc.h file not found

I am trying to install the Mongo Swift library using cocoapods but am fronting some problems.
As the documentation pointed out, for the mongo swift pod to work, it needs the mongo-c-driver. Which I installed using homebrew and is sitting in the Cellar folder in my usr folder(Meaning it is installed). I then modified the podfile the same as the example and when running pod install the library is correctly installed.
The problem then comes when i open the project and try to build it. I have now these two errors:
'mongoc.h' file not found
Could not build Objective-C module 'libmongoc'
I made sure that I open the xcworkspace and not the default workspace.
I also tried to add the path to the mongoc.h file to the Runpath Search Path in hope of some results but without luck.
As you may see i do not understand a lot of this and it basically could be something silly. But I do not know how to get this library to work.
So i managed to get it to work.
I don't know why this happened but the header and library search paths were set wrongfully. I had installed version 1.10 of the mongo-c-driver and the search version in xCode was set to 1.94.
I also was trying to modify the search paths in my own project rather in the cocoa project which led to absolutely no results.
TLDR; Add the correct include and lib folder to the Header/Library Search Path in Xcode and make sure you set it in the Pods Project.

Framework not found GoogleMaps sdk in iOS

I want to use google map to existing(not a new one) iPhone project.Now i am using Google map ios sdk and i successfully added google map framework to my project.But i got error like this
ld: framework not found GoogleMaps
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How to solve this issue.I am using xcode4.5 and google map iOS sdk version is 1.5. When i am creating new project with google map iOS sdk then no error getting for me.Error only for existing iOS Project.Please help me.
I solved my issue
You need to do this
Click on your project (targets)
Click on Build Settings
Under Framework search paths (set your framework path)
Following information for getting framework search paths
Right click on your framework folder (for ex: GoogleMaps.framework)
select Get info
copy the path from General->where and paste this path in your framework search path (path should contain in single line)
Good luck
I encountered a scenario in which I had to import a project that was using Google Maps and noticed the same problem - module: "Google Maps" not found.
To solve this problem it was necessary to delete Podfile.lock and Podfile folder and re-install the pods again. Good luck !
You can also :
- remove GoogleMaps from Podfile
- pod install
- add GoogleMaps to your Podfile again
- pod install
This solution works for me, you can also check the search paths a well.
Clean your project. The shortcut is command + shift + k. This will clear information that xcode has stored that might imply that the sdk isn't included.
Also press the project icon at the top of the hierarchy of files, press the target that is your project, press build phases, open link with binary libraries, and make sure that the google maps sdk is in there. If it is not, press + and add it in.
Follow the steps :
Download GoogleMaps-iOS-1.1.0.zip from their site
Unzip the file. You now have a GoogleMaps-iOS-1.1.0 folder
In that folder you have a GoogleMaps.framework folder.
Copy or move the GoogleMaps.framework folder to inside your project folder (in Finder).
Drag the GoogleMaps.framework folder onto your Frameworks group in Xcode.
In the options sheet, uncheck "Copy items into destination group's folder". Make sure your target is checked in "Add to targets". Click OK.
(Note that you can also do this the other way, by not copying it into your project folder and checking "Copy items into destination group's folder". Xcode will copy the folder itself.)
Import using #import "GoogleMaps/GoogleMaps.h". The angle bracket usually work too, but in this case it should use quotes.
From : <GoogleMaps/GoogleMaps.h> file not found Google Maps SDK for iOS
my problem was fixed by adding in:
build settings
Framework Search Paths
clickable and add the following lines:
"${PODS_ROOT}/GoogleMaps/Base/Frameworks"
"${PODS_ROOT}/GoogleMaps/Maps/Frameworks"
If you use Pods
Left menu > Pods > Pods > choose Framework > right menu > copy path from "ios/....."
My: ios/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework
Then Project > Build Setting > Framework Search Path > Click on
$(PROJECT_DIR)/ios/Pods/GoogleMaps/Maps/Frameworks/GoogleMapsCore.framework
Sometimes it happens when you are migrating the code from one system to another so your Framework search paths look empty at this moment, so one simple solution I try is to reinstall the podfile and it works for me.
I've been struggling with this issue for hours; I'm using CocoaPods, Swift and Xcode 6.1.1. I followed all the steps for including GoogleMaps in my project carefully, tried many different things like removing symbolic links in the downloaded package or manually linking the binaries in build phases or trying #include "GoogleMaps.h", #include "GoogleMaps/GoogleMaps.h" and "#include <GoogleMaps/GoogleMaps.h> in my bridge file, none of that worked... Finally used CocoaPods instead of including the framework myself and it worked! Hope it helps someone out there:
In the Podfile:
pod 'Google-Maps-iOS-SDK', '~> 1.9.2'
And in your Bridge file:
#import "GoogleMaps.h"
Delete derived data and delete Podfile.lock file and then run pod install.
Maybe it'll be useful for anybody, next steps helped me:
1. Delete "Headers" and "GoogleMaps" folders manually (from the Finder).
2. Run 'pod install'
3. Re-build the project in Xcode.
In my case, I forgot that I need to open the workspace file with pods, not the project.

the archive may be corrupt or unreadable

I was trying to crate an archive to upload the app for app store. But when i was going to create a archive by choosing correct provisioning (distribution for app store)in code signing identity(in project and targets also) along same bundle ID than, first of all archive do not shown in organizer although xcode says it's succeeded. Secondly when i go to folder /library/developer/xcode/archives than, it do contain .xarchive. On double click, it says "the archive may be corrupt or unreadable". How to get out from this problem .. please help out.
I've been struggling with this too for a bit, and I found that downgrading cocoapods from version 1.10.0 to 1.9.3 fixed the corrupt archive issues above. The command I used:
gem install cocoapods -v '<= 1.9.3' -n /usr/local/bin
Try this one,get the build from the Product tree in Xcode and create a new folder with name"Payload" and keep that build in that and compressed it and rename extension to ".ipa".That will ask for ipa,use ipa then.Try this

How to run phone gap with xcode4?

Since moving to XCode4, I have been getting errors like:
/VERSION: No such file or directory
cp: /javascripts/phonegap..js: No such file or directory
cp: /javascripts/phonegap..min.js: No such file or directory
error: /VERSION: No such file or directory
for projects that were working under XCode3.
Open XCodes Preferences, and navigate to Source Trees. If there is no PhoneGapLib entry there, try adding a new setting with the following values:
Setting Name: PHONEGAPLIB
Display Name: Phone Gap Lib
Path: /Users//Documents/PhoneGapLib
Note that the path should be to the location of your PhoneGapLib folder, and that it may not be in your documents folder, depending on how you installed PhoneGap.
I just learned about a great web service recently made available by Nitobi (makes of PG), which will automatically generate the necessary PhoneGap files you need for use in Xcode 4.
Just enter your project name, hit a button and they'll generate a zip file for you to download. This lets you set up a new project without messing with the command line.
You could set up a new project, then migrate your older project files over.
Did you search Google for this error?
I'm a bit of a noob with PhoneGap and Xcode still, but I know there have been recent issues with PG and Xcode 4. Perhaps you're experiencing the same issues as the commenters to this post: PhoneGap + XCode4 (and more specifically, here).

update iphone app "CodeResources file must be a symbolic link"

I tried to update an iphone app, which lies in an other "itunes connect" profile. I used "application loader" and everything is fine until I try to upload the zip file
I get this strange message and cant figure out whats going wrong
"The CodeResources file must be a symbolic link to _CodeSignature/CodeResources"
I opened the bundle and the folder _CodeSignature is there.
I compiled the app with my distribution profile (no problems)
How are you zipping it? I'm betting that FooApp.app/CodeResources is a file, not a symlink.
If you're using command-line "zip", you need to use zip -y -r to preserve the symlink.
Had the same issue with XCode 3.2.5 (new submission interface), and all it took was to:
delete the build folder
clean, and then
build and archive again.
I had the same issue. But then I noticed that I was building in release mode to the simulator, and not a device. When I targeted a device, I got the proper application file, which I then zipped with the iTunes Artwork and submitted without issue.
I had the same issue here but I "fixed" it after I changed the "Deployment Target" from 2.0 to 3.0 in the target I was building and removed the "Architectures" to only armv6 (before I had both armv6 and armv7). Finally I had to put 'No' to 'Build Active Architecture Only'.
I haven't figured out why I keep getting this error for every binary I create. I've followed all the standard procedures (double-checking my project settings, deleting build folders, cleaning all targets, removing and reinstalling certificates and provisioning profiles, creating and installing new certificates and provisioning profiles, repairing disk permissions, etc) but none of them seem to solve the problem.
I think the problem is that my XCode installation is unable to create symbolic links. I might reinstall it (or even OS X) to see if that fixes the issue permanently.
But in the mean time, this works for me. I use terminal to navigate into the binary and run the following commands
rm CodeResources
ln -s _CodeSignature/CodeResources CodeResources
This deletes the invalid CodeResources file and replaces it with the required symbolic link to _CodeSignature/CodeResources.
I just ran across this issue. It turned out, I had two info.plist files in my resources folder (one for the iPhone version and another for the iPad version). Once I took care of that, the issue went away.
Try this on the command line:
cd (to where your project is)
ln -s _CodeSignature/CodeResources CodeResources
I've just had the same problem. Turns out the project file project.pbxproj in Project.xcodeproj had been corrupted while uploading to an SVN server.
My solution was simply to revert to an older revision, which worked fine.
You have to:
1. Enter the AppName.app folder
2. Create a file named CodeResources
3. Open the file with a plain text editor
4. Type in _CodeSignature/CodeResources (The path where the actual CodeResources file is.)
{The app will now know where the CodeResources file is, and will have an account for all the files in the .app folder.}