'Uncategorized' Xcode Error - xcode4.3

I'm having this WEIRD Xcode error - Uncategorized error.
It seems to look for a file which doesn't exist.
The problem is that I don't see any reference to that file on my project.
Is there any place else that Xcode saves its project file references?

Build Phases > Copy Bundle Resources

Related

Linker command failed with exit code 1 - duplicate symbol __TMRbBp

Since I've updated to Xcode 8.1 I can't archive and also not run in Release mode (in debug mode its working). The error is that there are several "duplicate symbols for architecture arm64" and all are "duplicate symbol __TMRbBp". Whats that?
It seems to be a bug in Swift. See
discussion on Apple developers portal
It is said to be fixed in Xcode version that is about to be released.
But for now there is temporary workaround:
Go to your target Build Settings and set Reflection Metadata Level flag to None
Don't double click Project.xcodeproj to start your xcode project. Instead, close your project and open the xcworkspace.
File -> Close Workspace
File -> Open -> Search your project folder for Project.xcworkspace
All my errors are gone.
I faced the same problem with archiving on Xcode 8.1.
X Code Version: Version 8.2.1 (8C1002)
The following fix worked on Mar 2019
1) Go to Project & Select your Project
2) Select Build Settings -
Search for "Enable Bitcode" Set option as "NO"
3) Most of version will fix this issue, for few other XCode version try this option also,
Search for "Reflection Metadata Level" Set option as "NONE"
I had similar issues with Version 9.2 (9C40b), the solution is
0) Close Xcode
1) Open project folder in terminal
2) pod update
3) open .
4) open project by clicking Project.xcworkspace
Surprisingly, in some occasions, simply cleaning the product worked for me.
Product/Clean (Shift+Cmd+K)
Product/Clean Build Folder (Alt+Shift+Cmd+K)
Quick fix to try before looking at other solutions.
1.Close your project:Completely quit Xcode.
2.Go to your project location:there you will find two files in you root folder with varying extensions:
Appname.xcodeproj and Appname.xcworkspace
Now open your project by Double clicking on file with the extensions xcworkspace.(***Appname.xcworkspace*)**
Yourproject will open in xcode.
Now run your project again.
If you pay close attention when installing your pods,firebase makes it clear to open your project with your-project.xcworkspace after installing pods
firebaseIOS Setup
$ cd your-project directory
$ pod init
Add to Podfile
pod 'Firebase/Core'
And finally:
$ pod install
$ open your-project.xcworkspace
Dont forget to add firebase to your AppDelegate
If you're using Ionic and the Push and Console plugins that's the problem. Remove the cordova console plugin (which is deprecated) and the error will disappear.
The linker error is saying that a library is duplicated which is, in fact, true because the console plugin is already in cordova-ios 4.5+
It took me a couple of hours to figure this out!
In my case
Select your project (In my case i have 2 targets)
Go to Build Phases
Compile Sources
Check if the number of items on each targets is the same (mine was different)
Add the missing file / Remove the duplicated file
Problem Solved
I ran into this problem recently creating a new project and adding some pods (AlamoFire specifically) to the project. Troubled with it a couple hours or so recreating the project (it was new) several times. Tried all the methods here and no luck.
Eventually I figured out that it was because XCode V10.1 was also opening the old project file along with the new pod-created workspace when I opened the workspace via command line "open myProject.xcworkspace" when I reopened the project after doing "pod install"
Closing all projects before exiting XCode before I did my "pod install" fixed everything for me.
close you project then open xcode go to file -> open search your project and open it . this worked for me
I got this error due to deletion of some files. For me simply cloning my project worked.
For those that can't get the Thorax's answer to work, what I did was I closed out Xcode, ran pod update on my command line and then reopened the .xcworkspace file. After doing that, I was able to build and run the project.
I am using the Firebase Cocoapod and Xcode version 9.1.
I had removed files from Compile Sources in Build Phases in Targets. I added main.m and it worked.
Had the same problem in Xcode 10.1 and was able to resolve it. In path Project Target > Build Setting > No Common Blocks, I changed it to No.
I had similar kind of problem when I added a framework to my project.
I have resolved the issue by removing the framework and again adding the framework to the project by dragging and dropping the framework file to the projects frameworks folder and selecting the Copy items if needed option.

iOS giving cookie.mom error when building MFP project

We have a worklight project version 6.2.0.1 and I have migrated it to MFP 7.
During my build (Ant or eclipse) I'm getting this error for iOS:
ANT:
builtin-copyPlist --convert binary1 --outdir /Users/Sam/Desktop/ProjectName/temp/source/ProjectName/apps/ProjectName/iphone/native/CordovaLib/build/ProjectName.app -- WorklightSDK/resources/Cookies.mom
[exec]
/Users/Sam/Desktop/ProjectName/temp/source/ProjectName/apps/ProjectName/iphone/native/WorklightSDK/resources/Cookies.mom:0:
error: reading data: The file “Cookies.mom” couldn’t be opened because there is no such file.
If I built the project through eclipse and ran it to xCode i get:
Inside WoklightSDK, I don't see the cookies.mom
How to fix this error?
The mentioned files in the screen shots no longer exist in a MFP project (so it is OK that they are not there in a fresh project) The migration process was supposed to remove them and so the build should not have errored on them.
But you're getting an error, this means to me that the project was not migrated to MFP 7.
Edit: per the test project in the PMR you've opened, this is happening because in your project you use using the nativeResources folder. Use of this folder is no longer considered a best practice you should stop using it.
The error here is that After the migration process, that part of it removes the old cookies.mom files, the builder takes the contents of the nativeResources folder and copies it to the native folder. In this process it replaces the updated .xcodeproj (now with removed references to the cookies.mom files that no longer exist), with your old .xcodeproj file that does contain these references - to files that do not exist... thus when building in Xcode, it fails because it has references to files that do not exist.
Delete the .xcodeproj file from your nativeResources folder and re-building. Next, in Xcode, re-references your custom class files. After the build succeeds in Xcode and your app is working, copy back the updated .xcodeproj file to the nativeResource folder, if you choose to continue using it.
By continuing to use this folder, you void your support - as I mentioned, this folder is no longer considered a best practices and may disappear in the future.

RNCryptor Dyld Error Message: Library not loaded

So, I've tired everything to get this to work after I've archived the application, but it keeps failing to open with the error message:
Dyld Error Message:
Library not loaded: /Library/Frameworks/RNCryptor.framework/Versions/A/RNCryptor
Referenced from: /Users/USER/Desktop/Project.app/Contents/MacOS/Project
Reason: image not found
I've added the Framework to the Copy Files Build Phase, I've changed the Runpath Search Paths to #loader_path/../Frameworks and the Framework Search Path to #executable_path/../Frameworks and it still doesn't want to open.
It opens fine in Xcode itself, but as soon as it's archived, it complains and doesn't run.
Any help is much appreciated :)
Ok, so I was able to fix it.
So the application was actually looking for the Framework in /Library/Frameworks/ on my Mac, I originally had thought it was looking for a reference in my actual .app file.
To fix it I opened up Terminal, cd' into the folder containing a copy of RNCryptor.framework and used this command
install_name_tool -id #executable_path/../Frameworks/RNCryptor.framework/RNCryptor RNCryptor.framework/RNCryptor
Then removed the old framework from the Xcode Project and re-inserted it using the Framework I just used from the directory I cd' into, and added the new Framework to the Copy Files Build Phase.
And voila, it worked :)

Compile, Build or Archive problems with Xcode 4 (and dependencies)

This question has evolved over the past several weeks to cover more general issues with xcode4 (and upgrading projects form older xcodes).
However many of the issues can be solved by following the same set of instructions.
If you have any of the following issues, try the methods in the accepted answer:
Xcode 4 fails to archive an App
Xcode 4 creates an unusable archive
Xcode 4 does not create an .ipa
Xcode 4 fails to compile due to preprocessor errors
Xcode 4 cannot find headers
Xcode 4's code complete is not working
Project dependancies won't compile
Adding a dependancy causes any of the above issues
Original Question
Title: "lexical or preprocessor issue file not found" in Xcode 4
I have a project in Xcode 4 that will build fine and run on the device and simulator but when trying to Archive it errors when looking for headers files associated with a static library:
In file included from /Volumes/Development/Path/LBProject/LBProject/LBProject-Prefix.pch:15:
In file included from /Volumes/Development/Path/LBProject/LBFDefines.h:23:
In file included from /Volumes/Development/Path/LBProject/Classes/LBProjectAppDelegate.h:11:
In file included from /Volumes/Development/Path/LBProject/LBProject/../FKNDirectory/FKNDirectoryManager.h:10:
/Volumes/Development/Path/LBProject/LBProject/../FKNDirectory/FKNDataModel.h:11:9: fatal error: 'Merchant.h' file not found [1]
#import "Merchant.h"
^
1 error generated.
Xcode gives the error
lexical or preprocessor issue file not found
Much Googling has show many people are having this issue but no solution. Anyone got a fix or even a clue.
Update: The user header search paths are set to ${BUILT_PRODUCTS_DIR} in all configurations. It builds fine using any configuration except when archiving.
Update 2: Merchant.h is a Core Data class that is auto-generated and therefore inside .xcdatamodeld package, however the headers are all copied to the public headers directory when the library is built.
NB: The steps below will solve 90% of your Xcode archive issues
however, from the comments it is suggested you try quitting Xcode
first. This may save you hours of setting tweaking.
Check the "user header paths" are correct (Add "" to paths for spaces, both in your project and dependencies)
Set "Always search user paths" to YES
Create a group call "Indexing headers" in your project and drag the headers to this group, DO NOT add to any targets when prompted. This includes any headers inside your .xcdatamodeld, you'll need to right-click and view package contents to find them.
For all dependencies set "Skip Install" build setting to "Yes"
Moving any "Public" headers in Build Phases to "Project"
Set the Build Setting "Installation Directory" on your Target to $(LOCAL_APPS_DIR)
Change the target build setting "scan all source files for includes" to YES. (link)
With newer versions of Xcode (> 4.2) you might want to read this question related to workspaces.
Manually delete the project.xcworkspace files form all referenced projects
I had the same problem in XCode 4: "Lexical or preprocessor issue MyFile.h not found". However, MyFile.m was not a static library, just a standard class. And MyFile.m and MyFile.h were included properly and indexed in the project.
So ... I quit XCode and the Simulator, then restarted them and the problem disappeared.
I found that the problem went away when I changed the target build setting "scan all source files for includes" from no to yes.
I was able to resolve this issue without any changes to any of the build settings by simply copying the .h files into the Project's directory in the finder. I did NOT add them to the project at all. Just having them in the project's filesystem directory seemed to be enough to allow Xcode's implicit linking to work properly. More details here.
I had a weird issue like this. Changing "Scan all resource files..." to Yes didn't help. I took a look at the Framework Search Paths and noticed that I had
$(inherited)
"$(SRCROOT)"
"$(SRCROOT)/my/correct/path"
It seemed right but was still failing. I then tried rearranging the order of 2 & 3 and all of a sudden it built fine. So not sure why that was the hickup, but wanted to add it to the list of things to try in case it helps someone else.
My solution was to change my
#import "HeaderFile.h"
to
#import <FrameworkName/HeaderFile.h>
and everything started working again.
What was unusual was that it had stopped working suddenly after building
a few times.
The problem resolved itself when I set
Build Settings->Project->Search Paths to Yes
I had the same — 2 targets in my project (Project and ProjectTest of GHUnit). When my scheme was set up to Project, the import of <GHUnitIOS/GHUnit.h> was problem of “lexical or preprocessor issue file not found”. But when I set as a scheme ProjectTest, everything was OK. So, I have added GHUnitIOS.framework in Project too.
Looks like your header search paths are incorrect not configured properly in your build settings for the active scheme. Verify them and update your question with the current setting.
I'm having similar issues on the simulator but not the device and my header search path fields are empty (Seems to be default). But changing Workspaces seems to have solved the issue. Maybe you could try creating a new Workspace, add your project to it and see if that helps. Now I'm investigating why.
I was getting this "file not found" error for one particular .h file in my project. I resolved the issue by removing that .h file from the project (selecting "Remove references") and re-adding it.
Adding on more variant: I had two instances of foo.m in the Compile Source build phase, which some how caused "Header not found" for foo.h.
Another chance:
In workspace project: watch in the Target for section Build Phases. As many manuals says you need to have a Copy Files Build Phase to copy all your headers to another place, as iOS Framework cannot contain header files to be shared (this is my case).
Choose for those Copy Files as Destination option "Products Directory". Or another directory of your like where the headers will reside.
That worked for me. Probably the build for Archive (or Release) directory is very different than expected in build for Debug .
Also check in your workspace settings your build directory.
XD
For me, this issue occurred after I added new files to the project; a blank .m and .h derived from NSObject. Here's how I resolved it:
Closed and restarted xCode
Deleted the two new files via XCode
Recompiled successfully
I then Re-added them afterward and it also worked.
Definitely a bug in xCode...

Can't run my app; “image not found” referring to bundled framework

I'm trying to include the Sparkle framework in my application. I don't really understand the specific steps necessary, and am now getting this error message:
Dyld Error Message:
Library not loaded: #loader_path/../Frameworks/Sparkle.framework/Versions/A/Sparkle
Referenced from: <..>/build/Debug/CoRay.app/Contents/MacOS/CoRay
Reason: image not found
So my question is two part:
1. How do I fix my problem?
2. What is the correct path for including a framework into a Cocoa/Obj-C application?
The error is saying that it cannot find a copy of the sparkle framework inside of your app bundle.
You need to add a new Copy Files build phase to your target. Set it to "Frameworks" to copy frameworks and drag a copy of Sparkle.framework from your Xcode project into the new Copy Files build phase that you have just created.
After adding Sparkle.framework in "Copy Files" phase, you have to remove it from "Link Binary With Libraries".
Cheers.