The default path used in the PBXFileReference for frameworks with .tbd extensions is /usr/lib. However, I believe that Swift libraries with the same extension needs to have the path /usr/lib/swift.
For example, if you use addFramework to add libswiftAVFoundation.tbd it produces the following PBXFileReference in the project file:
Note the path difference:
cordova-node-xcode: usr/lib/libswiftAVFoundation.tbd
Xcode: usr/lib/swift/libswiftAVFoundation.tbd
I have an experimental patch here to work around this.
Assuming I'm on the right track here, I'll submit a pull request but I'm hoping that the maintainers can recommend if the approach I used is acceptable or if there's a more effective way to select the correct default path for these libraries than introducing another option.
The default path used in the
PBXFileReference
for frameworks with.tbd
extensions is/usr/lib
. However, I believe that Swift libraries with the same extension needs to have the path/usr/lib/swift
.For example, if you use
addFramework
to addlibswiftAVFoundation.tbd
it produces the followingPBXFileReference
in the project file:This will ultimately result in a Crash on iOS versions 12.1 or lower, before the Swift runtime was bundled with the OS.
If you add the library manually in Xcode, the project file has the following `PBXFileReference' added:
Note the path difference: cordova-node-xcode: usr/lib/libswiftAVFoundation.tbd Xcode: usr/lib/swift/libswiftAVFoundation.tbd
I have an experimental patch here to work around this.
Assuming I'm on the right track here, I'll submit a pull request but I'm hoping that the maintainers can recommend if the approach I used is acceptable or if there's a more effective way to select the correct default path for these libraries than introducing another option.