-
Notifications
You must be signed in to change notification settings - Fork 743
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
Swift Scripting: error: unknown package 'Apollo' in dependencies of target 'Codegen' #1102
Comments
OK so I can see from the screenshots you fixed my first thought, which is that you need to be on It won't work with 11.3.1 unless you're explicitly using the Swift 5.2 toolchain, since the As far as I can tell, you've got things set up here mostly the same way I've got them in the SwiftScripts project's I would try the obvious solutions (clean build, Derived Data Dance (quit xcode, delete derived data, reopen xcode, rebuild)). If none of that works let me know, I'll poke it some more. |
Hi @designatednerd, I'm having the same problem, I tried the suggested "Derived Data Dance" but it still shows the same error :( |
|
@designatednerd |
Hi @designatednerd, sorry for the late feedback and thanks for the quick reply on your side! I tried doing the cleanups you suggested, but no luck. When pulling On a sidenote, when I was on Xcode 11.3.1 I was indeed trying it with |
@designatednerd, @ordazgustavo it seems I figured it out after trying something rather obvious. 😬🎉 Apparently the problem is that the Package Name is not being automatically identified by the SPM and you have to add it manually. So, this worked: I tried a number of combinations successfully after that, so all of these ran without problems for me: .package(name: "Apollo", url: "https://github.com/apollographql/apollo-ios.git", from: "0.23.0"), .package(name: "Apollo", url: "https://github.com/apollographql/apollo-ios.git", .exact("0.23.0")), .package(name: "Apollo", url: "https://github.com/apollographql/apollo-ios.git", from: "0.24.0"), .package(name: "Apollo", url: "https://github.com/apollographql/apollo-ios.git", .exact("0.24.0")), .package(name: "Apollo", url: "https://github.com/apollographql/apollo-ios.git", .branch("master")), Sidenote for the unaware: .package(name: "Apollo", url: "https://github.com/apollographql/apollo-ios.git", .exact("0.22.0")), But this works, as it ends up pulling .package(name: "Apollo", url: "https://github.com/apollographql/apollo-ios.git", from: "0.22.0"), Quick question to @designatednerd: would you like me to open a PR updating the docs? Cheers and thanks again! |
Hi @designatednerd!
First of all, thanks for the great effort on this script. It's really great to have someone looking into how to improve the existing process and making it better.
I'm not sure what may be up as I'm relatively new to Swift and Xcode development in general, but there's a problem when doing the setup described in the docs that is really cryptic as I can't find much about it somewhere else.
As for the setup, I'm currently on Xcode Version 11.4 (11E146) and therefore
swift-tools
5.2.When getting to the step 4 in the process (Update the dependencies section to grab the Apollo iOS library), I get the following message on the sidebar:
Showing All Messages: dependency 'Apollo' is not used by any target
Okay, makes sense, since I didn't add the target dependency yet. So I go ahead and do it. But then, immediately after adding it, I get the following:
unknown package 'Apollo' in dependencies of target 'Codegen'
My Package.swift currently looks like this:
As a sidenote, if I comment the dependency out, Xcode downloads the package from github and adds the deps to the sidebar, like here:
But when I add it:
I'm afraid I'm missing something rather simple, but then again, I couldn't get the process to work on Xcode 11.3.1 either as it was showing a similar error. I thought updating it would give me better chances, but no luck.
Do you think you have any tips on this?
Thanks again for the help! Cheers
The text was updated successfully, but these errors were encountered: