Tuesday, February 28, 2017

Xcode + Archive created of Zero Bytes


Hi all,

Now this is something funny. I created a cocoa project, build it and ran on my mac. It worked pretty well.

So for distribution I decided to create an archive : Xcode >> Products >> Archive
It was a success but to my surprise the archive was of Size ZERO.

Searched a lot and applied 2 things and VOILA it worked :P

Lets find the Solution


  • Set the Installation Directory of the Target and its dependent targets as /Applications/






  • Skip Install under Build Settings should be set to NO for the Target and all its dependent targets.





Xcode + Implicit Conversion Looses Integer Precision Error


Hi Friends,

Ever faced this issue on upgrading xCode or switching old project on xCode 5 to new xCode. Here is the Solution :)

Error
Implicit Conversion Looses Integer Precision

What is this Error
On a 64 bit system and xCode 5.1 the default architecture is 64 bit and accordingly NSInteger / NSUInteger changes its size.

Resolution
Xcode
Project
Target
Build Settings

  • Set Implicit Conversion to 32 Bit Type as NO
  • Set Treat warnings as Errors to NO








Monday, February 6, 2017

Apple Universal Links: A path to remember



Hi All,

Struggled hard to implement the UNIVERSAL LINKS. A nice but confusing procedure.


What are Universal Links
Universal links are the way to implement deep linking on iOS 9 and above.
Earlier defining Custom URL Scheme was the only simplest way to achieve deep-linking but n
ow the Associated Domains come into picture for handling deep-linking.


En-route to Implementation part...


***** Xcode Layer *****

Step 1 :
  • Open your xCode Project
  • Goto Target 
  • Click General
  • Set Bundle Identifier (Example : com.blog.spot )




Step 2 :
  • Click Capabilities
  • Enable Associated Domains
  • Click + in Domains and write (Example : applinks:india.com/apple-app-site-association)






Step 3 :
  • On Enabling Associated Domain a file Target.entitlements gets added in your project.
  • Please ensure this gets added in Targets Membership and the build.
  • You can view this in Identity Inspector.





Step 4 :
  • Click Build Settings
  • Under Signing Sections you can find Name of your Code Signing Entitlements as Target.entitlements

Step 5 :

  • Click Info.plist file.
  • Add URL Identifier as com.blog.spot under Url Types.
  • Add URL Scheme as com.blogspot under Url Types.


Step 6 :
  • Open Apple Developer Program.
  • Enable Associated Domains for your App Identifier.
  • Use the new certificate and provisioning profile for Build installation.



***** Server Layer *****
  • Buy a domain or use any existing one.
  • Acquire SSL Certification for it.
  • Create a JSON File  : apple-app-site-association.
  • Upload this file on the server.
  • It must return 200 http code.
  • Content type of File Must be proper.
  • For Verification you can use : https://limitless-sierra-4673.herokuapp.com/



JSON Structure{    "applinks": {

"apps": [],

"details": [{

"appID": "AB123CD4EF.com.blog.spot",

"paths": ["*"]

}]

}

}


AB123CD4EF.com.blog.spot
         |                         |
        ↓                         |
   Team Id                
                       Bundle Identifier


Verification

  • Create an HTML page and place on any server.
  • On page load call a method say open.
                function open()                  {  window.location = "blogspot://?user=100";  }

  • Now  goto Safari App, refresh and a popup must be visible.

  • Click Open and it should be redirected to your installed App
  • However if App is not installed an error pop up will display 





Notes:
  • Universal Links do not work with redirects.
  • With Gmail Universal Links perfectly fine.
  • Do not append .json in apple-app-site-association file

Hope it helps and save people from traums:)

Tuesday, January 24, 2017

Cef/Chromium Linker Issues on MAC


Hi All,

I somehow deleted my Cefclient Helper Target. When I decided to make helper target by making a duplicate of  Cefclient Target then faced some issues which are listed below along with their solutions that are quite generic and can be applied anywhere with similar issues.


System Info:
OSX : 10.11.6
XCode : 8.1


Error :
Undefined symbols for architecture x86_64 + "_main", referenced from: implicit entry/start for main executable

Solution :
  • Main method is either commented or missing. Plz add
  • int main(int argc, char * argv[])


Error :
 cef::logging::LogMessage::LogMessage(char const*, int, std::string*) in libcef_dll_wrapper.a(cef_logging.o)
      cef::logging::LogMessage::LogMessage(char const*, int, int, std::string*) in libcef_dll_wrapper.a(cef_logging.o)
      cef::logging::ErrnoLogMessage::~ErrnoLogMessage() in libcef_dll_wrapper.a(cef_logging.o)
libcef_dll_wrapper.a 
ld:symbol(s) not found for x86_64

Solution :
  • C++ Standard Library: libc++ (LLVM C++ standard library with C++11 support)
  • This value should be same for both Library and targets.
  • In my case it was different for my Helper Target.
  • Remember to set the correct architecture.


Hope its helpful :)



Sunday, January 22, 2017

FFMPEG Binary in OSX Package


Hiiiiii All,
Spent my last working day to solve issue related to packaging of FFMPEG binary in OSX release build.Every time i made a package its build correctly but the moment when FFMPEG binary is invoked i get error :

CMSampleBufferGetImageBuffer signalled err=-12731(kCMSampleBufferError_RequiredParameterMissing)

So the way to avoid this error we have to do following steps :
  • Project Settings
  • Click Target
  • Click Capabilities
  • Enable App-Sandbox
  • A file is added in project named Target.entitlements

Inside Entitlements file add following info :
  • com.apple.security.inherit [Boolean] YES
  • App Sandbox [Boolean] YES

Also add a RunScript in Target's Build Phase:

codesign -f -s "your certificate" 
--entitlements ./ffmpeg.entitlements 
./Build/Intermediates/ArchiveIntermediates/App\ Store/InstallationBuildProductsLocation/Applications/<my app>/Contents/MacOS/ffmpeg


Hope it hepls :)

Thursday, December 15, 2016

Module Integration imposes Swift Version Issue


Hi All,

Recently I tried to a a third Party Library to my iOS Project.
This library was built on Swift 3.0

On Integration I got Error :

Module compiled with newer version of Swift language (3.0) than previous files (2.0) for architecture x86_64 


To Overcome this tried following things:

  • Target
  • Build Settings
  • Swift Compiler - Version
  • Set No to Use Legacy Swift Language Version


Clean and Build and you are good to GO
:)

Thursday, October 13, 2016

The Charming FFMPEG


Hi All,

I have been using FFMPEG from almost 5 years.... I Am Loving it :)
Finally thought of sharing info about it when being used in OSX


1) Installation via HomeBrew

  • Open Terminal 
  • Install HomeBrew : Follow HOMEBREW
  • Install FFMPEG   :   brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools         
  • To Update HomeBrew : brew update
  • To Update FFMPEG   : brew upgrade ffmpeg                             


2) FFMPEG Builds


3) FFMPEG Binaries
  • http://www.ffmpegmac.net/ [Follow MAC]


Enjoy FFMPEGing... :)