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

apollo-ios-xcframework fails to build #3439

Closed
CraigSiemens opened this issue Sep 11, 2024 · 7 comments · Fixed by apollographql/apollo-ios-xcframework#19
Closed

apollo-ios-xcframework fails to build #3439

CraigSiemens opened this issue Sep 11, 2024 · 7 comments · Fixed by apollographql/apollo-ios-xcframework#19
Labels
bug Generally incorrect behavior needs investigation

Comments

@CraigSiemens
Copy link
Contributor

CraigSiemens commented Sep 11, 2024

Summary

It appears that the apollo-ios-xcframework repo no longer contains any shared or generated schemes causing carthage to be unable to build.

Related to #3308

Version

Tried with the latest version 1.15.1. Possibly occurs on older versions, we're very slow to update 🐢.

Steps to reproduce the behavior

pushd "$(mktemp -d)" || exit
echo 'github "apollographql/apollo-ios-xcframework"' > Cartfile
carthage bootstrap
popd || exit

Logs

*** No Cartfile.resolved found, updating dependencies
*** Fetching apollo-ios-xcframework
*** Checking out apollo-ios-xcframework at "1.15.1"
*** xcodebuild output can be found in /var/folders/_x/0yf9v78x1zzfd4pk03vx7f440000gq/T/carthage-xcodebuild.JiLsUV.log
*** Skipped building apollo-ios-xcframework due to the error:
Dependency "apollo-ios-xcframework" has no shared framework schemes

If you believe this to be an error, please file an issue with the maintainers at https://github.com/apollographql/apollo-ios-xcframework/issues/new

Anything else?

Also, I tried manually calling the makefile to build the frameworks but that also results in an error since it appears the iphoneos.xcarchive doesn't contain a framework.

make build-apollo-xc-framework
xcodebuild -create-xcframework -output ./build/Apollo.xcframework -framework ./build/iphonesimulator.xcarchive/Products/Library/Frameworks/Apollo.framework -framework ./build/iphoneos.xcarchive/Products/Library/Frameworks/Apollo.framework
error: the path does not point to a valid framework: .../Carthage/Checkouts/apollo-ios-xcframework/build/iphoneos.xcarchive/Products/Library/Frameworks/Apollo.framework
make: *** [build-apollo-xc-framework] Error 70

I think it's also caused by there being no shared schemes. If I manually create a new scheme in the project, it shows the project targets and the package targets.

out

I'd guess the xcodebuild command picks the package target when specifying -scheme Apollo and building for iOS. After manually creating the schemes, it produces the xcframeworks.

@CraigSiemens CraigSiemens added bug Generally incorrect behavior needs investigation labels Sep 11, 2024
@CraigSiemens CraigSiemens changed the title apollo-ios-xcframework fails to build with carthage apollo-ios-xcframework fails to build Sep 11, 2024
@BobaFetters
Copy link
Member

@CraigSiemens thanks for the detailed report, I'll have a look at this so we can get it fixed.

@BobaFetters
Copy link
Member

Looked into this briefly so far, it looks like the schemes available in the project are shared, and there are targets for the package products but not actually schemes, so I'm not positive the schemes are the root issue here.

I did notice when running make build-apollo-xc-framework I saw the same error you reported and it looks like the Library/Frameworks/Apollo.framework is missing from the iphoneos build for some reason, however if i individually run the 3 xcodebuild commands from the make command in succession everything works as expected and the Library/Frameworks/Apollo.framework does exist as it should. Wondering if theres something with the make command somehow causing the issue.

Will look into this some more soon to see if I can narrow it down further.

@CraigSiemens
Copy link
Contributor Author

Looked into this briefly so far, it looks like the schemes available in the project are shared, and there are targets for the package products but not actually schemes, so I'm not positive the schemes are the root issue here.

Since the schemes are missing from Apollo.xcodeproj/xcshareddata/xcschemes maybe they're ignored by git? A fresh clone for me only shows the scheme Apollo-Workspace.

@BobaFetters
Copy link
Member

Hmmm I can check that, although the Apollo-Workspace scheme is only in the workspace, and all the other schemes are in the Apollo.xcodeproj, but if Carthage is running off the workspace I guess that could explain that issue but not the issue with the make command, or why we are just now seeing the issue.

@BobaFetters
Copy link
Member

@CraigSiemens So I was playing around with this, turned off the option in Tuist that was disable the auto-generation of schemes and regenerated the project/workspace and the make command started working as expected again. I have a pull request up with for the potential fix, would you be able to point to that branch and see if it solves your Carthage issue?

apollographql/apollo-ios-xcframework#19

@CraigSiemens
Copy link
Contributor Author

Yeah, I'll try it out.

Copy link
Contributor

Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Generally incorrect behavior needs investigation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants