[Technical Questions] #16
-
In what area do you have a technical challenge?Xcode, Simulator & Previews DescriptionUnable to add library with my views to Xcode project ReproductionI went to CS342Application and selected add frameworks or libraries. There was no option that include the folder I added in Xcode, so I selected Add Other>Add Files and selected my folder CS342MemberViews>Sources>Alexis. However, the library still did not add. I've been following along with the lecture video and this issue didn't arise there, so I'm not sure how to fix this. I've already added my target information in the Package file.
Expected behaviorI'm able to add my library and build without errors Additional contextI'm currently getting 4 errors: Missing package product 'OliverAalami'
Code of Conduct
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Hi Alexis, I would start by following these steps to try and clear out the issues you're seeing:
Let us know if this helps. |
Beta Was this translation helpful? Give feedback.
-
Thank you for posting your question! I have taken a look at your problem and your current state at feature/alexis.
While it is generally not an easy error message to understand, it is most often related to the fact that the Swift Package Manager can not create a public interface for your target. .target(
name: "AlexisLowber",
dependencies: [
.target(name: "InstructorViews")
],
exclude: [
"Resources/AlexisLowber.jpeg.license",
"Resources/AlexisLowber.md.license"
],
resources: [
.process("Resources")
]
) You can therefore fix your error if you move the To make the view accessible outside of the package, you will then have to declare it public using the public struct AlexisLowber: View {
public var body: some View {
// ...
}
public init() { }
} In general also advise going through these steps here to resolve to build errors in Xcode: https://github.com/orgs/CS342/discussions/6#discussioncomment-4742407 . If you run into any other issues we would recommend going through these steps. Let us know if this resolves your issue, and then mark this message as an answer or let us know about any follow-up questions! |
Beta Was this translation helpful? Give feedback.
@lowbaj21,
Thank you for posting your question!
I have taken a look at your problem and your current state at feature/alexis.
You get the following error message when asking Xcode to build your project:
While it is generally not an easy error message to understand, it is most often related to the fact that the Swift Package Manager can not create a public interface for your target.
In your case, this is related to the fact that you do not have a Swift file in your target. You only have a few resources in the Resources folder as well as the
AlexisLowberView.swift
file in the Resources fo…