Recently, I started coding with Xcode (I used to code with Swift Playgrounds on my iPad), and now I'm attempting to make a SwiftUI app that uses AVFoundation and camera to let the user take pictures of animals. The purpose of the app is to identify the photographed animals, using machine learning.
In Swift Playgrounds, when I wanted to use a framework, the only thing I had to do is to add "import framework name" above my code. However, if I do that in Xcode with the AVFoundation framework, Xcode throws this error: "Cannot load underlying module for 'AVFoundation'". This probably is some sort of rookie mistake, but I'm new to Xcode, so please forgive me. 😉
I already added the framework to the "Link Binary With Libraries" section (Project -> Build Phases -> Link Binary With Libraries), but this doesn't get rid of the error. What else should I do in order to use AVFoundation?
Update: the error was thrown when I tried to run the app on my iPhone 8. (It doesn't run in simulator, because it uses camera)