openframeworks / openFrameworks

openFrameworks is a community-developed cross platform toolkit for creative coding in C++.
http://openframeworks.cc
Other
9.88k stars 2.55k forks source link

tvOS examples are all broken. #7075

Open ofTheo opened 1 year ago

ofTheo commented 1 year ago

Taking a look at the tvOS examples in Xcode 13, they all reference the iOS SDK and iOS Simulators.

Switching the SDK to tvOS and device type to Apple TV doesn't fix the issue as the interface / storyboards are also for iOS and Xcode errors saying it is not compatible.

I think what is happening is that the projectGenerator / packaging script is using the iOS templates for the tvOS examples.

As the actual tvOS template is using appletvos: https://github.com/openframeworks/openFrameworks/blob/master/scripts/templates/tvOS/emptyExample.xcodeproj/project.pbxproj#L279

ofTheo commented 1 year ago

@danoli3 I could do two different calls here one for iOS and one for tvOS for the two folders in examples/ https://github.com/openframeworks/openFrameworks/blob/master/scripts/dev/create_package.sh#L203

image

But also wondering at this point is it worth messing with tvOS? Guessing that there are many more issues here. Maybe it is better to drop? I haven't seen / heard any reports of it not working which I guess means people aren't trying to use it?

TheNorthEestern commented 1 year ago

I'm one of the lone souls in the wild attempting to use this. I've managed to get past the storyboards error by not including LaunchScreen in the target membership of tvOS builds, but am now running into an issue where all of the included pre- built libraries have only been built for the iOS simulator. Is there an easy way to get those built for tvOS that you know of?

Here's an example of my build output:

Ld /Users/kacyjames/Library/Developer/Xcode/DerivedData/ofBoxExample-elijpbghvcqabickdwmtywwvnjkx/Build/Products/Debug-appletvsimulator/ofBoxExample.app/ofBoxExample normal (in target 'ofBoxExample' from project 'ofBoxExample')
    cd /Users/kacyjames/Downloads/of_v0.11.2_ios_release/examples/tvOS/ofBoxExample
    /Applications/Xcode-14.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -target x86_64-apple-tvos16.0-simulator -isysroot /Applications/Xcode-14.0.1.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator16.0.sdk -L/Users/kacyjames/Library/Developer/Xcode/DerivedData/ofBoxExample-elijpbghvcqabickdwmtywwvnjkx/Build/Intermediates.noindex/EagerLinkingTBDs -L/Users/kacyjames/Library/Developer/Xcode/DerivedData/ofBoxExample-elijpbghvcqabickdwmtywwvnjkx/Build/Products/Debug-appletvsimulator -F/Users/kacyjames/Library/Developer/Xcode/DerivedData/ofBoxExample-elijpbghvcqabickdwmtywwvnjkx/Build/Intermediates.noindex/EagerLinkingTBDs -F/Users/kacyjames/Library/Developer/Xcode/DerivedData/ofBoxExample-elijpbghvcqabickdwmtywwvnjkx/Build/Products/Debug-appletvsimulator -F/Users/kacyjames/Downloads/of_v0.11.2_ios_release/examples/tvOS/ofBoxExample -filelist /Users/kacyjames/Library/Developer/Xcode/DerivedData/ofBoxExample-elijpbghvcqabickdwmtywwvnjkx/Build/Intermediates.noindex/ofBoxExample.build/Debug-appletvsimulator/ofBoxExample.build/Objects-normal/x86_64/ofBoxExample.LinkFileList -dead_strip -Xlinker -object_path_lto -Xlinker /Users/kacyjames/Library/Developer/Xcode/DerivedData/ofBoxExample-elijpbghvcqabickdwmtywwvnjkx/Build/Intermediates.noindex/ofBoxExample.build/Debug-appletvsimulator/ofBoxExample.build/Objects-normal/x86_64/ofBoxExample_lto.o -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -stdlib\=libc++ -fobjc-link-runtime -ObjC\ --disable-asm ../../../libs/boost/lib/ios/boost_system.a ../../../libs/boost/lib/ios/boost_filesystem.a ../../../libs/FreeImage/lib/ios/freeimage.a ../../../libs/freetype/lib/ios/freetype.a ../../../libs/tess2/lib/ios/tess2.a ../../../libs/curl/lib/ios/curl.a ../../../libs/uriparser/lib/ios/uriparser.a ../../../libs/pugixml/lib/ios/pugixml.a ../../../libs/openFrameworksCompiled/lib/ios/libofxiOS_appletvsimulator_Debug.a -framework AudioToolbox -framework Accelerate -framework AVFoundation -framework CoreAudio -framework CoreGraphics -framework CoreLocation -framework CoreMedia -framework CoreVideo -framework Foundation -framework GameController -framework GLKit -framework MapKit -framework OpenAL -framework OpenGLES -framework UIKit -framework Security -framework QuartzCore -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/kacyjames/Library/Developer/Xcode/DerivedData/ofBoxExample-elijpbghvcqabickdwmtywwvnjkx/Build/Intermediates.noindex/ofBoxExample.build/Debug-appletvsimulator/ofBoxExample.build/ofBoxExample.app-Simulated.xcent -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __ents_der -Xlinker /Users/kacyjames/Library/Developer/Xcode/DerivedData/ofBoxExample-elijpbghvcqabickdwmtywwvnjkx/Build/Intermediates.noindex/ofBoxExample.build/Debug-appletvsimulator/ofBoxExample.build/ofBoxExample.app-Simulated.xcent.der -framework GLKit -framework Foundation -framework UIKit -framework CoreGraphics -framework OpenGLES -framework QuartzCore -framework AudioToolbox -framework OpenAL -framework CoreLocation -framework AVFoundation -framework CoreMedia -framework CoreVideo -framework MapKit -framework Accelerate -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker /Users/kacyjames/Library/Developer/Xcode/DerivedData/ofBoxExample-elijpbghvcqabickdwmtywwvnjkx/Build/Intermediates.noindex/ofBoxExample.build/Debug-appletvsimulator/ofBoxExample.build/Objects-normal/x86_64/ofBoxExample_dependency_info.dat -o /Users/kacyjames/Library/Developer/Xcode/DerivedData/ofBoxExample-elijpbghvcqabickdwmtywwvnjkx/Build/Products/Debug-appletvsimulator/ofBoxExample.app/ofBoxExample

ld: in ../../../libs/curl/lib/ios/curl.a(libcurl_la-file.o), building for tvOS Simulator, but linking in object file built for iOS Simulator, file '../../../libs/curl/lib/ios/curl.a' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
danoli3 commented 1 year ago

Yeah should be easy fix

TheNorthEestern commented 1 year ago

Hey y'all, I've managed to get openFrameworks building again in the simulator and on real AppleTV hardware. I had to make a few tweaks to the generated iOS template (which I'll need to backtrack against to get an exhaustive list)

Video of it in action:

https://user-images.githubusercontent.com/59484/209025848-70a2eee1-3cd7-419c-a2a3-09e39b77d646.mov

TheNorthEestern commented 1 year ago

The source for the above video can be found here