Xcode: Semi-stale libraries and the simulator

xcode plays dirty when updating .a

xcode plays dirty when updating .a

Edit: (2/8/2014) As usual, I’m an idiot – this problem was caused by having explicit linker library search path flags (e.g. -LTo/My/Old/AdMobDir) that took precedence over the new libs I added. It didn’t matter that I removed the old ones from the Xcode and git, because they were (oddly) specifying an external directory that had a copy of the same libs. I’ll leave this post up to remind myself about this, at the expense of my credibility.

Today it is my birthday, so I thought how fun it would be to update AdMob for an iOS app. Since it’s just .a and .h files, it would be doable in under a minute. But after updating, I still got the message:

2015-01-10 20:40:24.194 Noise[13472:10630180] You are currently using version 6.5.1 of the SDK, which doesn’t officially support iOS 8. Please consider updating your SDK to the most recent sdk version, 6.12.2, to get iOS 8 support, including a fix for smart banner rendering in landscape mode. The latest SDK can be downloaded from http://goo.gl/iGzfsP. A full list of release notes is available at https://developers.google.com/mobile-ads-sdk/docs/admob/ios/rel-notes.

I did rebuilds after each of these steps: clean, deleted the old libGoogleAdMobAds.a of the same name from my source control, removed libGoogleAdMobAds.a from link phase (error’d as expected), re-added it, all to no avail – the simulator build was still showing the same message.

Then I remembered deleting the app from the simulator has historically fixed certain issues (stale app icon/xibs/etc), so I tried that. Worked like a charm.

I think I’ve seen this issue before – but the only way I knew that stale libs were the cause of it was because of the log message. Since upgrading a library usually will support the same old symbols, there generally won’t be a linker error – so this could potentially waste important debugging time with the programmer incorrectly believing he is debugging the newest version of the lib.

I hope and believe that the issue is just in the transfer of the project and ‘overly-clever’ optimization of transferring the app to the simulator that missed a diff case, because the deleting trick worked. Perhaps the transfer diffs only non-linked code – although, I would expect it to include statically linked stuff and only have this issue for dynamic linkage. This took around 15 minutes of messing around to figure out, but it seems like something that could bite back in the future.

Update: I tried this same project on another mac and my iPhone and found that the deprecated message was still there, just deferred, so this post may not be a correct solution. It’s possible that the message itself is bad, but I’m not sure yet. To check my sanity, I did these steps: git fetch/merge to update to the new admob libs (while the project was closed). The problem was different here – it persisted even after cleaning/rebuilding and deleting the app from the device. I restarted Xcode on a hunch, and also tried nuking the derived data folder.

2014 projects

my barebones background app

my background noise app

It’s been a while since I posted an actual project I’m working on. Since I started working full time for Apportable, I’ll admit there is less time to work on projects, but that’s really no excuse. In addition, as the new year merits such reflection, I’ve been thinking about why I didn’t ship anything last year.

Then I realized, I *technically* shiped something. I shipped my children’s note teaching app (that was already on iOS) on google play using the Apportable framework. Apportable lets you compile your objective-C iOS project to android and run natively. I thought it was lies and insane when I first heard about it; now I can confirm that it is simply black magic. Anyway, I’m usually working on other company’s apps, and improving the Apportable platform where it is is not perfect, so this was a nice way to hit two birds with one stone.

I also started on a binaural beats app, and got a quick prototype, but it didn’t seem as useful or original enough to publish without specific controls, so I’m still working on that. Instead, I put my efforts into a ‘background noise’ app. I started on this because I wanted to be able to drown out the sounds of the 580 and BART that my midcentury apartment building windows are not rude enough to prevent passage into my bedroom. It’s made me remember how much I love the sample synthesis for-loop in an audio callback. (I want to post more on various synthesis techniques in the future). So far the app only has three background noises – rain, waves, and crossfaded white noise. To stay productive, I might just release it as such and develop further as my interest stays with it. To the right is a screenshot of the minimal gl/coregraphics based rendering to accompany the background noise. I’ll try and do a live coding screencast just to get some of it on the screen again.

With the full time job, I can work on all those financially-worthless-but-fun ideas that are musing around in my head that were out of the question when I was doing the solo contract-dev shop. Just to be clear, I am posting this so that I will feel embarrassed if I don’t take advantage of that freedom when I come back and check on this blog.

Cisco AnyConnect VPN problems on android:

AnyConnectI’ve been using cisco VPN on android. It works pretty well, but sometimes, I would run into an issue where DNS wouldn’t resolve while connected (e.g. google.com fails to load in chrome and says DNS host lookup fail). This would happen and leave me out of luck for a week for that device. The internet, of course, advised me to restart, of course. (someone else probably said I should zap my pram on my mac and see if that fixed it). Then I started getting the error when connecting to VPN:
"System configuration settings could not be applied. A VPN connection will not be established."

Turns out the problem I was having was that the IP Settings for my wifi connection were ‘static’, and they should be ‘DHCP’ so the dns can be updated to pull the VPN’s DNS to resolve hostnames properly. DHCP is usually the default, but someone probably changed this shared device to a static connection, which lets you override DNS. To do this you go to your settings app, then wifi, then *press and hold* the wifi connection you are on. On other devices there might be some other way of getting to the wifi details screen, but it should look something like this:

wifiscreen

Make sure you are on DHCP and not static. If there’s a box that says ‘static’ uncheck it. If your router is special and doesn’t let you do DHCP, you might not be able to use Cisco VPN from that connection.

Also, this seems to fix those pesky timeouts after 30 minutes to an hour (I guess something was pumped via DCHP that lets the connection live.

i used to be a programmer


archy_cover
archy_rats2


Yesterday I was at Owl & Company over on Piedmont Ave in Oakland and came across an interesting read by complete chance. It is a book of poetry and narrative of archy, who was a roach in 1920, and before that, a free verse poet. Archy hops from key to key on a typewriter leaving notes for his human ‘boss’ who owns the typewritter and ‘provides’ him with food in the garbage can. It is a real treat, and because of the whitespace, a real short treat at that. I finished it within a couple hours. The curious thing was that soon after reading this I found an untitled document open on TextEdit that I do not recall having anything to do with. I’m keeping it here so that I can document it.


i used to be a programmer
but now i am just a roach that had my soul transmigrated from
a programmer after i died
why a roach you ask well if you must know
it is for my programmer sins like
using so much indirection and so many underscores
oh the irony
i can t even press the shift key being a roach
can t even make an underscore much less
left parenthesis right parenthesis

the funny thing is
being a roach now
i have many ideas
but can t code any more left parenthesis
i had some ideas while human
they all made money
like the one to drive cars
with mustaches or umlauts
can t remember same thing really
they all take thirty percent right parenthesis

when you die and turn into a roach
they give you all your money
it carries over so to say
but as a roach it is hard to pick up
a dollar bill and
they don t make credit cards for us
but now i have no rent to worry about
i live in a lovely victorian
and the food is good as ever

now i have time to think
come up with some real good ones
but since money doesn t mean anything now
i think of programs to make abstract art
i described it to the venture capitalist
he said people don t want roach art apps
they hate things that are ugly and free
or maybe just things that are free that are made by a roach
i told him i don t need money
he said why dont you need money
i said i m a roach
he said lol i should have known
i am hiring a taskrabbit to step on you
and another to save you to make it a fair game
because they call me an angel investor
and i want to disrupt the world
anyway i decided to leave then

only a few problems for roaches
there is a programmer rat here named steve
code reviewing my text
bad indentation he says
its not even code i say
he says you got that right
what a jerk

Untitled

Here’s my .emacs file in all its unedited glory. May it be a light in your time of google searching or a darkness in your time of trying to understand how to configure emacs.

It’s also in a gist.

It’s a franken.emacs from lots of sources on the net. I’ve forgot them all, but almost none of this functionality originated with me and thus you should give your thanks to the anonymous internet. I wanted to document it for a while because it’s helpful when I switch to a new computer. It’s so messy that I put off documenting it. I’ve decided to share it anyways.
Features are

  • ctrl-x ctrl-o to switch between a .m, .mm, .c, .cpp file to corresponding .h file if it is nearby
  • ctrl-arrow to switch between multiple buffers/windows that you split horizontally or vertically (e.g. with ‘ctrl-x ctrl-3’
  • auto reverts when file changes on disk (e.g. when you git checkout) – note this can be a little dangerous, but I believe it doesn’t do this if you have local modifications
  • copy and paste works with os-x clipboard and vice-versa with your yank/copy/kill ring
  • other stuff