Go Build Error - Too Many Open Files
I received the following go build error on my Mac. However, the same code ran fine on a linux server.
ERROR build.go:386: Failed to parse build errors error=“go tool compile: fork/exec /usr/local/go/pkg/tool/darwin_amd64/compile: too many open files\n”
ERROR harness.go:219: Build detected an error error=“Go Compilation Error: See console for build error.”
The problem was the mac os open files limit was set too low at 256. To solve the problem I modified the .bashrc file to increase the amount of open files allowed to over a million. I added the following line to the .bashrc file:
Start MySQl from command line on Mac
Sometimes MySQL seems to have trouble starting up automatically. Even though I have the setting for MySql set to start up automatically via the checkbox “Automatically Start MySQL Server on Startup” in System Prefrences - MySQL. Even pressing the “Start MysSQL Server” button doesn’t work.
When this happens I find it useful to start up MySql via the command line. To do this I execute
/usr/local/mysql/support-files/mysql.server start
Either this is successful and it will say:
iOS and Android Mobile Device Frames for Screenshots
As you near the end of a release cycle for your mobile iOS or Android app you will need to take screenshots to include in the App Store listing.
Many decide to dress up their screenshots with device frames. Here is a list of sites that provide iPhone, iPad, and Android device frames that can be used in your App Store screenshots.
Facebook design site at https://facebook.design/devices includes frames for:
- Apple Thunderbolt
- Apple Watch
- Galaxy phones
- Google Pixel phones
- iMac
- iPad
- iPhone
- Nexus phones
- Surface tablets
- and much more
Apple’s developer website at https://developer.apple.com/app-store/marketing/guidelines/#section-products includes Apple product images for most of their devices with screens.
Create Apple Search Ads for Multiple Countries (Storefronts)
When Apple Search Ads launched in October 2016 it only displayed ads in the United States. However, it expanded to multiple English speaking countries on April 25, 2017 to include the United Kingdom, Australia, and New Zealand. Each country is represented by a different storefront and to get your ad to display in each storefront you need to create a separate campaign for each country.
By August 1, 2018, Apple Search Ads expanded to include France, Germany, Italy, Japan, Mexico, South Korea, Spain and Switzerland.
‘CurveEaseInOut’ is unavailable: use [] to construct an empty option set
Swift 3 removed CurveEaseInOut so you will get the error message “‘CurveEaseInOut’ is unavailable: use [] to construct an empty option set”
Replace
UIViewAnimationOptions.CurveEaseInOut
with
[.curveEaseIn, .curveEaseOut]
‘CGSizeMake’ is unavailable in Swift
Swift 3 removed CGSizeMake. You will get the error message “‘CGSizeMake’ is unavailable in Swift”. To resolve this replace:
CGSizeMake(100, 200)
with
CGSize(width: 100, height: 200)
Android Back button does not navigate between bottom navigation bar views
I implemented a bottom navigation bar with multiple fragments. When selecting each view, I added the fragment to the back stack with transaction.addToBackStack(null). However, when I pressed the back button the fragments switched but the menu item in the navigation bar would not highlight.
Apparently, Material design guidelines state “On Android, the Back button does not navigate between bottom navigation bar views.”
As a result I needed to remove the call to addToBackStack as the proper behavior is for the back button to go to the previous app or activity.
Best credit card for PPC advertising such as Google Adwords, Facebook Ads or Apple Search Ads
If you use online advertising to promote your apps, goods, or services it might be beneficial to use a credit card that gives you extra points for spending money on online advertising. The Chase Ink Business Preferred is one of the best business cards you can get.
The Chase Ink Business Preferred credit card awards 3 points for spending in the following categories:
- advertising purchases made with social media sites and search engines
- shipping
- travel
- internet, cable, and phone services
This is great if you advertise online with advertisers such as the following.
Location of Android SDK folder on Mac
To determine where the Android SDK folder on your computer is located open Android Studio. Press the Android Studio menu in the toolbar and search for “Android SDK” or navigate there via Appearance & Behavior, System Settings, Android SDK.
The location of the folder is located in the text box near the top that says “Android SDK Location”.
By default the Android SDK location is stored at “/Users/[USER]/Library/Android/sdk” or at “/Library/Android/sdk/”.
Calculate how much you spent on Amazon.com and paid in Sales Tax
If you are doing your taxes or you are just curious to see how much you spend on Amazon.com you might find the Order History Reports feature useful.
If you are filing your US federal income taxes and are taking the state sales tax deduction, you can use the report tool to quickly and easily calculate how much sales tax you paid on Amazon.com.
To get the .csv report go to Order History Reports and select the “Items” Report Type, along with a start and end date, or simply press one of the “Quick Set Options” such as “Last Year”. After the report finishes generating you can open it in excel or numbers and add a footer field where you can calculate the SUM of the “Item Subtotal Tax” and “Item Total” columns.
iOS App Preview Video Resolutions and Sizes
App Preview Resolutions
How to fix target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/…`
If you are using swift and CocoaPods you may get the following warning after running pod install or pod update:
[!] The target overrides the ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES build setting defined in Pods/Target Support Files/…. This can lead to problems with the CocoaPods installation
The warning message then gives the following two suggestions:
- Use the $(inherited) flag, or
- Remove the build settings from the target.
To implement the first suggestion of using the `$(inherited)` flag follow the steps below:
How to fix the Swift 4 @objc inference warning
After installing Xcode 9 and migrating to Swift 4 from Swift 3 I received this warning:
The use of Swift 3 @objc inference in Swift 4 mode is deprecated. Please address deprecated @objc inference warnings, test your code with “Use of deprecated Swift 3 @objc inference” logging enabled, and then disable inference by changing the “Swift 3 @objc Inference” build setting to “Default” for the “AppName” target.
I resolved this issue by going to the projects build target. Selecting “Build Settings”. Searching for “Inference” then changing the setting for “Swift 3 @objc Inference” from “On” to “Default”. If you have multiple targets in your project you may have to do this for each target.
Swift 4 substring
After converting my Swift 3 project to Swift 4 I received the warning:
‘substring(from:)’ is deprecated: Please use String slicing subscript with a ‘partial range from’ operator.
The old Swift 3 code was
let range = str.range(of:"Some ")
let index = range!.upperBound
let subStr = str.substring(from: index)
The new Swift 4 code for substring is:
let str = "Some String"
let range = str.range(of:"Some ")
let index = range!.upperBound
let subStr = String(str[index...])
Encryption Export Compliance for iOS apps
Disclaimer: I am not a lawyer. This is not legal advice, this is for information purposes only. Consult an attorney for legal guidance.
If your iOS app is simply using ATS or HTTPS to communicate with an external server then your app is using Encryption. As such you may need to submit a year-end self classification report to the US government. This is far-reaching as Apple is pushing to require ATS in all apps. The original deadline was Jan 1, 2017, however it has been extended indefinitely. These requirements would include simple apps that may be using an external SDK with ATS enabled for metrics or advertising such as Facebook SDKs.