Why don't I get any compiler warnings in Xcode 4.5? - ios

I recently switched to Xcode 4.5 and I no longer receive realtime compiler warnings. I only receive the warnings after building my project. I can literally type in "laskjflskdjf" and get no errors until compile time.
Additionally, after building a project, receiving a warning, and resolving the issue, the yellow or red warning icon is not removed until I build the project again.
Are there build settings that I must manually adjust to correct this?
Thanks!

In Xcode 4.5.2, the option is in Preferences > General > Show live issues. I was able to reproduce what you describe by unchecking this option.

Related

Warnings in app.dsym in Xcode after update

Since I updated Xcode to the latest version I get a lot of warnings and I could not find clear explanation/solution, first it used to be just when I was testing on simulator but now I also get it when testing on device.
I tried this https://forums.developer.apple.com/thread/17921 but it did not helped me that much, I managed to get rid of the warning from the app extension but not the app itself. Anyone who encountered similar problem and managed to solve it?
This is probably due to changes in the build process across different Xcode versions, I am having this problem again with version 8.3.3 (8E3004b), so if this is happening just after an update you can fix it shutting down Xcode and deleting folder
~/Library/Developer/Xcode/DerivedData
which gets created again after the first build.
About the risks of deleting that folder you can check this question
This worked for me:
Targets -> [your project] -> Build Settings
Find and expand "Debug Information Format"
Change "Debug" value to "DWARF"
I left "Release" value unchanged as "DWARF with dSYM File"
I read that Debug builds don't need dSYM files.

Xcode iOS app crash on launch: unable to create lldb_private::Process

I've been trying to get my OpenFL game to build for days, and finally got to the point where the build succeeds (had a lot of trouble linking everything correctly, using severla static libraries of different shapes and forms). It finally builds, and now I Get this:
How can I debug this? In the console it just says
error: failed to launch
'/Users/joon/Library/Developer/Xcode/DerivedData/TryHarder-cynkhfxgstydmgawfivgqqiluryl/Build/Products/Debug-iphoneos/TryHarder.app/TryHarder'
-- unable to create lldb_private::Process
I have rebooted computer, mobilde device, cleaned, rebuilt, uninstalled, which is what many sources recommend in the case of an on-launch crash with no info. Nothing does the trick however. Some sources recommend to set debugger to GDB, which is no longer possible in XCode 6 it seems.
I'm not sure how to debug this any further.
I began to get this when I changed Mach-O type to "Bundle" in Targets > build settings > Linking. I won't claim to know much about this, but perhaps it will help..
Set the Mach-O type to Executable and it will work absolutely fine. you can find it in Targets > build settings > Linking

Xcode 6.01 Archive validation error: Invalid Segment Alignment

I have been working on an iOS project solely in Xcode. Deployment target is iOS 8.0. After updating to Xcode 6.x, building and testing on my iPhone 5s and iPhone 6 as well as the simulators works fine. However, when I create an archive and want to validate it, I get the following error:
Archive validation failed due to the issues listed below.
iTunes Store operation failed.
Invalid Segment Alignment. This app does not have proper segment alignment and should be rebuilt with the latest version of Xcode. Please contact Developer Technical Support if you need further assistance.
I have googled for the past couple of days and it seems that this problem mostly occurs in connection with other development tools, especially from Adobe. However, I have only used Xcode for development.
This is what I have tried so far:
Reinstalling Xcode 6.01
Turning Autolayout on and off
Set target from 8.0 to 7.1
Just submit the archive (no error message, but new version is not found in Testflight)
Unfortunately, none of this has worked. My questions:
What does the error message want to tell me?
Has anyone any idea how to solve this problem?
Thanks a lot!
I found the solution. XCode seems to have lost track of two of my files (XX.h and XX.c) This file name (with a .o extension) was in the summary of the 1st step of the validation.
I removed the references to both files, added them again and everything works fine. Hope that helps someone!
(Edit: sorry, cannot flag this answer as the right answer, will do so in two days when stackoverflow lets me)
More detailed instructions:
When pressing "Validate" in the Organizer, look at the "Summary" dialog that pops up
If there are any .o files listed in addition to your app, go back to Xcode and remove the corresponding .h AND .m files from your project (removing the reference is sufficient)
Re-add them by dragging and dropping them back into your project
Recompile and it should work (assuming you're not using Adobe Air components in your app)
(thanks a million for this post Fynh, your fix made it finally work for me!)
In my case I was submitting an app that include a framework I had built that was a universal framework - created using lipo (for use with both device and simulator).
After replacing the universal compiled framework with device compiled framework, validation was successful.
To fix this bug I had to go Targets / Build Phases / Expand Copy Bundle Resources and remove the empty.cpp file (my error was about a empty.o file)
Hope this helps someone

Facebook SDK giving unused variable compile errors in Xcode 5.1

I'm getting a lot of unused variable errors after updating to the new version of and Xcode 5.1.
Compiler is saying unused variables are errors, and checked the compiler settings that i didn't modify treating warning as errors.
This only happened after I updated to Xcode 5.1
There seems to be indeed an issue with Facebook iOS SDK and compiling on Xcode 5.1 even if compiling it by itself.
I opened a bug in the Facebook support system:
https://developers.facebook.com/x/bugs/1449419898627543/
As a temporary workaround - you can fix it by turning off treating warnings as errors ( a very good practice by itself btw I use for our SDK) by:
1. Open the Facebook proj file (or the project inside an existing project
2. Go to build settings of the entire project
3. Change the "Treat Warnings as Errors" field from YES to NO.
This will let you compile it even with these warnings - but do be alert for an updated sdk in the coming days.
The problem was that we were unintentionally compiling for 64bit in the internal compiler settings somewhere inside our scripts. Please be aware.

XCode:4.6 Lion:10.8 IOS 6.1 error: SBTarget is invalid

XCode:4.6 Lion:10.8 IOS 6.1 error: SBTarget is invalid , how to solve this?
After hundreds of times testing, I find a way that can help the programme run,
here is it:
When you first meet SBTarget is invalid, choose Product --> Clean
Run again, this time you may also get error: SBTarget is invalid, it doesn't matter.
Turn off the XCode totally, 'totally' means that the Xcode icon should not appear in the Dock.
Double click your project file(xxx.xcodeproj , the blue one) to start Xcode, run again. (Do not Clean this time), and it runs ok.
Let me know if this can help you or you have any other methods. Thx
I had this issue while incorporating the Facebook SDK into my app. The error would alternate between SBTarget is invalid and telling me that my architecture was incompatible with my device so it would not launch. If I followed alexqinbj's advice it would run the app once but then it would go right back to having the same error again. I tried messing with architectures and build settings and removing derived data but in the end it really was just a duplicate file in my file structure. Facebook told me to add their SDK and then to add a folder (that the SDK file already contains). Once I saw that it was just a matter of removing the duplicate file. I've heard of this error happening with duplicate plists as well. Good luck
Indeed, the root cause (in Facebook integration) is the duplicate resources in the Facebook SDK (as per their instructions). When I deleted the resource files (remove references only), this problem went away permanently. Not sure why Facebook instructions ask you to drag the resources bundle over to the Facebook SDK framework you just brought in...
TARGETS -> Build Phases, remove info.plist from Copy Bundle Resources. Clean and run. It works for me.
Unfortunately, the accepted answer didn't work for me. I can provoke this error with 100% certainty. It is not necessarily an internal consistency issue with XCode that can be resolved through cleaning, rebooting and rebuilding.
SBTarget is Invalid is an internal XCode error. It happens when attaching a debugger and the architectures specified in the XCode project do not match up with the binary.
On OS X, you can diagnose this by going to the binary on the hard drive and typing:
lipo -info <bin>
Then comparing this to the build settings ARCH and ONLY_ACTIVE_ARCH. They must match. It is not enough for ARCH to be a subset of the possible architectures contained within the binary.
There are any number of reasons why they might not match up. Here are some suggestions:
You are using an external build scheme. XCode therefore does not dictate the contents of the binary. The build settings merely tell XCode what to expect when launching GDB or LLDB.
The executable specified for launch in the scheme is not correct. If it can't find the executable, the architectures will not be present.
This error has a very distinct cause in my case. Whenever "Expand Build Settings in Info.plist File" was set to "NO" in Xcode's "Build Settings", this message came up. Will submit rdar to Apple.

Resources