Tuesday, October 20, 2015

cant install SWIFT IPA (Enterprise or Adhoc )

When you try to install a IPA that has Swift code from a MDM or through a URL it doesn't work. It works when you run it through the Developer profile, but doesnt work when you install it in the above way.

When you look at the log you should see a similar message as shown below.


dyld: Library not loaded: @rpath/libswiftCore.dylib

Referenced from: /private/var/mobile/Containers/Bundle/Application 
/90ABFFGH-AB09-7584-A2BC-9AX2S41234Z/App-Name.app/App-Name           

Reason: image not found        

(lldb)

For some, the following worked.

Setting Embedded Content Contains Swift Code to YES

Some developers the adding the following to the Runpath worked.
@executable_path/Frameworks

your_target -> Build Settings -> Linking -> Runpath Search Paths

For others repacking the IPA the following ways worked as mentioned in this article.

https://devforums.apple.com/message/984530#984530

As mentioned there do the following using the terminal.

ditto -xk yourIPAFile.ipa /tmp/tempPath
ditto -ck --norsrc /tmp/tempPath NewIPA_file.ipa
rm -r /tmp/tempPath

The only solution that worked for me was Revoking the Distribution Certificate, creating a new Distribution certificate, creating a New provisioning profile that works with this certificate.
I did all the above steps manually without the Xocde creating them automatically.
  1. Create new distribution Certificate.
  2. Create new provisioning profile.
  3. Downloading them onto the mac.
  4. open Xcode -> preferences -> view Accounts and Refreshing downloaded and it worked for me.
I know this solution might not work for some as removing Distribution profiles would stop the Apps from working. As we can have two distribution certificates, i used the second one to create and made it work.

This might happen if the distribution certificate was created prior to Xcode6 or IOS8 where in a entity "OU" is missing from the certificate.If you want to check to see if your certificate has it, please do so by running the following command 
openssl x509 -in ios_distribution.cer -inform DER -text -noout
as mentioned in the article 

No comments:

Post a Comment