iOS Build Environment Help Center

ld: file not found AVFAudio

append delete tof43

Hello,

I am facing a compilation problem that I could not resolve by myself, so any help would be really appreciated :)

OS : Windows 10
iOS Builder : 3.35.3
iOS SDK : 14.5

Here is the log : https://pastebin.com/bWc89HnD

I have tried to check "extra linker flags" and add :
-framework AVFAudio -framework AVFoundation

Context : this is a only project that I used to build directly on a Mac. The last time I build it was in 2014 I believe. I have removed some plugins that I thought could have been the problem but no luck, it sill does not work. I suppose there is something special in this project but I can't find what, so any clue would really help.

Thanks !

Christophe

Reply RSS

Replies

append delete #1. Pierre-Marie Baty

Hello

Well, that's another interesting case of a buggy SDK! I'm almost certain this project wouldn't build with today's Xcode.

Apple sometimes changes the layout of their SDK. Before, AVFAudio was a sub-framework of AVFoundation (located in /System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework) and now it's become a framework by itself, located in /System/Library/Frameworks directly.

But, the fact that the linker *still* looks for it in

%
ld: file not found: /System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/AVFAudio for architecture armv7
%

...indicates that in the Text Binary Description file that describes the contents of the AVFoundation framework, the path to the no longer existing AVFAudio framework is still here!

And indeed, if you open SDK\System\Library\Frameworks\AVFoundation.framework\AVFoundation.tbd (in iOS SDK 14.5) with your favorite text editor, you can see:

%
reexported-libraries:
  - targets:         [ armv7-ios, armv7s-ios ]
    libraries:       [ '/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/AVFAudio' ]
  - targets:         [ armv7-ios, armv7s-ios, arm64-ios, arm64e-ios ]
    libraries:       [ '/System/Library/Frameworks/AVFAudio.framework/AVFAudio', 
                       '/System/Library/PrivateFrameworks/AVFCapture.framework/AVFCapture', 
                       '/System/Library/PrivateFrameworks/AVFCore.framework/AVFCore' ]
%

Bingo. A genuine cute Apple bug.

Actually I'm not quite sure of the best way to solve this problem. There are two cases:
- Either on iOS phones the AVFAudio framework is *really* located in /System/Library/Frameworks on the OS filesystem, and in which case we should correct the .tbd file to reflect that,
- Or in iOS devices the AVFAudio framework is *still* located in /System/Library/Frameworks/AVFoundation.framework/Frameworks as a sub-framework, and in which case we should move it back there in the SDK.

The thing is, what's built must reflect exactly the topology of what's available on an iOS system. So here's my advice to you: choose either method, and see if it crashes at runtime when you use functions that belong to this framework. If one method crashes, the right one is the other.

In either case, the iOS SDK 14.5 is wrong and should be fixed :-)

Have a nice day,

:: @Pierre-Marie Baty added on 11 Jun ’21 · 13:07

P.S. I will rename this thread to include "AVFAudio" in it. I hope you don't mind.

:: @Pierre-Marie Baty added on 11 Jun ’21 · 13:14

I noticed one thing more. This error happens because you're building for armv7. If you look in the reexported-libraries section of this framework's TBD file, you see that for arm64-ios, the path to the framework is correct.

So maybe you should just migrate your project to arm64 ?

Reply

(Leave this as-is, it’s a trap!)

There is no need to “register”, just enter the same name + password of your choice every time.

Pro tip: Use markup to add links, quotes and more.

Moderators: Pierre-Marie Baty