No Such Module 'Parse' - swift

I am copying the parse frameworks to my Xcode project and checking the checkbox that says Copy files if needed.
Projects runs without a problem. But when if I move the Parse SDK folder to the trash Xcode says "No Such Module 'Parse'".
It should not say that because I am copying files not making file references to my project. How can I solve it?

I just had this problem, and I got it to work by doing this:
I opened my Target > Build Settings > Search Paths > Framework Search Paths.
I added two values: $(PROJECT_DIR) and $(inherited)
I don't know why these were empty in the first place, but there you have it.

I was having the same issue.
In my case, using swift and CocoaPods, I didn't have to import Parse in my AppDelegate. I only needed to #import <Parse/Parse.h> #import <Bolts/BFTask.h> on my Bridging header.

The issue for me was related to removing the comments in the podfile necessary for Swift to work. Check it out here.
"Replace the two commented lines with the following:
platform :ios, "8.0"
use_frameworks!
This tells CocoaPods that your project is targeting iOS 8.0 and will be using frameworks instead of static libraries."
http://www.raywenderlich.com/97014/use-cocoapods-with-swift

Firstly, clean the project. Then delete all the Parse SDKs you have. Then add the sdks to the project and also move the actual framework to the Projects folder.
Hope that helps,
Julian

I had a similar issue but only one view controller was telling me there was no PARSE. I fixed it by copying everything below the import Parse statement, then adding a new view controller with the same name. Then I just pasted my code back in.

In my situation I had to keep on removing and then adding it every single build. The problem was that I had a space in my project file (NEVER DO THIS it creates so many problems). For example you name your app "Example App". This will make all the folders have spaces in them. So instead of having one row in Frameworks search paths your will have 2 since xcode will create another row when it sees the space. They will be $(PROJECT_DIR)/Example and App/parse-library-X.X.X due to an error in xcode. To fix this problem replace these 2 rows with one that reads $(PROJECT_DIR)/Example\ App/parse-library-X.X.X. Note the forward slash makes xcode read it as one file address with a space in it. This is also how you refer to folders/files in finder that have spaces in them.

Differences in ios versions are causing problems
AppDelegate has methods that can be used depending on the ios version, and methods that cannot be used.
If they are present, xcode will not load the library.
So adding the following to the top of each AppDelegate function for solves the problem.
In Swift, you use the #available attribute to control whether a declaration is available to use when building an app for a particular target platform.
in my case add
#available(iOS 13.0, *)
import Parse become no error.

Related

Xcode cannot find my Localizable.stringsdict file

I am trying to add pluralizable localization to my Xcode project, using Xcode 11.2.1
I followed the steps in this tutorial: https://medium.com/#vitaliikuznetsov/plurals-localization-using-stringsdict-in-ios-a910aab8c28c , which is a pretty basic instruction on how these things work. Mine, however, did not work, SO, I tried the following:
0) Actually running the tutorial code to make sure it works on my copy of Xcode. It does.
1) Copying the example Localizable.stringsdict from the tutorial into my program, and using
the keys from said tutorial in my calls, in case I had made a bad Localizable.stringsdict
or was calling it wrong. This failed.
2) Creating the Localizable.stringsdict as a property list, as some older questions suggested, instead of a Stringsdict file when creating it new, and copying the known 'good xml' of the example plist into it. This failed.
3) I tried removing all localized content from the project, and re-adding the strings file and the stringsdict file. Now it can't find either of them.
Clearly I must be missing some configuration, some step, some way of saying HEY XCODE LOCALIZE THESE. When I look at the 'Localizations' tab in the Project, there is only 1 file localized, for "Base"
Yesterday, I succeeded to localize Swift App using this tutorial.
Please try to follow this tutorial. Thanks
Number 4 was the clue here. My project has a lot of targets. Add your stringsdict file to the targets it needs to be added to. Derp.
I added the dict file to the proper target and everything works fine.
Always check the obvious stuff first.
Open your localized stringdict file, then in the right inspector click on Identity and Type you will see localization block with a button, click on it and project will recognize your file now

Finding the right way to include static libraries in Xcode

First of all I have to say that I'm new with Xcode and I found some things a bit comfusing for beginners.
For now I want to include SQLite support in my test app. I found the wrapper "FMDB" which seems very easy to use.
I was already able to include the .m and .h files into my project and setting the header line for bridging to Swift.
But if I build my app then I will get some link errors. I think the problem is that the sqlite library is missing. But I've no idea to include it. So I searched the web for some tutorials but all I found seems too old and didn't help me.
What I've already done are the following steps: I selected the top item of my project in the Project Explorer. Then I selected my build target and switched to the tab "Build Phases". But now I see no possibility to include the libsqlite.a file. I followed some suggestions and typed the keyword "sqlite" in the search field but I only get the message "No results found."
I'm using Xcode 8 + Swift 3 on Mac Sierra.
I think that U should find libsqlite.a file in the filesystem and only then add libsqlite.a to project by right click on project files in Xcode 8 and selecting "add files to " and select you .a library from system location like Homebrew's sqlite root folder, only then you can select this static library in "+" linking menu. Please read this answer:
https://stackoverflow.com/a/15974037/2835276
I solved my problem by including sqlite3.c and sqlite3.h from sqlite.org so every wrapper works fine.

why can't Xcode find this header file?

Hi I'm getting an xcode "no such file or directory" for:
#import "Three20Core.h"
I also note when I'm typing in the #import statement it recognises, and helps autocomplete, the "Three20Core.h" file, however when I compile I get the error?
This is the main library file header for the Three20 library (from Facebook). So I've got the three20 directory at the same level as my app directory. In the Xcode application target build settings:
Header Search Paths - "$(BUILT_PRODUCTS_DIR)/../../../three20" and recursive, and
User Header Search Paths - same as above.
Any fault finding advice?
See an expanded version of this answer here: Xcode 4 Archive Version Unspecified
I've found many issues with Xcode 4 when it comes to complex project structures.
Create a group in your project called "Indexing"
Drag the header files to this group
When asked to select a target uncheck ALL targets
This has solved most of my Xcode 4 issues.
Related questions:
Xcode 4 can't locate public header files from static library
dependancy
“lexical or preprocessor issue file not found ” in Xcode 4
Issue was my lack of understanding of the change in the Xcode 4 build system over Xcode 3. All that I had to do was set header paths to:
"$(BUILT_PRODUCTS_DIR)/../three20"
"$(BUILT_PRODUCTS_DIR)/../../three20"
per http://three20.info/article/2011-03-10-Xcode4-Support
Have you followed this steps?
http://three20.info/article/2010-10-06-Adding-Three20-To-Your-Project
I just had another possible cause:
After searching the whole folders, I found that there is another header file with the same file name but wrong path (and therefore it is missing to xcode). So make sure you don't have a duplicated header that has wrong path.

Xcode 4 autocomplete buggy

do you face also the problems with Xcode 4 autocomplete feature that used to work great on version 3.x.x?
I've imported in the Prefix some classes and Xcode doesn't want to help me with the code entry. I have to manually add above #implementation
import "myclass.h"
To make Xcode help me entering the class name, properties, methods, macros defined in the myclass.h. On 3.x.x I could import those important classes once in the prefix and the autocomplete feature worked without any problems anywhere in the project.
Sometimes Xcode goes even more stupid, it doesn't want me to help typing the classes like UIButton, UIView and the common method like
addTarget:action:forControlEvents: for my buttons.
Do you also has the problems I mentioned in the Xcode 4, any solutions?
I was able to correct this issue by setting Precompile Prefix Header to No in the build settings.
EDIT 3: Note that this indexing issues has mostly disappeared in recent versions of Xcode (4.1 for sure, latest pre-Lion 4.0.x I think), and that I do not use this workaround anymore, using pch... And in fact not using Xcode anymore... AppCode ftw! :)
An easy, but quite dirty workaround imho is not using precompiled header .pch file to do global includes, but instead go a global header .h, that you include... everywhere. That way indexing will work flawlessly...
I Know that's dirty, don't downvote me please :) I'll delete this answer as soon as someone propose something better! Which I would love.
Off-topic, but related, read somewhere llvm2 is not supposed to get a gain speed with .pch files. which kind of deprecate them.
EDIT: Just checked to be sure of my answer, latest version of Xcode (4.0.1 when writing this) looks like fixing that bug for me. Did you upgrade to latest version?
EDIT 2: Removed my global import header .h, all its references, and moved my global imports into .pch file... That doesn't work as well I expected, latest Xcode 4.0.1 improved on this part but still have some cases where it fails. (I'm working on a project with hundreds of files). Looks like cleaning index/restarting Xcode fix it. I might consider reverting to my dirty workaround...
I have found that changing compilers, building, and then changing back, and building again works relatively consistently. Wrote a post about it on my blog:
http://rhappsody.wordpress.com/2011/08/03/xcode-4-code-colouring-and-auto-completion/
I found that sometimes the autocompletion gets broken when dealing with stuff defined in the prefix header. One way to get Xcode to index those again correctly is to use the touch command in the Terminal, e.g.:
touch /Users/someguy/Document/Foo-App/Foo-Prefix.pch
Or add a new line to the prefix for the same effect. Xcode then gets busy reindexing and things work again.
I've faced the same issued as soon as I moved to XCode4. What I realised was that I needed to install iOS's documentation to have the code completion fully working.
Go to Xcode -> Preferences -> Documentation and click GET on the iOS 4.3 Documentation. In the iTunes-style status window, the download progress will be shown.

Build Error - missing required architecture i386 in file

I'm getting this error when building my iPhone application:
ld: warning: in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk/System/Library
/Frameworks/UIKit.framework/UIKit, missing required architecture i386 in file
It goes the same for all the frameworks in my app. It's very weird since this was not happening earlier.
This happens when you add a framework to your project and unintentionally copy the framework into your project directory.
The fix is to check your project directory (where you store your project on disk) for any iphone SDK *.Framework files and delete them.
Project will build fine afterwards.
I had this same problem, and the solution turned out to be an easy fix. Backup then open project.pbxproj (located inside your project file bundle) in TextMate or TextEdit and search for the section titled "/* Begin XCBuildConfiguration section */". Look for a key named FRAMEWORK_SEARCH_PATHS and delete it and it's contents (once per build configuration, so I removed it in two places). Here is an example of what I deleted:
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk/System/Library/Frameworks\"",);
My project now build for both the iPhone device and the iPhoneSimulator.
What has happened here is that Xcode has mysteriously added a "Framework Search Paths" entry that points to a particular iPhone device SDK. For example, mine was recently set to:
$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.1.sdk/System/Library/Frameworks
This leads the compiler to find frameworks of the incorrect architecture. Removing any values under the "Framework Search Paths" key in your target's build settings will resolve the issue.
I just wanted to mention that in XCode if you go to "Edit Project Settings"
and find "Search Paths" There is a field for "Framework Search Paths". Updating this should fix the problem, without having to hack the project file!
Cheers!
Jesse
Check that you didn't copy the framework into your project when you added it. If you copied it, it can't find the original paths. To fix this problem. Delete the AVFoundation framework from your frameworks folder in your project, then add it again, but this time, make sure you don't have copy check marked.
This fixed it for me!
I fixed it in a different way.The reason why i was getting this error was that i added security.framework twice in my project.I was not able to see security framework in xcode ,i opened the project in finder and found this framework which i deleted and problem solved.
If your app is meant to run on the device, make sure you are not trying to run in it on the simulator. May sound obvious, but check anyway.
Though it is possible that something got deleted, it has been my experience that something gets screwed up in the project file. I have yet to pin down what that "something" is. I've had similar issues when the SDK installation is just fine. There are a couple of options.
First, add all of your files to a new project. This seems to usually work. Kind of a pain, though.
Second, you can right-click project in XCode/Get Info/Build/Library Search Paths. Add new paths similar to /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.sdk/usr/lib. Add appropriate versions of that string for each version (2.2.1, etc) and platform (simulator or iPhoneOS). Perform a similar action for Framework Search Paths if frameworks are your problem.
Third, which is more work but more reliable, is to open project.pbxproj from within MyProject.xcodeproj (Textmate is good for this). Look for "/* Begin XCBuildConfiguration section */", then "LIBRARY_SEARCH_PATHS" and "FRAMEWORK_SEARCH_PATHS". Add or modify the paths as appropriate, and save the file.
In any case, a pain in the butt, and I'd sure like to pin-point the cause because I've had this happen a couple of times. Project builds fine, then just up and refuses to do so with what seems to be little reason.
"Edit Project Settings" and find "Search Paths" There is a field for "Framework Search Paths". delete all!!
It just happened here to me as well. Thanks to a great partner we found the answer. Your Xcode may be pointing to the simulator ..change it to a IOS device instead ..built smooth after ....
Run the file command on the framework from Terminal:
file /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk/System/Library /Frameworks/UIKit.framework/UIKit
You should get back a message telling you which architectures the UIKit binary is compatible with. If you don't see "i386" listed, then you've somehow managed to remove the i386 version of UIKit, which will mean that you can't build for the simulator.To fix that, you'll have to re-install the SDK.
If you get some other error, hopefully it'll help you figure out what the actual problem is.
I just want to let you know that In my case, I was having the same problem, I realized that I had an older Xcode folder called Xcode3.1.3 I just rename it because it was an older version and that did the magic for me.
Check your library search paths in your target settings. Sometimes goofy libraries get entered in there and this will give you a similar error.
You can remove all entries in this section.
I'd just experienced something slightly different, because I work on my own library (WM_GSRecognizerLib), but the error is the same.
What'd happen: due to some updates, the path targeting the lib to include (.a) was from the "Debug-iphoneos" folder (where it is generated). Compiling for Generic iOS Devices worked fine, but not for simulator, complaining for the missing i386 architecture.
What I did for this issue, is to also include the binaries from the "Debug-iphonesimulator" folder.
It can help for this topic, because the explanation is here: devices require binaries for arm64/armv7/armv7s, while simulator does need i386.
My solution was to set on simulator target debug YES, just look on git status to see the new line added as architecture only on .project. if you don't set this the build will run to all architectures and will show some missing architecture like i386 or other.
NOTE THAT obviously the main issue is to use some framework that implements some kind of specific architecture.
I too got the same error am using xcode version 4.0.2 so what i did was selected the xcode project file and from their i selected the Target option their i could see the app of my project so i clicked on it and went to the build settings option.
Their in the search option i typed Framework search path, and deleted all the settings and then clicked the build button and that worked for me just fine,
Thanks and Regards