import AVKit - no such module on TVOS, possible for ios/multiplatform

When starting a new TVOS project and try to import AVKit it says no such module available.

I added them on Frameworks, Libraries and Content - still nothing.

Double checked if they are in BuildPhases - Link Binary with LibrariesBuild Phases

Cleaned build folder and Derived Data. Nothing Worked. According to Apple's documentation it is supposed to be available for TVOS, but i simply cannot get it to be available.

When I start a new multiplatform or iOS project it is possible to import it, just not for TVOS, don't know what to do.Didn't have to add any framework manually, simply worked.

No issues when starting a new ios project Project settings iOS.

What's going on here?

Accepted Reply

I downloaded Xcode 14.3 and renamed it to Xcode_14_3 so I had both versions of Xcode on my machine... launched it... and the project worked. I then launched 14.3.1 and used the "On Disk" option of the project when it asked. No more live compile issue with AVKit or AVFoundation. It now works for me...

Something must have got corrupted with the project files when I updated Xcode, not sure. Yes I cleaned, and built. Hope that helps.

  • That did the trick!!thank you so much!

Add a Comment

Replies

Hard to say...
Simply writing import AVKit is enough to make it work for me.
That suggests there may be an issue with the setup of your Xcode?

Of course, my Xcode had to import tvOS first (as it is no longer included in the default install)...
...trying to create a new tvOS project initially prompted me with:

tvOS Not Installed
You will not be able to build or run your project

...but you checked that first, right?

XCode 14.3.1 (14E300c)

  • Thanks for the reply. I'm prompted with the error when I try to import AVKit after creating a new TVos project, it builds fine, simulator works fine. AVKit simply not importable. It may be due to some unknown project settings but the fact is that on an iOS project it works out of the box no additional project settings needed(last print screen). Nothing on Apple's documentation, that I could find, stating that special settings are needed. In fact, I think AVKit is a system framework, right?

Add a Comment

I am having the same issue (but with an existing project), also happening with AVFoundation. It started not working for me this morning on a project that had no issues yesterday with it.

Possibly something to do with System Maintenance? https://developer.apple.com/system-status/

I will try again later today, but any insight or suggestions would be helpful.

I downloaded Xcode 14.3 and renamed it to Xcode_14_3 so I had both versions of Xcode on my machine... launched it... and the project worked. I then launched 14.3.1 and used the "On Disk" option of the project when it asked. No more live compile issue with AVKit or AVFoundation. It now works for me...

Something must have got corrupted with the project files when I updated Xcode, not sure. Yes I cleaned, and built. Hope that helps.

  • That did the trick!!thank you so much!

Add a Comment