Why does Acknowledgements.plist from CocoaPods look messed up on iOS 9 and what can you do about it? - ios

CocoaPods auto-generates the Acknowledgements.plist file so that you can include that in your settings.bundle.
Following this, I have added Acknowledgements.plist into settings.bundle.
Acknowledgements.plist looks like this:
This appears nicely on iOS 8 like this (as intended):
However, iOS 9 inserts big blank spaces between title and footerText, which makes it ugly:
It looks like this is not this file (Acknowledgements) specific and iOS 9 in general puts huge vertical spaces between title and footerText. The question is, how can you solve this situation and put nicely formatted Acknowledgements in plist?

Good observation! I noticed the same some time ago, too. Hoped that this was already fixed.
Investigation
For me some footer texts are shown correctly. Those were very short, like just two lines. The longer the FooterText is, the larger is the empty space. E.g. Realm Database has a very long license text which leads to an empty space larger than one single device screen after its title and before its Footer.
I edited the Acknowledgements.plist manually to see if the line breaks make a difference: While keeping the text as long as it is I removed the line breaks.
Results
Unfortunately removing the line breaks does not help. So it's really related to the content length. Looks like it's a TableView and the row height calculation is just far off.
However, I didn't find any workaround. Title key is limited in its length so this cannot be used as a workaround. FooterText really needs to be fixed by Apple.
I filed it under rdar://24837397
There are several other bugs in the System Settings.app which are disturbing during development:
(Crash) Open the Acknowledgements section of your App. Run a new debug build of your App via Xcode and try to switch back to the Settings.app. Due to copying a new Settings.bundle with updated Acknowledgements.plist the Settings.app crashes.
(Missing content) Open Device Settings and scroll to your App's settings, but do not open them yet. Repeat the step from above and run a new debug build via Xcode. Switch back to Settings.app and try opening your App settings: Empty settings page shown, only permissions like Core Location and Mobile Data are available. You have to close Settings.app via the task switcher to see the new content of your Settings.bundle.
Beside those two bugs it drives me nuts that Settings.app doesn't have a section index. Scrolling to my own Apps during development is an unnecessary waste of time.. I know about the new search but that's also slower that an index just for the 3rd party Apps.
Edit: If you stumble upon this, please file a Radar too! This is important to really get it fixed, see https://blackpixel.com/writing/2012/02/radar-or-gtfo.html.

This is a bug in iOS 9, the problem has been fixed in iOS 10. Unfortunately nothing can be done for users that are still running iOS 9.
If you're using CocoaPods or Carthage, AckAck works well to generate the Acknowledgements plist for you. It removes unnecessary line breaks/indentation and generates a separate plist for each framework (making it less of an issue on iOS 9).
https://github.com/Building42/AckAck
(I'm the creator of AckAck)

Related

Transferring Xcode Project from one computer to another brings random errors?

I have a Xcode project I got from another developer. Initially when I opened it it has a bunch of errors (most of which were un-updated frameworks). I got it to work after a while and I fixed it. I want pass it back to the manager since I'm leaving uni in a few months. I copied it over to my friends Mac to see what would happen if I just took the project and all it's folders and made it a zipfile. It didn't work for some reason. It gave me an error:
error: using bridging headers with framework targets is unsupported
But why did that come up? I mean it's the same code on the slightly different versions of Xcode (13.1 versos 14.1) but I doubt there was a massive change between the two that would cause this. I want to be able to pass these app later in the future without having to care about this stuff. I made a GitHub (link below) would cloning that work? Also the laptop I chose was just a fresh reset. Would it be due to not having coco-pods installed?
I feel like I could go through and fix it all on that laptop and document that but then I'm afraid that every time I put it on a new one it would come up with random errors every single time making my documentation moot.
https://github.com/AbdullahMSaid/SonicExperiment-Works
With big help this was Fixed.
Things that fixed it.
Having the correct version of Xcode
Turning everything from absolute path to relative
Lots of other code fixes. But those are my project specific.
You don't need bridging headers in framework. Use should have something like "YourFramework.h" where you can import your .h files.

Xcode - Invalid character in source file (Replace " " with " ")

I have a question about Xcode (Swift). Sometimes when I write an if statement. Something like this:
if(a == 2){
//do Sth
} else {
//do Sth
}
Xcode throws me an error: "Invalid character in source file"
I know it is no big deal and fixed by clicking on "Fix-it" but I want
to know what is the problem. That doesn't make sense to me...
My Xcode is on 7.2 and I am using Swift - I don't know if this is just a Swift problem.
For me it's the ESC key - it's completely reproducible! If I go to search and hit ESC in the search window I also find the occurrences marked - and can replace those with nothing. But it's not shown even with "Show invisible"!
final solution: Bind ESC keybinding to "Cancel". It's that simple.
I was having this problem. The way I solved it is by 1) copying whatever you have into Sublime Text or another code editor and having a look (you may need to enable viewing hidden characters). Mine had a code in there DC2 which is some sort of ASCII control character. For me it was caused by the fact that I had put the playground into manual execute and bound a keyboard shortcut to it that seemed to be entering that control character every time I executed it using the shortcut. I just changed the shortcut and removed the ASCII characters as I was able to see them in Sublime Text. (The link in the comments to the OP concerning left to right mode made no sense and didn't work for me.)
I encountered this problem when I was using a non-Apple keyboard with my iMac. Probably your case too. They add unnecessary control characters! One way to fix it in Xcode ischoose from the menu Editor>Show Invisibles and see if there are any unwanted characters where the error is being thrown and remove them.
Editor->Show Invisibles did not show the character that was causing a problem for me. No-break-space (u00a0) will be shown as a space with no "dot" indicator. However, that's really hard to see and I completely missed it the first time. Zoom helps.
One way I found to detect invalid characters is to use Visual Studio Code and enable the settings:
"editor.renderControlCharacters": true
"editor.renderWhitespace": "all"
This has the same visibility issue with no-break-space as Xcode, however it does show other special characters.
To make it more obvious and possibly detect more invalid characters, install the extension "ascii-unicode-escape" and follow the instructions.
I don't understand why Xcode allows these invalid characters, inserts them into your source files for no reason, and doesn't even give an option to detect them! I'm trying to write code, not secrets in invisible ink, damnit!! I guess it's less of an issue for compiled code, which will show an error, but not so convenient with shader code.
I'm having the same issue. I found a solution after extensive testing. Hopefully it could save others extensive hours of researching into this terrible Xcode experience.
The problem is I have a FILCO Minila keyboard, which has the 'App' key right next to 'left arrow'. I would accidentally hit 'App' when typing really fast, and it enters a 'DEL'(Data Link Escape, Unicode 0010) invisible character. It could only be seen when copy-pasted to Sublime. It's not even visible under Xcode's own 'Editor -> Show Invisibles'(Talking about good user experience...)
Magically this doesn't happen to Sublime or VSCode, only to Xcode. So no excuses for Xcode I guess?
The fix is to download Karabiner, an advanced keymapper for macOS, and invalidate the 'App' key or map it to something else. Karabiner would also invalidate your keymapping in the system default keyboard config. So you would have to remap stuff like 'cmd', 'alt' if you've customized them. If so, be sure to map both left & right modifier keys in Karabiner, because according to Karabiner's key event viewer, the system default keymap would map left_alt & left_cmd to right_cmd and right_alt... Just annoying as hell...
It took me 2 months to realize this problem and 2 hours to actually find out it's the 'app' key that's the culprit and fix it.
I'm using XCode 10.1.
With Xcode: Xcode does not help even after showing invisibles.
Then you can copy the code to Sublime Text => you will see these invisible characters which are the <0x0f>. Click the image to see in details.
With Sublime Text 3, it works!
=> Then you know where to remove the redundancies. Hope that helps!
Are you using the option ⌥ key for any keyboard shortcuts? This was my issue. It seems combining the option key with other keys can insert hidden characters.
For me, this happened when I used the ⌃+⌥+p shortcut in Xcode to resume the SwiftUI preview canvas. It added a 0x10 character. I discovered this, as other posters have recommended, by pasting the code from Xcode into Sublime Text.
(NB: I should have been using ⌘+⌥+p).

Xcode crashed while renaming project - whole project broken

I wanted to release an app I worked on and quickly change the project name. I usually duplicate projects before doing things like this but this time - because this procedure always worked on Xcode as I found it way more reliable than e.g. Eclipse - I didn't, which I immediately regretted.
Opened Xcode again and now I am seeing this
I guess all the linking is gone now which is why Xcode doesn't "find" the files anymore. Renaming the remaining project stem to the old name gives
couldn’t be moved to because an item with the
same name already exists
and also manual renaming of folders won't work as the .xcodeproj is gone.
The project is written in Objective-C, and all the classes are still persistent, but the effort of adding all the xib's, referencing the outlets, setting architectures, etc will become the nightmare of my life. I do have a half-way recent backup but everything I did to make the app store-ready today will be gone.
Any ideas on how to rescue my project?
EDIT: What Xcode is now showing on the welcome screen is a project called "project" (literally) and it has the usual compass icon but with a white instead of a blue background referring to the path <project folder>/<new project name>/ and below that "white" project there is a folder icon with the new name pointing to <project folder>.
I also made a snapshot before, of course it now says "Unable to read snapshots" in the "restore from snapshots" window.
Ok what I now did is renaming ALL references from the old project name to the new one. I even changed file names. I used Xcode's CMD+SHIFT+F and TextWrangler's "replace" function and thankfully I still had the .xcodeproj from yesterday's backup so from there I could copy it into the new project and rename stuff. There are still some things that don't work perfectly, for example auto layout doesn't "stretch" contents over the screen (it stays on iPhone 4s size, even on 6 plus simulator), I needed to set the scheme again and Launch Images / Icons got lost but I can look over that. The only thing I am afraid of now is that the final build might miss out a symbol or something like that so I eventually have a corrupt file in the App Store, but man it's a beta version, how much worse can it get anyway?
Thanks to everyone recommending me to even backup the broken project, I did this even before you said it but because I think it's a valuable advice I wanted to put it in my answer as well.
It's a shame that stuff like this can happen, I've been backing up my work on a daily basis and my project never got corrupted - until now.

Xcode 6-Beta keeps crashing with a SourceKitService Terminated Editor functionality temporarily limited error [duplicate]

This question already has answers here:
SourceKitService Terminated
(34 answers)
Closed 8 years ago.
I have seen other questions with a similar problem but mine looks a bit more serious. Xcode keeps crashing on me. I have no chance to even edit a single character in my code. It is a very simple playground file with some basic code, nothing fancy. I'm not able to do anything at all in the current state.
When Xcode crashes, I hit reopen and the same thing happens again.
Locate the playground file using the Finder, then right click and select 'Show Package Content'. Next select the swift file, right click and open it using your favorite text editor (which must not be Xcode :)).
Once there, either delete its content or surround your code with comments. In the latter case, you can reopen the playground file in Xcode and selectively uncomment code line by line to know which line(s) cause Xcode to crash.
I've verified that there some recurrent patterns in code that almost always makes Xcode to crash, for example, when I use 2 or more custom operators in the same statement. I don't know if it that happens for all custom operators, or it's my specific implementation - either case, I know that I have to avoid that combination. You should take note when you notice a particular combination of code regularly making Xcode crash, and try to avoid it by splitting into multiply lines when possible.
Here's what I did to resolve it. I did reinstall Xcode a couple of times. It looks stable now but I'm not sure till when it would remain so. Looks like a bug to me. I will file it with Apple

Today View Extension (Widget) not working

I found several other threads with similar problems, but no one has exactly the same problems.
Besides it DID work some time! the errors now keep occurring while it was working some time before..
When Running my app, that has a build Target "Today View Extension", I get no actual result.
The Extension is shown in Notification Center, but has no body (Simulator AND device).
Also when I try to run the App (not the target extension) and attach the process manually by PID I get this error:
I also had the error that my Extension (that has a "Bundle Display Name" entry in Info.plist for a custom Name) did show the Name of the Extension-containing App, and not the string that was set in the Info.plist
Strange thing is that sometimes it worked, sometimes it doesn't, but when it does not there were like five different reasons why not.
I want to ask people who have similar/same problems to post them here to collect all the issues appearing and possibly collect workarounds / solutions for these problems.
Thank you.
For anyone having troubles now:
With beta 4 and beta SDK 4 a lot of bugs were fixed:
[self setPrefferedContentSize:]
to set the views size is now working properly (if you have troubles viewing your Extension)
If your updated Extension is not showing in Notification Center be sure to have a look at the log output, there you can see what task the debugger is attached to, if there is "no Selection" try stopping and running again, it will work after some tries!
If you have questions feel free to ask,
Happy coding
I don't exactly have a solution, but I've observed this happening when anything is "wrong" with my Today extension. For example, if I don't have a file properly targeting the widget. I'm guessing that instead of just crashing to the home screen, iOS just gives you an empty widget? I've written about my own issues here, for reference.
I had similar issues. But it seems to be alright now. Since the "Today View" is an extension and is bundled with the containing app, you should just build and run the containing app. From there, you can pull down the "Today View" and if your widget / today view is not added, add it.
You should be able to see all your updated changes without a problem with this and you won't have to attach any process.

Resources