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
Xcode 8b3: ABI Mismatch when copying Swift dylibs #1394
Comments
I'm having this same issue, which is being tracked as rdar://27434450. |
Does |
@mdiep Yes. |
Have you tried deleting |
I have, yes-- both. I reproduced it on a brand new, blank project as well (see above). I was able to get it working by using '--no-build' and integrating directly. |
I'm also having this issue. @maxmeyers I tried your sample project and it works fine. It seems you haven't added SnapKit.framework in "Linked Frameworks and Libraries" but after I added it "Copy Swift standard libraries" phase starts failing. |
It seems to be an issue of Xcode. If you copy all the swift frameworks files into your project and then create a new build phase The files are located here:
I just created a folder/group called It is a pretty dirty workaround. Guess this bug will be fixed soon as some posts are also existing in the apple dev forums. In addition: if running your app in the simulator, you can clearly see the missing or wrongly copied files in the container of the simulator. Maybe this helps one. |
@jsslai thanks for letting me know (oops!). I updated the sample project. |
I have made a CLEAN WORKAROUND script solution which works for iPhone: You just add it as another Build Phase Script. So it seems that Xcode 8 Beta 3 uses this command to copy the swift libs: builtin-swiftStdLibTool. So I just reverse engineered how it builds the script up out of the environment variables and with some BASH-FU help from my colleagues we got it to use the Input File Params so you can specify your Frameworks the same way you would with a Carthage Copy Frameworks script. I cannot get it to work with watchOS, but I need to leave the office if someone can work it out that would be AMAZING! 👍 Please let me know if you get it working on watchOS! |
If anyone has any experience with my above script can they comment i'd love to know if its working and if anyone has figured out a solution to watchOS as i'm about to embark on that journey now. |
@madhavajay I tried it and after some trials and errors I got it working. I had to change Xcode to Xcode-beta in script. I also thought the script would replace Carthage's copy-frameworks phase but I had to leave it and add your script. |
Yeah sorry about that, I updated the script to use the TOOLCHAIN environment variable so it should work out of the box now. No it doesn't replace Carthage this is for scanning all the frameworks and collecting the necessary swift libs to embed in the app binary. Fun fact every Swift app has a copy of every needed Swift lib to maintain compatibility. |
I have updated the GIST with instructions for watchOS! 😎 |
In my case, I'm using Carthage to build realm framework, everything works fine until upgrade to xcode 8b4, and crashed on libswiftAVFoundation.dylib image not found. after using the script from @madhavajay, and add realm frameworks to input files, everything works again, thank you @madhavajay |
It seems this problem has persisted with Xcode 8 Beta 4. My radar from last Beta was marked dupe so I guess its a known issue but not fixed? |
Tried @madhavajay 's script, but it's not working for me. I'm getting the following when I run the app in the simulator. Any idea what might be wrong?
|
I would suggest right click and copying the entire output of the build process for each target into a text editor, then going through looking for errors or warnings / issues, that might help locate the problem. This is how I found the issue for the swift lib tool which my fix addresses. |
@madhavajay's modification of the build phase script got the project compiling for me but iTunes Connect is rejecting submissions citing "Invalid Swift Support" because the top level "SwiftSupport" directory in the built product is empty. We've given up on letting Carthage do anything build related and are now using it solely for submodule management. |
@hyperspacemark interesting. We tried submitting today and got lots of "wrong" provisioning profile errors and Bitcode errors crashing Xcode. I might try pulling carthage out of the equation and seeing if that resolves it. Are you using Cocoapods then or just manually adding the frameworks to the project? On a related note has anyone tried SPM, Carthage is really giving me the SH*%s. |
Adding framework projects as subprojects and embedding/linking them manually. |
That sucks.... GitHub doesnt have enough emoticons for that. 😭 |
I've lodged a bug report and Apple's marked it as a duplicate. Everyone should log one as well so Apple gets the messages that it needs immediate attention. At the moment (for me) this is a show stopper, causing me to have to go back to XCode 7.3.1 |
How are you embedding your Carthage frameworks if I drag them into the Embedded Binaries section it has this issue. But if you follow the If you're building for iOS, tvOS, or watchOS section in the readme skipping step 3 and don't drag them into Embedded Binaries or into Linked Frameworks and Libraries just add the run script from the readme and do a clean build it works. So maybe try removing all the Carthage frameworks from the project and remove @madhavajay's script then only add the run script from the readme. Also if you have UI Tests or Unit Tests I had to use the same run script in those. |
@chandlerhuff I can't confirm that. I'm using Xcode 8b5 and I exactly followed the mentioned Readme section, but I still get the error |
@ffittschen try skipping step 3 of the readme and removing the Carthage frameworks form Linked Frameworks and Libraries and removing references to the frameworks from the project navigator and only have the build script and do a clean build. |
I've always used copy-frameworks. Embedded binaries is a relatively new thing. With the script I started getting a whole problem. Something to do with var args (See reveal posts above). Anyway, until Apple fix this issue, I'll have to start away from the betas. |
I had the same problem in my framework test targets. Keeping step 3 works for me as @chandlerhuff suggested |
For anyone watching this: - XCode 8.0 Beta 6 appears to have fixed the bug. Therefore the above scripts are no longer required. Thank you to the guys who took the time developed them. |
So this should be fixed in the official Xcode 8.0 release. Closing. |
…w cause Xcode crash on App Store upload). See: Carthage/Carthage#1394 (comment)
…w cause Xcode crash on App Store upload). See: Carthage/Carthage#1394 (comment)
carthage version
: 0.17.2xcodebuild -version
: Xcode 8.0 Build version 8S174q--no-build
? No--no-use-binaries
? No--use-submodules
? NoCartfile
Carthage Output
During the
CopySwiftLibs
build phase, I see the following output. It results in theFrameworks
folder being empty (exceptSnapKit.framework
, of course).It seems like it's looking for Swift dylibs with all four architectures and can't find one. When I remove
SnapKit.framework
from the linked libraries, I get the following (correct) result:I have the
ONLY_ACTIVE_ARCH
flag set toYES
(this is a debug build).I'm not sure what the solution is, and perhaps this is just a bug with Beta 3.
Here's a sample project that reproduces the issue:
Swiftlibsd.zipHere's the corrected example:
Swiftlibsd.zip
The text was updated successfully, but these errors were encountered: