0

This target is tvOS. I'm using Cocoapods and here is the pod

pod 'GoogleAds-IMA-tvOS-SDK', '4.3.2'

I've tried updating to a more recent version, but the issue remained.

Undefined symbols for architecture arm64:
    "_OBJC_CLASS_$_IMACompanionAdSlot", referenced from:
        objc-class-ref in DAILinearTVPlayer.o
        objc-class-ref in NativePlayer.o
ld: symbol(s) not found for architecture arm64

This is the error I get when I try to build my target with SWIFT_OPTIMIZATION_LEVEL = "-Onone".

When I change only the optimization level to SWIFT_OPTIMIZATION_LEVEL = "-O" build is successful.

I've tried most of the answers from this question and also this question but nothing worked in my case.

When I try to build for simulator I get the same error except "... for architecture x86_64"

mkbrwr
  • 26
  • 1
  • 5
  • did u check supported arch for GoogleAds-IMA-tvOS-SDK ? – Teja Nandamuri Aug 11 '22 at 17:08
  • Couldn't find any docs describing supported arch. But I can build my target successfully if I turn optimisation on so I guess this is not a supported arch issue. – mkbrwr Aug 12 '22 at 09:01

2 Answers2

0

TARGET -> Build Settings, search 'VALID'. Set VALID_ARCHS. If run with a simulator set x86_64 else iPhone device set arm64.

This is work for me. You can try.

Jack Will
  • 160
  • 2
  • 7
  • I don't have this settings in Build Settings for my target. I've tried searching for VALID, ARCH, valid etc. I have something in Architectures -> Architectures -> $(ARCH_STANDARD) but I think it's a different settings from the one you've mentioned. – mkbrwr Aug 12 '22 at 08:51
0

I was using wrong init for IMAAdDisplayContainer

IMAAdDisplayContainer(adContainer: self.view, viewController: self, companionSlots: nil)

companion slots aren't supported on tvOS here is comment about this. After I've changed init to

IMAAdDisplayContainer(adContainer: self.view, viewController: self)

Everything compiled successfully in Debug configuration and without optimizations. Finally I can use debugger normally again!

mkbrwr
  • 26
  • 1
  • 5