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

Adding a reference to Xamarin.iOS.SwiftRuntimeSupport breaks build #1198

Open
jkandiko opened this issue Jun 7, 2021 · 12 comments
Open

Adding a reference to Xamarin.iOS.SwiftRuntimeSupport breaks build #1198

jkandiko opened this issue Jun 7, 2021 · 12 comments

Comments

@jkandiko
Copy link

jkandiko commented Jun 7, 2021

Create a new Xamarin forms project. Build and deploy it to iOS 14.5. Everything works. Add the Nuget package Xamarin.iOS.SwiftRuntimeSupport and I receive the following error:

Error The command "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk/../../../../../Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-stdlib-tool --copy --verbose --sign 'XXXXXX' --scan-executable 'bin/iPhone/Debug/device-builds/iphone12.1-14.6/App8.iOS.app/App8.iOS' --scan-folder 'bin/iPhone/Debug/device-builds/iphone12.1-14.6/App8.iOS.app/Frameworks/' --scan-folder 'bin/iPhone/Debug/device-builds/iphone12.1-14.6/App8.iOS.app/PlugIns/' --platform 'iphoneos' --toolchain '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk/../../../../../Toolchains/XcodeDefault.xctoolchain/' --destination 'bin/iPhone/Debug/device-builds/iphone12.1-14.6/App8.iOS.app/Frameworks/' --resource-destination 'bin/iPhone/Debug/device-builds/iphone12.1-14.6/App8.iOS.app/' --resource-library libswiftRemoteMirror.dylib --unsigned-destination 'obj/iPhone/Debug/device-builds/iphone12.1-14.6/SwiftSupport' --strip-bitcode --strip-bitcode-tool '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk/../../../../../Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip' --emit-dependency-info 'obj/iPhone/Debug/device-builds/iphone12.1-14.6/SwiftStdLibToolInputDependencies.dep' --source-libraries '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk/../../../../../Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos'" exited with code 255. App8.iOS C:\Users\xxx.nuget\packages\xamarin.ios.swiftruntimesupport\0.2.0\buildTransitive\Xamarin.iOS.SwiftRuntimeSupport.targets 19

How do I investigate what code 255 is? If I remove the package, everything builds and deploys normally.

@tompi
Copy link

tompi commented Jun 21, 2021

Not sure if its the same problem, but this package has been giving me grief as well lately...
Whenever I try to Archive for publishing, I get the error "ditto exited with code 1" and this in the log:

Target _SRSCopySwiftSupport:
    Copying SwiftSupport folder from obj/Release/SwiftSupport to /SwiftSupport folder.
    /usr/bin/ditto obj/Release/SwiftSupport /SwiftSupport 
    ditto: Cannot get the real path for source 'obj/Release/SwiftSupport'
    /Users/tompi/.nuget/packages/xamarin.ios.swiftruntimesupport/0.2.0/buildTransitive/Xamarin.iOS.SwiftRuntimeSupport.targets(25,9): error MSB6006: "ditto" exited with code 1.

@mrrenaud
Copy link

mrrenaud commented Sep 15, 2022

Not sure if its the same problem, but this package has been giving me grief as well lately... Whenever I try to Archive for publishing, I get the error "ditto exited with code 1" and this in the log:

Target _SRSCopySwiftSupport:
    Copying SwiftSupport folder from obj/Release/SwiftSupport to /SwiftSupport folder.
    /usr/bin/ditto obj/Release/SwiftSupport /SwiftSupport 
    ditto: Cannot get the real path for source 'obj/Release/SwiftSupport'
    /Users/tompi/.nuget/packages/xamarin.ios.swiftruntimesupport/0.2.0/buildTransitive/Xamarin.iOS.SwiftRuntimeSupport.targets(25,9): error MSB6006: "ditto" exited with code 1.

Having the same issue here with version 0.2.1.

@tompi did you find a solution?

@Totonti
Copy link

Totonti commented Nov 22, 2022

Hi,
Having the same issue here with version 0.2.1.

  • Visual studio Mac 17.4 build 2406
  • Xcode 14.1
  • Xamarin.ios 16.0.0.72
  • Xamarin.iOS.swiftruntimesupport 0.2.1

please, has anyone found a solution?

@NikolayGenov
Copy link

@tompi @Totonti @mrrenaud Have you found a workaround for that?

@albertb22
Copy link
Contributor

Does anyone found a solution?

@rolfbjarne
Copy link
Member

rolfbjarne commented Jan 11, 2024

Adding this to your csproj might fix it:

<Target Name="_SRSCopySwiftSupport" />

Note that you'll also have to make sure the min iOS version (the SupportedOSPlatformVersion property in the csproj) is at least 12.2.

@albertb22
Copy link
Contributor

I think I fixed this in PR #1431

@WanftMoon
Copy link

WanftMoon commented Jan 26, 2024

Issue present in MacOS sonoma with the latest VS and xcode 15

  Target _SRSCopySwiftSupport:
        Copying SwiftSupport folder from obj/Release/xamarin.ios10/SwiftSupport to /SwiftSupport folder.
        /usr/bin/ditto /obj/Release/xamarin.ios10/SwiftSupport /SwiftSupport 
        ditto: Cannot get the real path for source 'obj/Release/xamarin.ios10/SwiftSupport'
        /.nuget/packages/xamarin.ios.swiftruntimesupport/0.2.1/buildTransitive/Xamarin.iOS.SwiftRuntimeSupport.targets(25,9): error MSB6006: "ditto" exited with code 1.

@tompi @Totonti @mrrenaud @rolfbjarne

any insights on this? (the path obj/Release/xamarin.ios10/SwiftSupport doesn't really exists) and i've looked in all obj/ in the solution

@albertb22 Any idea when Xamarin.iOS.swiftruntimesupport 0.2.2 will be available?

@rolfbjarne
Copy link
Member

@WanftMoon did you try the workaround here: #1198 (comment)?

@WanftMoon
Copy link

@WanftMoon did you try the workaround here: #1198 (comment)?

Yeah, tried in the native binding, then the lib wrapping the native binding and then in the iOS project, then tried all of the 3.

@WanftMoon
Copy link

@WanftMoon did you try the workaround here: #1198 (comment)?

@rolfbjarne Got it working!!

I had the swift package in the native bidings, so i just removed from it and added it to the target iOS project. Then VSMac finally got to archive it.

But if I may question, the <Target Name="_SRSCopySwiftSupport" /> will not copy the swift libs. Is there any point in adding the Xamarin.iOS.swiftruntimesupport nuget after iOS 12.2, or still needed for the build?

@rolfbjarne
Copy link
Member

Is there any point in adding the Xamarin.iOS.swiftruntimesupport nuget after iOS 12.2, or still needed for the build?

It looks like it's not needed if you set the deployment target to at least iOS 12.2, but I might be wrong. Note that you might also get the reference through another NuGet package, so it might not be that easy to remove the reference.

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

8 participants