i need your help everyone. i am having an error when archiving an app with restkit. On build it is perfectly ok, but when archiving it generates an error below:
[App location...]/AppDelegate.m:3:9: 'RestKit/RestKit.h' file not found
[App location...]/RestKit/Code/CoreData/CoreData.h:22:9: 'ObjectMapping.h' file not found
Cheers!
If you can, switch to using CocoaPods.
Update your release header search paths to include "$(SRCROOT)/Build/Headers" and "$(BUILD_ROOT)/../".
Problem solved! the cause is that my Build Settings > Architecture is not set properly.
Here's what i did:
App submission: arm64 and armv7
Simulator: armv7
Device: arm64
I have fixed this issue, to change the Header Search Path
"$(SOURCE_ROOT)/RestKit-RestKit-c19a500/Build"
Note : "RestKit-RestKit-c19a500" this is my RestKit folder name.
For future readers, if you're using Core Data mappings, make sure to check if your Search Paths (Your Project -> Build Settings -> Search Paths -> Release) folders really exist. If not, just update them to the real folder.
Don't forget to include "${PODS_ROOT}/Headers/Public/RestKit/CoreData" folder, as setting the recursive flag on Headers/Public/RestKit doesn't seem to work!
Related
I have just recently upgraded to Xcode 7 and now I get this warning:
ld: warning: directory not found for option '-F/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/Developer/Library/Frameworks'
I researched different forums and everybody with similar issue recommends to remove paths from build settings but I can't find any paths there resembling iPhone simulators....
I had the same issue, here are the steps that worked for me
open your project
got to TARGETS
select youAppNameTests
select Build Settings
Framework Search Paths
Delete every thing from Debug and Release fields
clean project
Hope it will work for you too
The problem has to do with the test target. Delete your test target. (Copy the code out to some other program if there is any.) Quit Xcode and clean out the Derived Data folder. Now open your project again, and the problem will be gone. If necessary, now make a new test target.
I was working on Project in Xcode 6.1. It was working fine and all of sudden it prompted an error 'Restkit/Restkit.h file not found'. I'm getting error after changing Architectures from $(ARCHS_STANDARD_32_BIT) to Standard architectures (armv7,arm64) - $(ARCHS_STANDARD) which is recommended by Apple Check Link
I have tried following approaches :
1.'Cleaning' project and rebuilding
2. Checked for missing framework in Target -> Build Phases
3. Fixed 'Framework Search Path' of Target
4. I have build Restkit XcodeProject and Targets separately. It builds without error.
I was getting below error while submitting to App Store and hence changed architecture to 'Standard architecture'
Why did this occur all of sudden? How to fix it?
Just to be here. There is similar issue in newest Xcode 7+. You can observe "RestKit/RestKit.h file not found" failure on archive build. You could compile and run apps on emulator but archive would fail.
To fix this you need to add one line to "Header Search Paths" in Build Settings:
"$(BUILD_DIR)/../IntermediateBuildFilesPath/Headers"
Be sure to include the surrounding quotes.
You have not properly changed Architecture , if you have done properly than it will show you like this,
Proper Architecture setting:
So again properly change Architecture and try again.
This is your Architecture Setting
I had used third-party static library in project named libNuance.a. It seems that this static library works fine for 32-bit architecture but failed for 64-bit architecture.
I downloaded updated version of libNuance.a library from their official site and changed architecture to Standard architectures (armv7,arm64) - $(ARCHS_STANDARD).
Vola! build succeeded without any error.
First you can try, look for it in project navigator(left side) and delete if it is red.After that add the RestKit again.Be sure when adding check the copy if needed box and packages contains headers.
Also you may try just #import "RestKit.h"
I had solved this in many cases by deleting the contents of DerivedData folder. See the following questions on how to do this:
Can I safely delete contents of Xcode Derived data folder?
How can I safely delete in my ~/Library/Developer/Xcode/DerivedData directory?
If you have Pods configured then and if you have upgraded recently your Xcode, try reinstalling cocoapod and all the reinstall all required pods.
I fixed this issue, to change the Header Search Path
"$(SOURCE_ROOT)/RestKit-RestKit-c19a500/Build"
Note : "RestKit-RestKit-c19a500" this is my RestKit folder name.
I have an iOS application that i need to upgrade on iOS7. I am using RestKit version 0.10.2. While archiving i get following error.
/Applications/Xcode 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: /Users/khawarshahzad/Library/Developer/Xcode/DerivedData/MyAPP-fcvmsuowvnqkdseskmuetssnxoww/Build/Intermediates/ArchiveIntermediates/MyAPP/IntermediateBuildFilesPath/MyAPP.build/Release-iphoneos/MyAPP.build/Objects-normal/armv7s/MyAPP (No such file or directory)
Previously i had fixed this error for iOS6 by following instructions on
https://github.com/RestKit/RestKit/issues/930
But now its not working for iOS7. Here is screenshot for current RestKit.xcodeproj Architectures settings.
Any suggestion is appreciated.
Huh! finally found the solution. If you are not using any specific feature of arm64 architecture, then just kick it off.
Go to project -> target (your project name) -> build settings and change architectures to standard architectures (armv7, armv7s), and valid architectures to armv7, armv7s. Set Build Active Architecture Only to Yes
Repeat same for RestKit.xcodeproj
Clean your project and Archive.
Best of Luck :)
I had the same Issue and couldn't fix it, so I just removed the restkit files and all its build settings. after that i used Cocoapods for restkit and other frameworks. its much better to work with and all these kinda errors are gone. I'm using it since iOS5 and last week I fixed my app for iOS7
If you need this fix for building from the command line - and you don't have an *.xcodeproj then this will fix it:
Change:
(cd $BUILDDIR/i386; "$SIM_DEV_DIR/ar" crus some.a obj/*.o; )
To:
# have to take ar from ARM_DEV_DIR in xcode 5
(cd $BUILDDIR/i386; "$ARM_DEV_DIR/ar" crus some.a obj/*.o; )
IOW: In xCode5 ar has moved from $SIM_DEV_DIR/ar to $ARM_DEV_DIR/ar
I have set up an XCode 5 iOS 7 project for unit tests.
Of course, setting up the unit tests are taking me so long that I'm trying to keep the faith that it's worth it. Struggling for hours over this error:
ld: building for iOS Simulator, but linking against dylib built for MacOSX file
'/Applications/Xcode5-DP5.app/Contents/Developer/Library/Frameworks/XCTest.framework/XCTest'
for architecture i386
Any ideas on how to solve?
Check your Framework Search Paths in your test target settings. These can be corrupted when adding the XCTest Framework.
Adding XCTest to one of my projects prepended a "/" to the paths causing them to not find the correct version.
None of the above answers worked for me. I did find an answer here in a comment left by Tim Macfarlane.
For linker errors looking for a class in your app...
set the “Symbols Hidden by Default” build setting to “NO” in your app
target. This makes all your app classes available to your test target
automatically...
So, that means:
Project Navigator > Select your project
Targets > Select your App (not Tests)
Build Settings > Search for "Symbols Hidden By Default"
"Symbols Hidden By Default" > Change it from "YES" to "NO"
I had the same issue; the problem (for me, at least) was that the FRAMEWORKS_SEARCH_PATHS build setting listed the SDK frameworks folder after the main developer frameworks folder.
The frameworks included with Xcode have three separate builds: one for OS X, one for iOS (device), and a third for the iOS Simulator. The OS X build is in the main developer folder, with the other two being under their respective platform folders. The rub here is that if you don't specify to search the SDK folders first (which are within the platform folders), Xcode (or more correctly, the linker) will find the OS X build first and produce the error you see.
The solution is simple, put:
FRAMEWORK_SEARCH_PATHS = $(SDKROOT)/Developer/Library/Frameworks $(inherited)
in your build settings. If you're putting build settings in the project file (I don't recommend it, but that's another question for another day), it's just named "Framework search paths."
NOTE: Sometimes Xcode's a little slow to catch on; you'll probably need to delete your build folder (better than just a clean) for this to take effect.
Have the same problem after converting tests from SenTestCase to XCTestCase. Reverting framework dirs fixed issue:
"$(SDKROOT)/Developer/Library/Frameworks" (non-recursive)
"$(DEVELOPER_LIBRARY_DIR)/Frameworks" (non-recursive)
So, for me, what I was missing after trying everything else in this post, was:
Other Linker Flags:
-framework XCTest
I'm currently using Xcode 6.0 (with the iOS 8 SDK) so I'm surprised that the "Edit > Refactor > Convert to XCTest..." option doesn't add this automatically.
I was facing problem while adding sentestingkit framework in xcode 5 . These settings worked for resolving linker problem.
I had this problem upon adding another file for tests.
If you do this with (CMD + N) be sure to only target
the Test Bundle (ie. 'AppNameTests').
I guess only these .xctest bundles have access to the
XCTest Framework.
I had the same issue after renaming my Target name and moving things around. It turned out that my tests were part of my Main Target. Make sure that you all your test files belong only to your test target.
Just select a .m file, make sure you have the right pane open.
I had the same problem when tried to build XCTTest-based unit tests with pre-7.0 SDK. When I chose 7.0 as my Base SDK then that kind of link error disappeared.
Had a the same issue but ended up with a slightly different solution.
select XCTest.framework and make sure that only your test folder is checked under Target Membership.
Make sure that the Search Framework Path (FRAMEWORK_SEARCH_PATHS) for the YourProjectTests target includes the path $(SDKROOT)/Developer/Library/Frameworks, and that this one is listed before $(inherited).
In my case, both paths were present, but $(inherited) was the first one.
Credit goes to https://stackoverflow.com/users/181947/brian-clear on Apple Mach-O linker (id) warning : building for MacOSX, but linking against dylib built for iOS
Building an iPhone app, using:
Xcode 4.1
Base SDK iOS 4.3
Apple LLVM Compiler 2.1
I have started getting the following error:
fatal error: file
'/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/../lib/clang/2.1/include/stdint.h'
has been modified since the precompiled header was built
I have tried reinstalling Xcode and OS X - no luck. What's causing this?
First try a clean build via the Product -> Clean menu (as of XCode 4.6.2).
If that still doesn't work then open the Organizer (from the menu select Window->Organizer). Once the Organizer is open, select Projects from the toolbar at the top of the window. On the left is a list of projects, select the one you are having a problem with.
The details panel (to the right of the list) will display the project name, location, status. The row beneath that shows where the Derived Data is located. Click the Delete... button the far right. A dialog will appear, click Delete.
You can also manually delete the Derived Data:
~/Library/Developer/Xcode/DerivedData/{project name + gobly-gook}
This directory contains built products and indexes for the project. It is OK to delete it because it only contains items generated by Xcode. Xcode will regenerate everything next time the project is opened.
I was able to fix it in a much easier way, by simply choosing Product > Clean, then Product > Build from the Xcode menubar.
Deleting the DerivedData folder did not work for me when Archiving.
I had to look at Build Settings - Build Locations - Precompiled Header Cache Path and delete that folder.
For me that was:
/var/folders/_w/t0mj70hd1439tqgxff7_mtt00000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders
I thought I would add a separate answer rather than a comment to Cryptognome's answer, because it is in fact a different solution when the issue comes from running xcodebuild. Like Cryptognome, I had the error come up with the command-line tool xcodebuild. As an alternative to manually going into the /var subfolders, I found that I could set my own cache for the shared PCH, which you can do by setting the environment variable SHARED_PRECOMPS_DIR, e.g as follows
xcodebuild -target Foo -configuration Release SHARED_PRECOMPS_DIR=/tmp/foo/SharedPCH
This way, I never get the error in automatic builds.
Note in the above command, I would also typically set the OBJROOT and SYMROOT env var to build also in /tmp. At the end, I clean things up.
The xcodebuild command line tool sometimes fails with this error. This happened to me when I synched an svn workspace to an earlier build. The xcodebuild tool keeps its precompiled headers in the folder Ants mentioned:
/var/folders/... scrambled eggs .../-Caches-/com.apple.Xcode.503/SharedPrecompiledHeaders/
You have to look in the build command itself to see the actual folder name (-include /var/...), but it may be using several if you're building for different architectures (arm6, arm7, simulator, e.g.) So if you're having this problem with a command line build, just delete everything in /var/.../SharedPrecompiledHeaders.
Remove the contents for the Simulator by iOS Simulator > Reset Content and Settings... and hit Rest. This will remove any existing pre-compiled instances of the headers and resources. This worked for me
Solution:
1)Product->Clean
2)Product->Build
Error Type:
a kind of Build error
One of the causes:
one might have changed the framework file.
This sometimes happens when a change is made to a framework that another framework depends upon. The precompiled header cache gets out of sync, and Xcode is unable to compile the given project.
One of the Scenarios:
one might have chosen Jump To Definition and did some change after selecting a framework control.
I was able to get rid of this error simply by cleaning (command+shift+K) and rebuilding.
I tried above all but no use. Finally I deleted Xcode and re installed again. Now it is working fine..
Xcode->delete->install again
It might help some one...
I had this error on cordova when I ran : cordova run ios
fatal error: file '/Users/.../cordova/platforms/ios/CordovaLib/CordovaLib_Prefix.pch' has been modified since the precompiled header
'/var/folders/gb/3cf6hy4x7z3d7hprls6xmd0m0000gr/C/com.apple.DeveloperTools/6.0-6A313/Xcode/SharedPrecompiledHeaders/CordovaLib_Prefix-bfgesbulnxtdepfwgniffeysypgv/CordovaLib_Prefix.pch.pch' was built
note: please rebuild precompiled header
'/var/folders/gb/3cf6hy4x7z3d7hprls6xmd0m0000gr/C/com.apple.DeveloperTools/6.0-6A313/Xcode/SharedPrecompiledHeaders/CordovaLib_Prefix-bfgesbulnxtdepfwgniffeysypgv/CordovaLib_Prefix.pch.pch'
1 error generated.
** BUILD FAILED **
The following build commands failed:
CompileC build/CordovaLib.build/Debug-iphoneos/CordovaLib.build/Objects-normal/armv7/NSDictionary+Extensions.o Classes/NSDictionary+Extensions.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC build/CordovaLib.build/Debug-iphoneos/CordovaLib.build/Objects-normal/armv7/CDVInvokedUrlCommand.o Classes/CDVInvokedUrlCommand.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
I tried with clean and build but doesn't work, finaly I removed the folder '/var/folders/gb/3cf6hy4x7z3d7hprls6xmd0m0000gr/C/com.apple.DeveloperTools/6.0-6A313/Xcode' and works!
This tip, may be help others
Clean ways are not working for me, eventually I solved this issue by reinstall XCode.