defold / extender

Native extension build server
https://defold.com/manuals/extensions/
MIT License
44 stars 19 forks source link

Crash on iOS 11.8 #466

Open AGulev opened 1 year ago

AGulev commented 1 year ago

dyld: Library not loaded: @rpath/libswiftCore.dylib

it seems like cocoapods should take into account ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES

britzl commented 1 year ago

This is an Xcode build setting right? Do you know what that means in terms of actual impact on the compile or link step?

AGulev commented 1 year ago

@britzl I think so. I tried to build plugin in xcode to check, but I failed (I'm writing it and understand that it's easier to build empty project with and without this checkbox and compere). As I understand, this flag includes swift libs as dynamic libs into build: https://stackoverflow.com/questions/26024100/dyld-library-not-loaded-rpath-libswiftcore-dylib

I'm not sure if it's something specified in a pod file somewhere or developer should decide himself.

AGulev commented 1 year ago

One more useful link https://stackoverflow.com/questions/63859267/please-explain-the-purpose-of-always-embed-swift-standard-libraries

https://stackoverflow.com/questions/55364816/with-swift-5-and-ios-12-2-should-i-change-always-embed-swift-standard-librarie

Note that the libraries are stripped out only if you are building against the 12.2 SDK and going onto a machine with 12.2 (or later). The libraries are still needed to run on a 12.1 or earlier machine.

AGulev commented 1 year ago

@britzl here I found how it may be specified in pods file (this looks like a workaround, but maybe it will be useful): https://www.devsbedevin.net/cocoapods-always-embed-swift-standard-libraries/

britzl commented 1 year ago

Sure, but that sets a config value for Xcode. We need to figure out how to do the same thing without Xcode. And also how an extension should specify that it is needed (probably in the ext.manifest).

AGulev commented 1 year ago

@britzl it seems like it depends on target ios version + using or not using swift code in framework

ekharkunov commented 5 months ago

https://developer.apple.com/documentation/xcode-release-notes/swift-5-release-notes-for-xcode-10_2#New-Features @AGulev @britzl Swift binaries should be copied and signed if you want to deploy at iOS less than 12.2. Inside my extensions I added swift libraries manually. And add custom 'rpath' option to linker's flags via ext.manifest. But when application was uploaded to AppStore seems like swift libraries didn't strip from the bundle for newer ios version.

AGulev commented 1 month ago

I agree with @ekharkunov . It seems liek we need to include it automatically if MIN ios version less than 12.2 @britzl should we move it into https://github.com/defold/extender repository?

AGulev commented 1 month ago

The issue moved from https://github.com/defold/extension-ironsource