Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addFramework uses incorrect path for Swift libraries #114

Open
jskrepnek opened this issue Jun 15, 2020 · 1 comment
Open

addFramework uses incorrect path for Swift libraries #114

jskrepnek opened this issue Jun 15, 2020 · 1 comment

Comments

@jskrepnek
Copy link

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:

27874A9BBF2444AABA64E8E0 /* libswiftAVFoundation.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libswiftAVFoundation.tbd; path = usr/lib/libswiftAVFoundation.tbd; sourceTree = SDKROOT; };

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:

5DBEA893249434B30034407A /* libswiftAVFoundation.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libswiftAVFoundation.tbd; path = usr/lib/swift/libswiftAVFoundation.tbd; sourceTree = SDKROOT; };

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.

@MauriceSchoenmakers
Copy link

got the same issue, any other solution ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants