Skip to content

Troubleshooting

Srinija Ammapalli edited this page Jul 16, 2018 · 2 revisions

'Library not Loaded' error

dyld: Library not loaded: @rpath/libswiftAVFoundation.dylib
  Referenced from: /private/var/containers/Bundle/Application/28070992-6436-434E-9546-6BC45ACDE39D/HyperSnapDemoApp.app/Frameworks/HyperSnapSDK.framework/HyperSnapSDK
  Reason: image not found

This error happens when your app is not able to find the framework. This could happen for a variety of reasons. Here is a list(not exhaustive) of fixes obtained from sources like StackOverflow, sorted from most likely to least likely.

  1. If the integration is done manually, navigate to Targets -> General and ensure that HyperSnapSDK.framework is under both Embedded Binaries and Linked Frameworks and Libraries.
  2. If integration is via CocoaPods, run pod install once more. Also, ensure that Pods_YOUR-APP-NAME.framwork is present under Linked Frameworks and Libraries in Targets -> General.
  3. Target -> Build Settings ->Always Embed Swift Standard Libraries: Set to Yes (Same in Project -> Build Settings)
  4. Target -> Build Settings ->Runpath Search Paths: Add @executable_path/Frameworks
  5. Deleting Derived data: Menu -> Xcode -> Preferences -> Locations Click on the arrow next to Derived Data’ location. Delete the entire folder.
  6. Clean the project: Menu -> Product -> Clean
  7. Target -> Build Settings -> Embedded Content Contains Swift Code: Set to Yes (If this option is available)
  8. Project > Build Settings > Swift Compiler - Search Path: Setting Import Paths to $(PROJECT_DIR)
  9. Keychain -> Double click on ‘Developer Certificate’ -> Click on the dropdown corresponding to ‘Trust’ -> Set ’When using this certificate’ to ‘Use System Defaults’
  10. Make sure you have this certificate in your keychain: http://developer.apple.com/certificationauthority/AppleWWDRCA.cer. To add this to keychain, open Keychain utility, File -> Import items.
  11. Reset your certificates in XCode.

'Unsupported Architectures' error

ERROR ITMS-90087: "Unsupported Architectures. The executable for HyperSnapDemoApp.app/Frameworks/HyperSnapSDK.framework contains unsupported architectures '[x86_64, i386]'."

ERROR ITMS-90209: "Invalid Segment Alignment. The app binary at 'HyperSnapDemoApp.app/Frameworks/HyperSnapSDK.framework/HyperSnapSDK' does not have proper segment alignment. Try rebuilding the app with the latest Xcode version."

ERROR ITMS-90125: "The binary is invalid. The encryption info in the LC_ENCRYPTION_INFO load command is either missing or invalid, or the binary is already encrypted. This binary does not seem to have been built with Apple's linker."

All our iOS frameworks have been built with support for the following architectures:

  • arm and arm64 to test iPhone devices
  • x86_64 and i386 for simulators

Although the multiple architectures are very useful while developing, occasionally, this error might come up while archiving the app for an AppStore submit. This could be happening because of some project setting in the app that is preventing unnecessary files from getting removed while archiving the app.

The easiest fix would be to add a run script to your project that would take care of removing all unnecessary architectures while archiving. Add this run script to your project. To know how to add run scripts, check this link.

NSCameraUsageDescription

This app has crashed because it attempted to access privacy-sensitive data without a usage description.
The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.

From iOS 10 and above, any access to private data should be declared ahead of time or the app would crash. This is done by adding a usage key to your app’s Info.plist file along with a purpose string. As mentioned in the documentation, HyperSnapSDK requires access to the device's camera. Thus requiring the key NSCameraUsageDescription and the corresponding purpose string in the Info.plist file.

Swift Compiler Error - Version Compatibility

Module compiled with Swift 4.0.3 cannot be imported in Swift 4.1` 
	or
Incompatible Swift version - framework was built with 4.0.3 and the local version is 4.1

This error (and similar errors involving Swift 4.1, 4.2, etc.) will occur when opening a project with Xcode 9.1, 9.2, 9.3, 9.4, 10, etc. that uses frameworks that were built with a different version Xcode tools. The XCode version used to build the latest version of the framework can be found here. If both XCode versions(framework and your app) seem to be the same,

  • Delete derived data, clean(cmd + shift + k) your project and try building again.
  • Make sure, your xcodebuild tools are set to the latest. This can be checked at Preferences -> Locations -> Command Line Tools.
  • Navigate to Target -> Build Settings -> Swift Language Version: Ensure this is set correctly.

We always try to release new versions of the framework when an incompatible version of XCode is released on the AppStore. In the unlikely situation where the XCode version in the documentation is not the latest, please notify HyperVerge.

Note: Running pod install will not fix the issue. This is because, unlike static libraries, frameworks are pre-built. So, the only to make it work is to use a version of the framework built using the correct XCode tools.