Xcode 4.5 building error: Malformed Object - iphone

I'm trying to build a project with Xcode 4.5.1, created with Xcode 4.4, but I'm getting following error:
codesign_allocate: for architecture armv7 object:
/Users/myUsername/Library/Developer/Xcode/DerivedData/MyAPP-araevdowzmmoupfieakjpjmpsmhq/Build/Products/Debug-iphoneos/MyAPP.app/MyAPP
malformed object (unknown load command 36)
/Users/myUsername/Library/Developer/Xcode/DerivedData
Can somebody help me please?
Thank you!
Update:
I still have this problem but only when compiling for iOS Device, not for the simulators. I'm not able to create an archive.
PLESE HELP ME!
SOLVED
The problem was due to a "Run Script" in Build Phases I was forgotten....and that pointed to the old path /Developer

Delete your derived data, perform a clean build, and try again.
To delete your derived data, go to Organizer->Projects, and select `Delete...'
To do a clean build, select Project in Xcode, and select "Clean"
Update: Validating your project settings may help here also. Go to your Project file in Xcode and select it.
Update 2: Something seems to be interfering with codesign, causing it to use an incorrect loading command. Maybe your old version of Xcode (4.4) left some artifacts behind, which is causing an old version of codesign to be run. I'd suggest uninstalling any instances of Xcode you have, make sure they're all gone, then re-install the latest version.
Update 3: I'm at a loss, I've no idea what's going on. My last suggestion is to create a new Xcode project, and migrate your stuff over; something may have interfered with your build settings, which might be a case of looking for a needle in a haystack. Make sure you have the latest Xcode and OS X.

Related

Xcode 10 archive build compile failure

Building on devices and simulator works fine in Xcode 10 but an archive build in Xcode 10 hangs up at the same spot each time (cpu maxes out too), at the very end of "Compile Sources" but never goes to the next build phase. Of course, when I quit the build I get an uncategorized SwiftCodeGeneration warning (also using legacy build system also fails, also same happens before and after updating to swift 4.2). Anyone else running into this?
Another note, not using cocoapods, tried removing all my embedded frameworks and still had the same issue.
remove the armv7 from supported architecture works for me
I found some answers to this problem.
I adjusted the level of optimization, this allowed me to get past the "compile sources" build phase (in particular "fastest and smallest" and "optimize for speed").
the compiling then got stuck on the "copy bundle resources" phase. making sure my project folder names matched the actual folder names and making sure all my resources were linked properly by deleting the reference to a few and re-entering them into the project I was able to successfully compile. Again this was a project that worked a couple days ago on Xcode 9. Hope this helps someone, cheers.

XCode 4.5 giving me "SenTestingKit/SenTestKit.h" file not found, but works on 4.4.1

I just installed XCode 4.5 and it's giving me a 'SenTestingKit/SenTestingKit.h" file not found error on one of my existing projects. This error only happens in XCode 4.5, but it compiles fine on 4.4.1. I've checked that the SenTesting framework has been added to the test target and I verified that the same error occurs on a few other machines. Has anyone else come across this?
Thanks in advance for your wisdom!
UPDATE
I was able to fix this issue by placing quotes around some of the framework search paths in build settings...
"$(SDKROOT)/Developer/Library/Frameworks"
"$(DEVELOPER_LIBRARY_DIR)/Frameworks"
Since I installed the XCode 4.5 GM alongside 4.4.1, I'm guessing the 4.5 version had a space somewhere in the name.
Perhaps it's just missing the framework and before it just referenced it and not copied to your project folder.
This might help:
You can click on your App Name and then the "Build Phases" tab near center of screen. Then go down to "Link Binary with Libraries" and click the "+" symbol and type "SenTest" and the framework should appear. Double-click it and it will add it to your project. In your project explorer you may want to "drag" that into the "Frameworks" folder just for organization.
I don't have same error and have both versions of XCode so am just guessing what it could be. I hope this is helpful.
Also that is pre-release software so might not be able to discuss publicly. See this SO article regarding similar issue during previous upgrade.
SEE: Xcode - SenTestingKit not found
I had a similar problem with libxml in XCode 4.5 and I managed to solve it by changing the reference to the framework in Build Settings of the target. Strangely, I changed ($SDKROOT) to "($SDK_DIR)" (notice the "") and it worked. Don't know why but it fixed it.
Maybe this will help
BTW, if anyone knows why the "" fixed it, I would be glad to know !
SenTestingKit/SenTestingKit.h file not found error on one of my existing projects. You can click on your App Name and then the Build Phases.

Linker command failed with exit code 1 error in Xcode project

I was working on my project and suddenly after editing the code and compiling gave this error:
ld: warning: directory not found for option '-
L/Users/mani/Documents/Classes/Twitter+OAuth/Libraries & Headers' ld:
duplicate symbol _OBJC_CLASS_$_playSiew in
/Users/mani/Library/Developer/Xcode/DerivedData/learn-aktrtiwswclovoatyweyquoxmypa/Build/Intermediates/learn.build/Debug-iphonesimulator/learn.build/Objects-normal/i386/playSiew.o
and
/Users/mani/Library/Developer/Xcode/DerivedData/learn-aktrtiwswclovoatyweyquoxmypa/Build/Intermediates/learn.build/Debug-iphonesimulator/learn.build/Objects-normal/i386/Thumb.o
for architecture i386 clang: error: linker command failed with exit
code 1 (use -v to see invocation)
I never touched the project settings, just edited the code.
What's more strange is that I took out last revised code from svn but still I got the the same error.
You may be accidentally #import'ing a .m file instead of a .h. Use Cmd+Shift+F and search for ".m" (without quotes). It will most likely lie in one of the classes mentioned in the warning. If not, clean and run again.
I was also having same issue and I did following and issue is gone.
Go to Product -> Clean and re-run the project.
I hope it might be useful for some other developers.
After running into this problem a few minutes ago (yes, I know it's been 7 months since the original thread) I found that the root of my issue was due to me dragging & dropping files into my project within XCode instead of right-clicking and choosing Add Files to Project.
Check playSiew.m is in Compile Sources section. isn't it?
You can find Compile Sources section follow this step
Select YourProjectName
Select TARGETS
Select Build Phases
If don't have playSiew.m in this section . You must to add it to this section.
As I said the problem wasn't the code but some settings. So what I did was copying the code from my friends' Mac (it was working fine), and installed a fresh copy of the project to my Mac. It worked.
I was importing a library in a test case which I had specified in my pod file for the main target but not for the test target.
I also got this error because I had accidentally included two versions of the same source file. Deleted the wrong one and the problem went away...
If you're working in Unity and export to iOS and you are using a plugin, go to Xcode Build Settings and set ENABLE BITCODE = NO. I'm guessing this might apply to other situations as well
Faced similar issue, while running the code on a simulator, tried all the above mentioned options, still got the same error. Tried connecting the iOS device and build the code, it worked for us. This can be a quick workaround.
the same error i faced. so, i just removed reference of that classes which are generating the errors and than again gave reference and the error was gone...
as D80Buckeye says there should be problem of dragging and dropping files instead of Clicking on "Add Files"
In case this comes in useful for anyone else--I just had this same error, and turns out the cause was initializing a variable in my header file rather than in the main file.
I just encountered the same error. If you are using embedded Libraries, make sure your Deployment Target is set to iOS 8.0 or higher.
you only need to add the following framework: quartzcore.framework
The only way we can get past this bug on our project is to do a Clean and then build for iPad Retina. After that it will build successfully for any device. Weird.
In my case i have add reference of FacebookLoginSDK framework but forget to give search path in build setting. After removing its reference everything was fine.
So conclusion is if you are adding any external framework be careful.
If this happens to you with CoreData generated classes, combine the +CoreDataProperties and +CoreDataClass into the +CoreDataProperties class and delete the +CoreDataClass. Make sure to search Derived Data for leftovers of the +CoreDataClass. Even after deleting the Derived Data and cleaning I sometimes had Xcode just generate the +CoreDataClass again and again. Deleting it manually in Finder and then re-bulding helped me solve this.
try this, go to Target -> Build Settings,then search these three as following,
GCC_NO_COMMON_BLOCKS,
CLANG_WARN_INFINITE_RECURSION,
CLANG_WARN_SUSPICIOUS_MOVE,
set NO to each value then clean and build.
I tried several of the answers listed but none worked for me.
I got the error after updating XCode (while it was still open which may have contributed to the problem)
First, I deleted my Derived Data folder:
XCode => Preferences => Locations => Double Click on arrow next to path indicating where the Derived Data folder is.
Then "Move to Trash"
I don't think that's what the problem was, but it's amazing how many times this has been an issue for me working on different problems.
Second, I 'Quit' the simulator.
Third, I 'Quit' XCode.
Fourth, I opened up my project in XCode again and then did a Clean and Build (found in the Product menu)
Fifth, I ran my project and it worked fine
Cleaning the project not works for me.
Restart the Xcode works for me...
For me it was different. I had the same error when I removed a Pod and solved it by removing this pod from the Other Linker Flags in the Build Settings
then clean your project [Product > Clean] and rebuild
Go to general and linked frameworks and libraries in xcode and remove all the files there.

refactor function error - "is not part of the build phase of any targets in the Xcode 3 projects in this workspace and so can't be refactored"

Trying to rename a function's name via the refactor->rename button in a categoriy's .h file in XCode 4.1 I'm getting this error: (error and body)
UINavigationController+ZG.h is not part of the build phase of any targets in the Xcode 3 projects in this workspace and so can’t be refactored.
Add the file to the build phase of a target in an Xcode 3 project in this workspace, or make a selection in another file.
Not sure what it wants and why it's saying something about xcode 3 when i don't have any xcode 3 projects or anything like that.
I had this issue today on a project which don't use workspace at all.
I couldn't get why Xcode behave wired. Auto complete worked, but return some really unrelevant results as my FAMILY NAME (?!) for a class I was working on.
I found it to be a bug in Xcode 4.1 under OS X 10.7.1 along side with other issues i had.
When I reopen my project, the message was gone, refactoring worked as expected and auto-completing worked as well.
September 2013 Update:
It seems that this bug is happening also on Xcode 5 & 10.8.5.
Restarting Xcode did not fix this for me (although it does normally fix a lot of things). I also didn't like the idea of File >> Save As Workspace. As the workspace should already be in my .xcodeproj file, so I didn't want another one. I found another solution that fixed it for me: Window >> Organiser and then Delete Derived Data for my project. Found it mentioned in this other question.
I was able to get past this error by choosing File >> Save As Workspace.
For me personally it was a combination of things.
Deleted derived data from Organizer > projects. (Didn't work after this step)
Restarted Xcode. (Worked after this step)
I have just run into this issue as well. I found that running:
Product->Clean
Fixed the problem, and I can now use refractor again.
I replaced some dead values in project.xcworkspace (Show Package Contents on your Xcode project file) and the problem went away
Have you ever deleted .xcworkspace in Finder? Although the file will be auto-generated by Xcode again, yet its content will be changed. I think that causes your problem.
I saw a post recommends to delete .xcworkspace for the purpose of enhancing build speed. Well, mind the catch.

iPhone Development - Compiler Warning!

Sometimes when i try to "build"/compile a downloaded source, i get following warning:
ld: warning: directory '/Volumes/Skiiing2/CD/ViewBased/Unknown Path/System/Library/Frameworks' following -F not found
Has anyone else seen this issue?
I just upgraded to iPhone SDK version 3.2, and ran into this problem. It looks like it happens on all my projects that were created with the 3.1.2 SDK.
After some amount of searching, I finally was able to find it in the project settings. You have to "Get Info" on the target to find it. Click the "Build" tab, and scroll down to "Search Paths". It can be deleted from there.
Yes. I've found this path in search path settings but not for project but for target!
this specific warning with the 'skiing' reference was a bug in the latest xcode beta for iPad. make sure your running either the latest xcode beta or the latest production xcode.. you should not see that warning again.
Your project is set up to use a framework that was once on a removable disk of some kind, that is no longer there. You can make the warning go away by removing that path from the linker command line, you'll find a property in the project somewhere that references it.