Upgrading an iOS project from Xcode 6 to 7

At work I’m in the midst of upgrading Find&Save to Xcode 7 and in this post I thought I would capture the issues I ran into while migrating our app to the latest build tools. I decided to keep my Xcode 6 install by renaming it “Xcode 6” and installing Xcode 7 along side it and all that worked pretty seamlessly (though keep reading because the AppStore updates will bite you). Once installed I opened our project workspace and hit Project | Build and thus began the journey of our migration.

Updating Build Settings on .xcodeproj

Upon building our project I got the following warning:

Update to recommended settings

Which lead to this dialog for updating various build settings:
Screen Shot 2015-10-01 at 12.45.49 PM

At least this step seems pretty straight-forward onward…

Xcode 7 Enable BitCode Setting

Right of the bat I ran into this linker Error caused by our use of the Localytics SDK:

clang: error: linker command failed with exit code 1 (use -v to see invocation)

Error Details:
ld: '/Users/strefethen/iPhoneGeo/Pods/Localytics/Localytics-iOS-3.5.0/libLocalytics.a(LLInAppViewControllerFactory.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

After a fair amount of research on Bitcode (pretty interesting tech btw) I toggled Enable Bitcode on the project Target to “No”. I need to do some more research based on a note on Apple’s App Thinning page with regard to our use of watchOS and determine where this leaves us.

Xcode Build Setting for Enable Bitcode
Xcode Target Build Settings

HTTPS and NSAppTransportSecurity

At this point our project compiled successfully which at first struck me as far too easy. When I launched the app no content loaded and nothing that touched the net was working. I noticed these error messages in the console:

2015-09-29 22:49:40.281 iPhoneGeo[6153:1394717] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)

Essentially, Xcode wasn’t allowing our app to talk to anything on HTTP and instead preferring HTTPS. I found a good post discussing how to disable this requirement using NSAppTransportSecurity in the info.plist and allow all traffic because a) our staging setup does not use HTTPS and b) I wanted to understand what else didn’t work throughout our app so I opted to use the NSAllowsArbitraryLoads key set to YES. At first my desire was to do this just for debug builds and make it configurable though unfortunately I couldn’t find a way to use an environment variable for a BOOL prop in the info.plist.

Info.plist NSAppTransportSecurity

I tried adding a User-Defined setting for ALLOWS_ARBITRARY_LOADS and assigning it a string value of “Yes” for Debug and “No” for Release builds since I’ve seen other places where this had worked. Something like this:

User-Define build setting

My plan was to use it like so:

NSAllowsArbitraryLoads -> ${ALLOWS_ARBITRARY_LOADS}

However, this setting doesn’t seem to like anything but a BOOL which seemingly rules out using a User-Define to address this Debug/Release difference. Anyway, I continue on…


The Find&Save app supports Apple Watch and has a Cash Dash Inbox view for offers listed on the watch. At this point, more out of habit than anything I did a full clean and rebuild at which point I got the following error:
(null): error: WatchKit Extension doesn't contain any WatchKit apps. Verify that the value of WKWatchKitApp in your WatchKit App's Info.plist is set to YES.

After a little Googling I did a Project | Build and the problem magically took care of itself (though this is not an unusual occurrence for Xcode for me these days).

Images.xcassets Issues

There were two warnings related to Images.xcassets:
/Users/strefethen/github/iPhoneGeo/iPhoneGeo/Images.xcassets: The image set "list" references a file "list.PNG", but that file does not have a valid extension.

(null):  A launch storyboard or xib must be provided unless the app requires full screen

And of course now Xcode 7.1 will be breathing down our necks.

UPDATE 9/30: I just clicked the Update button on the Xcode v7.0.1 release in the AppStore app and following the install found it DELETED my Xcode 6.4 installation. Thank you Apple. 

UPDATE #2 9/30: I just found that pod update now gives this error:
Update all pods
Analyzing dependencies
xcrun: error: active developer path ("/Applications/Xcode 6.app/Contents/Developer") does not exist, use `xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools (or see `man xcode-select`)

So I ran an xcode-select as follows:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/
…and now I’m getting this error:
Generating Pods project
2015-09-30 13:55:38.204 ruby[18384:2457584] [MT] DVTAssertions: ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-8228/IDEFoundation/Initialization/IDEInitialization.m:590
Details: Assertion failed: _initializationCompletedSuccessfully
Function: BOOL IDEIsInitializedForUserInteraction()
Thread: {number = 1, name = main}
Hints: None
0 0x0000000104f33a4c -[DVTAssertionHandler handleFailureInFunction:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in DVTFoundation)
1 0x0000000104f331d9 _DVTAssertionHandler (in DVTFoundation)
2 0x0000000104f33445 _DVTAssertionFailureHandler (in DVTFoundation)
3 0x0000000104f333a7 _DVTAssertionFailureHandler (in DVTFoundation)
4 0x0000000106c42f5c IDEIsInitializedForUserInteraction (in IDEFoundation)
5 0x0000000109848e49 +[PBXProject projectWithFile:errorHandler:readOnly:] (in DevToolsCore)
6 0x000000010984a9ce +[PBXProject projectWithFile:errorHandler:] (in DevToolsCore)
7 0x00007fff90ed2f44 ffi_call_unix64 (in libffi.dylib)
Abort trap: 6

Which I fixed following the advice on the above link which involved:
stevet-2:iPhoneGeo strefethen$ sudo gem uninstall cocoapods
Select gem to uninstall:
1. cocoapods-0.29.0
2. cocoapods-0.33.1
3. cocoapods-0.34.4
4. cocoapods-0.36.3
5. All versions
> 5
Successfully uninstalled cocoapods-0.29.0
Successfully uninstalled cocoapods-0.33.1
Successfully uninstalled cocoapods-0.34.4
Remove executables:
pod, sandbox-pod
in addition to the gem? [Yn] n
stevet-2:iPhoneGeo strefethen$ sudo gem install cocoapods

UPDATE 10/1: The next issue I’m seeing is this error appearing in deviceconsole which is something I haven’t yet resolved.

<Error>:  SecOSStatusWith error:[-34018] Error Domain=NSOSStatusErrorDomain Code=-34018 "client has neither application-identifier nor keychain-access-groups entitlements" UserInfo={NSDescription=client has neither application-identifier nor keychain-access-groups entitlements}

UPDATE #2 10/1: I’ve recently upgraded to an iPhone 6s Plus which is running iOS 9.0.2 and following a reinstall of Xcode 6.4 as I was wanting to get back to work on our app but it seems I’ve now gone a step too far:

The Developer Disk image could not be mounted. Steve's iPhone 6s may be running a version of iOS that is not supported by this version of Xcode.
Xcode 6.4 error trying to run on an iPhone 6s Plus with iOS 9.0.2.

UPDATE #3 10/5: Our Jenkins build started failing with the following error from CocoaPods:

Sending stats
      Failed to send stats:  SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: sslv3 alert handshake failure

Found a Stack Overflow post with the same issue however on our build server I’m hesitant to jump to any beta release so I opted to use the CocoaPods environment variable COCOAPODS_DISABLE_STATS. Once it looks like things clear up I can removed this from Jenkins.


bad interpreter: No such file or directory

In XCode I ran into an error which was the result of a (my) bad merge that caused this problem when building an app:

/bin/sh: /Users/strefethen/github/iPhoneGeo/Build/iPhoneGeo/Build/Intermediates/iPhoneGeo.build/Debug-iphonesimulator/iPhoneGeo.build/Script-22C5773E1BB449FF00E72A71.sh: (null): bad interpreter: No such file or directory

The issue was that the Shell command for the Build Phase had gotten removed:

Screen Shot 2015-09-24 at 11.17.33 AM

This caused Xcode to insert the following line at the top of the build script and thus the above error:


Simply restoring the Shell setting above to “/bin/sh” corrected the issue.

React Native Packager TypeError: Cannot read property ‘root’ of null

While working on Find&Save‘s Cash Dash Inbox feature which is built using React Native I started the node packager and launched the app into SIM but got this error as soon as the app attempted to load the bundle:

TypeError: Cannot read property 'root' of null

Turns out the issue was an outdated watchman. Ok so off to brew update

stevet:iPhoneGeo strefethen$ brew update
Error: undefined method `link_overwrite' for #<Class:0x007fdb697392d0>

Doh! Looks like I ran into a “hole not many people should fall into“. Anyhoo, as suggested let’s try that again:

stevet:iPhoneGeo strefethen$ brew update
Already up-to-date.
stevet:iPhoneGeo strefethen$ brew upgrade watchman
==> Upgrading 1 outdated package, with result:
watchman 3.7.0
==> Upgrading watchman
==> Downloading https://homebrew.bintray.com/bottles/watchman-3.7.0.yosemite.bottl
######################################################################## 100.0%
==> Pouring watchman-3.7.0.yosemite.bottle.tar.gz
🍺  /usr/local/Cellar/watchman/3.7.0: 9 files, 240K

Whala now the packager is happy again. Btw, another Engineer on my team had this same problem and her machine required a reboot before things started working again.

Updating SSL certificate on Google AppEngine

A year ago at Google announced HTTPS as a ranking signal and following suit  I added SSL support to aroundairports.com and a few days ago I received an renewal email from GoDaddy for the cert. I recalled setting SSL up on AppEngine was a royal PITA and aligning the stars just so took several hours over a few days spelunking around the web to piece together the right steps. So this year I couldn’t quire recall all of the details though I had written a few key pieces of information down which really helped.

First, a few useful blog post including SSL for custom domains, and this Undocumented Guide to SSL for AppEngine. Once you’ve generated your key it will work for SSL cert updates so you don’t need to go through those steps again assuming you still have your *.key.pem file! With the new certs simply concatenate the files together and upload it with your PEM encoded key file (see above blog posts to create the key).

You need to select both your certificate bundle.crt and your PEM encoded key file then click UPLOAD on the Google Apps for Domains dashboard .

SSL Certificate upload

Platform for Retailers Targeted Local Deals and Notifications

Cash Dash Inbox
Find&Save Cash Dash Inbox

In November ’14 the Wanderful Media team launched a new feature within our Find&Save mobile apps called Cash Dash, a geographically targeted offer platform giving retailers the opportunity to reach consumers at key locations while out shopping. Using location aware features on iOS and Android the platform is able to suggest offers while users are out-and-about shopping. Leveraging our data on hundreds of retailers and hundreds of thousands of retailer locations as well as shopping malls all across the U.S. the platform provides retailers a rich ability to reach consumers at or near their stores with customized messaging and unique offers to help draw them in.

Find&Save’s Geo-Offer Platform is built to provide retailers a wide variety of customization options in terms of location targeting, custom messaging, deep linking, notification timing and more. These geo-notifications tie neatly into our mobile applications and offer retailers a wide range of choices for messaging consumers at the right time and location. For example, during the 2014 Black Friday shopping season we ran a custom geo-campaign for Gamestop alerting users of a special offer on a Microsoft XBOX when near their stores. We’ve also provided retailers options to educate users on upcoming store closings which can occur as a result of a merger and help direct them to the nearest alternate location.

Building a mobile geo-notification platform poses a variety of challenges on both iOS and Android with each platform having its own idiosyncracies. For example, both OS’s restrict the number of locations any one application can geo-fence at a time which means that as a device moves around it needs to utilize these precious resources carefully (think garbage collecting) to provide relevant notifications at the right locations when hundreds of thousands of locations exist. In addition to location there are a variety of other factors which play a role in presenting geo-notifications including time of day, day of the week, and open hours of the target retailer location/mall. Another factor is that some retail locations are quite large with potentially hundreds of stores. Our system takes all of these things into account and offers retailers a wide variety of mechanisms to reach their customers at or near their stores or even their competitors locations.

Cash Dash offers are now available on the web as well here.

Find&Save Android Appappstore

Error launching Google Chrome for React Native Debugging

Logged under “want to remember this for later” dept.:

Thanks to this thread for the tip.

I’ve ran into this error while trying to enable debugging via Chrome using React Native v0.4.3:

/Users/strefethen/github/iPhoneGeo/Pods/React/packager/launchChromeDevTools.applescript:686:689: script error: Expected class name but found property. (-2741)

On my machine it seems the issue stems from a change to launchChromeDevTools.applescript where it refers to “Chrome” when it used to refer to “Google Chrome”. The above error message occurred when selecting “Debug in Chrome” from the React Native Development menu in the simulator. Switching line 13:

tell application "Chrome"


tell application "Google Chrome"

Find&Save iPhone Application Gets a Facelift

My team at Wanderful Media has been hard at work on our latest update to our Find&Save iPhone application which we recently pushed to the AppStore and is now available for download. FindnSave iPhone AppWe took a fresh approach to the app’s design focusing on improving user engagement and making finding local sales quick and easy.

We’ve added a lot of features in this release with some of the highlights including:

  • Visual design with larger pictures
  • Local Store-wide offer content a.k.a Featured
  • Removed the requirement for Location Services (approx. 10% of users denied this)
  • Easy sharing of offers
  • Seasonal/Holiday a.k.a. Now! content
  • Image zoom on offer detail pages
  • Geo-notifications for sales around shopping malls
  • Offer browse history
  • Buy Now links on 1000’s of offers

One factor in our redesign was reducing the need for the Hamburger/slide menu and adding a tab bar for faster access to various slices of content. Within days of making these changes it was interesting to read some supporting evidence from an article published on the The Next Web UX designers: Side drawer navigation could be costing you half your user engagement saying:

On the other hand, if your app has multiple views that users will engage with somewhat equally, then side navigation could be costing you a great deal of your potential user engagement, and interaction with those part of the app accessed via the side menu.

As you can see in the screenshot we’ve not completely done away with the Hamburger yet but we’re continuing to focus on quick access to our core content. Even in just the few days this version (v1.5) has been in the AppStore we’ve started to see positive numbers on engagement. We’ve also applied changes to how we approach users for push notifications drawing some advice from an article by Clusters founder via techcrunch:

Our biggest takeaway: don’t ask a user for access until you really need it, and make sure it’s crystal clear what they will get in return.

One of our biggest behind the scenes changes has been refactoring our iOS codebase moving to support a Universal Binary that will help us leverage code across iPad/iPhone and keep evolving both applications more quickly. While this has been a big release it’s really just a first step as we have a large backlog of features and improvements to come making for a busy and interesting summer.

Please make iOS lock screen camera access optional via Settings

My request to Apple on the camera icon on the iOS Lock Screen:

The camera icon on the iOS lock screen is to a child like a Fart Gun from Despicable Me 2 which is to say they can’t stop using it.

Please, make it an option.

If you have young children you can likely relate, if not you should really see the movie it’s quite funny.

But seriously. Can we get an option here?

I’d prefer not to repeatedly have dozens of blurry, pictures of the carpet, couch, floor, ceiling, siblings, goofy faces, all variety of inanimate objects and alas things which shall remain nameless streaming to all my other iDevices let alone getting shared on the big screen via Apple TV.

Seriously, an option. Please.