I am currently experiencing an issue with ARC in Xcode6: I have disabled ARC in the Build Settings of my project, however I am getting some errors in my test files, which appear to be complaining about ARC even if I disabled it.
The error messages state: "autorelease is unavailable: not available in automatic reference counting"
Does any of you have any idea why?
When I imported some external libraries, I linked them to both my project and its test files, could that be the issue?
You can mark files as non-arc on a class by class basis by adding -fno-objc-arc in Compile Sources of your Build Phase. This answer should help you achieve that.
Related
Im having trouble running an ARC enabled project in Xcode 6.1. Please note that this project consists of a few non-ARC compliant files also. For each of these files I have specified the compiler flag "-fno-objc-arc" in the project compile sources.
The exact same code works just right on Xcode 6. However, Xcode 6.1 is throwing out errors and warning related to non ARC code like dealloc and retain in spite of the compiler flags. Once i clear such offending code, the system throws the classic 'libxml/tree.h' file not found error.
I have tried cleaning the code, restarting the system and even re-installed Xcode itself, but all in vain.
Could someone please help me to resolve this issue.
Thanks!
I am linking a static framework for iOS, against an armv7 ios 6 application, I suspect that the original binaries are from XCode 3.x and were compiled with GCC, and that I'm now linking it using CLang compiler. I do not have the source code for the framework, only the binaries:
(null): warning: (armv7) /.../DerivedData/.../armv7/HardwareObjectFile.o unable to open object file
I get 69 warnings like the above, one for every .o file linked into the static framework.
Is this warning serious for any reason? I have simplified the giant path which appears to indicate that the binary files in the library have hardcoded a path in "/Users/somedeveloperthatisntme" that could hardly help but Not Exist since I'm using this library on a computer that doesn't even have a folder named "Users/somedeveloperthatisntme".
Dsymutil appears to be a tool to "manipulate archived DWARF debug symbol files", although I know precisely nothing about what it is and what it does, notwithstanding the thorough documentation from Apple, which tells me what, but never ever, why. What is it doing, and what will this warning mean for me? I suspect I need a new library/static-framework from the vendor to clear this up?
Update: I am unable to solve this and it appears the cause lays with very old binaries compiled by a very old XCODE version, shipped as part of a mobile framework from a third party vendor. The issue in this case would be resolved by having that vendor rebuild their library, something I asked them to do because the warnings drove me nuts, but which they seem unable to do. In the end I ditched their technology and replaced it with something else. (Grin)
These errors are to do with the architectures you are using and the resources you are referencing. I don't understand the reasons myself, but if you want them to go away, go to Build settings, then Build Options and then select Debug information format and select DWARF.
I am on the other side of this, building a library for others to use, and I was able to alter the library project by setting 'GCC_GENERATE_DEBUGGING_SYMBOLS = NO' in the Build Settings to make those warnings go away in an Application project that consumed the output framework.
This isn't a solution to your problem, but if you're in contact with this vendor, you could pass this along.
The other answers contain helpful information but I wish to put the real answer down succinctly:
You can not fix this, and the meaning of the errors is simple: The current linker sees these library files as containing elements that can not be opened.
To solve the warnings, contact the vendor and get a recompiled library that has been rebuilt with a later version of CLANG.
What I did was just delete the /Library/Developer/Xcode/DerivedData folder and it fixed everything for me.
Another reason these warnings could occur is because of incorrect symbol stripping settings for release builds in a project. Contact the author of the framework and tell them to make a new binary with the proper symbol stripping settings.
I have a app with the WhiteRaccoon framework installed.
I cant compile it as it gives me errors with anything to do with retain or release in WhiteRaccoon.m/h.
Any ideas whats going on?
Thanks.
By the way, I have added the CFNetwork framework. Any ideas?
Your project is probably using ARC and WhiteRaccoon probably isn't.
You can either convert whiteRaccoon (whatever that is) to ARC or exclude the whiteRaccoon files by adding the following compiler flags to it's source files -fno-objc-arc.
To do that click the project on the left hand side then go to the "Build Phases"-> "Compile Sources" look for the white Raccoon .m files and add the -fno-objc-arc under the compiler flags section.
Another option would be to compile the WhiteRaccoon framework into a static library and as this to your project.
I have already created a project in XCode 4.2 with ARC checked. The problem is that I have to download and add the ASIHttpRequest files. This is giving a whole bunch of errors when I try to compile. Is there some way to fix this (other than to create a project again) ?
Click on the name of the project on the navigation view in the left side, go to Targets -> Build Phases and add -fno-objc-arc to the "compiler flags" for any relevant files.
You can turn off ARC per-file by passing the flag -fno-objc-arc to each as they are compiled. Add the flag to the files that need ARC disabled in the Compile Sources group under the target in the project navigator.
Another option would be to compile ASIHttpRequest as its own framework that doesn't have ARC enabled and just link against the framework. Speak of, isn't ASIHttpRequest already in a framework? (I've not looked at it in a while)
Keep using ARC, but disable it for the ASIHttpRequest files. This answer should point you in the right direction:
How can I disable ARC for a single file in a project?
I've created an iOS framework project using the famous (and excellent) iOS Universal Framework Xcode template.
But now I've encountered an annoying problem that I can't seem to fix which is that I have an iOS application project that references the framework project and when I run that and have breakpoints set in the framework they don't get it. It seems GDB doesn't have the debug symbols for the framework.
I've made sure that debug symbols are not stripped from the framework and the type is set to "DWARF with dSYM file".
Anyone have any ideas what might be wrong and how to fix it?
My setup:
Xcode 4.2.1
iOS SDK 5.0
I ran into this issue while linking a dynamic framework to a test application in Xcode 7. I was able to avoid the error by ensuring the following in the build settings of my dynamic framework:
"Generate Debug Symbol" - 'Yes'
"Strip Debug Symbols During Copy" - 'No'
Several things comes to my mind regarding your problem. Give them a try and see which ones work for you:
Make sure to have the "Other Linker Flags" on the "Linking" section of the framework's "Build" Info.
Make sure that you have the framework's built in the correct configuration (ie, if you compiled the framework's in Release and are using it with your project set to Debug you might get issues)
Make sure you added the correct framework .a file to your project (actually two issues here: you can have added the Release version - so no debug symbols in there - AND you have to make sure that your projec is not pointing to some old build version)
Check that both the framework's and your project have the "Level of Debug Symbols" on the "Code Generation" section of the "Build" Info set to "All Symbols [full, -gstabs+ -fno-eliminate-unused-debug-symbols]"
If all alse fails try to empty the XCode caches and remove the framework reference from your project. Then clean and rebuild the framework (all configs: device-debug, device-release, simulator-debug, simulator-release, ...) and add it again to you project. Clean and rebuild your project and cross your fingers... :-)
I have also experienced this issue. One way that I have been able to work around this by merging both projects into a single workspace.
Instructions on how to do this can be found at http://developer.apple.com/library/ios/#recipes/xcode_help-structure_navigator/articles/adding_a_project_to_a_workspace.html.
NOTE: I have also experienced a bug adding projects to workspaces where there appears to be no files in the recently added project to the workspace. I have found this is easily remedied by restarting Xcode after all of the projects have been added to the workspace.