Open mchlbowyer opened 5 years ago
Hi @mchlbowyer,
Could you try feature/fat-libraries branch and let me know if it works for you? Libraries in this branch contains symbols for both iOS and Simulator.
@ss-abramchuk trying it now, will report back asap
@ss-abramchuk seems to build now, however get the error "Network extensions are not available when building for UIKit for Mac." - guessing I will just have to wait and see if this is added after the beta, unless you know of a workaround?
Alas, I haven't touched beta versions yet so don't have any workaround. But maybe it worth to ask Apple support whether they are going to add Network Extension or not.
Hi Sergey,
Just looking at this again as it's been a while, but cannot see the features/fat-libraries any more. Which is the best branch to use for this? Or have you had time to have a look now?
Thanks, Mike
Hi @mchlbowyer,
I merged fat-libraries into master branch so you can try the latest stable version. But I deliberately disabled Mac target for iOS framework in case network extension still not available because I didn't have a chance to check it yet.
Hi @ss-abramchuk,
Thanks for the quick reply. Is it an easy change to enable Mac target?
Cheers, Mike
Just one checkbox in project settings -> OpenVPNAdapter iOS target -> general tab -> deployment info section. You can fork repo and try to switch it back.
I thought it would be more complicated than that...
So I did that, but now getting a build error: "ld: in /iOS-Development/Frameworks/OpenVPNAdapter/Sources/OpenVPNAdapter/Libraries/Vendors/lz4/lib/macos/liblz4.a(lz4.o), building for Mac Catalyst, but linking in object file built for macOS, for architecture x86_64" - will continue investigating unless you know the issue with that one?
Probably, libraries for iOS should be compiled with flag -arch x86_64 in addition to other archs. I'm not sure about tomorrow but I will have some time on Sunday to check it.
Thanks Sergey :) If I manage to sort it before then I will report back.
@ss-abramchuk did you get any time to have a look at this?
Hi @mchlbowyer,
I had a chance to take a look and I don't have good news for now. In order to support Mac Catalyst we need two static libraries compiled for Mac but for different targets. It should be done for every dependency. The problem is these libraries cannot be merged using lipo because both of them will have x86_64 arch. I could use different build conditions for iOS and macOS targets but it would break cocoapods because it doesn't support such configuration.
The solution is to use new framework format xcframework
. All necessary archs can be combined there. The only thing is we have to wait till cocoapods devs update their tool and add support of this format. And hopefully, it won't affect min target version as I still want to support iOS 9.
Hi @ss-abramchuk ,
Is there any possibility of you modifying the library to allow the new cross platform macOS from iOS as seen in the Xcode 11 beta? I tested it last night and get a lot of errors:
"missing required architecture x86_64 in file /OpenVPNAdapter/Sources/OpenVPNAdapter/Libraries/Vendors/mbedtls/lib/ios/libmbedx509.a" and a lot of others similar (Understand the reasoning as it wouldn't include x86_64 for the iOS version, but not sure what changes to make to support it).
Thanks, Mike