Dyld not found AVAssetDownladTask

Trying to add offline HLS (new ios 10 feature) to the app. I am trying to accomplish the following quickly so that the app still functions on ios 9 without HLS function while offline. Works great on ios10 and compiles for ios9.

    @available(iOS 10.0, *)
    @objc class DownloadManager: NSObject, AVAssetDownloadDelegate {
           //Do stuff with downloading assets
      }

      

However, when I actually run this on an ios 9 device, the app crashes immediately with the following message:

dyld: Symbol not found: _OBJC_CLASS _ $ _ AVAssetDownloadTask Link from: / var / mobile / Containers / Bundle / Application / 7062C410-C4F5-4270-9F1E-22750E99F799 / wod.app / wod Expected in: / System / Library / Frameworks / AVFoundation.framework / AVFoundation in / var / mobile / Containers / Bundle / Application / 7062C410-C4F5-4270-9F1E-22750E99F799 / wod.app / wod

I've limited all the code related to this to the DownloadManager class, so I don't know what to do next. Thank you!

+3


source to share


1 answer


I understood that. I had a weak AVFoundation connection. Found it on the apple site.

https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html



Weak connection with all structures

When you refer to symbols in another structure, most of those symbols are closely related to your code. To create a weak link to a symbol, the framework containing the symbol must explicitly add weak_import (see Marking Symbols for Weak Linking). However, if you do not maintain a structure and must link its symbols, you can explicitly tell the compiler to mark all symbols loosely. To do this, you have to open your project in Xcode and change the way you bind your goals to the framework as follows:

Select the target you want to change and show its build phases. Expand the Link Binary With Libraries component to see which are currently linked by the target. If the structure you want to weak link is listed in the Library Links Bin, select it and choose Edit> Delete to delete it. Now you can tell the linker to use loose coupling for this structure.

Select a target, open its info window, and click Build. To another setting of the linker flags, add the following command line option specification where the name of the framework you want to weakly reference: -weak_framework Build your product.

+3


source







All Articles