@endres How would you load the container to context from a Bundle though? I do see you can load the object that way
Post
Replies
Boosts
Views
Activity
This is the same issue I’m having here:
https://developer.apple.com/forums/thread/651258
will watch this thread
Ok, so doing so, I'm able to distribute the binaryTarget, I can now find it in the source file but im not able to use anything from the framework
Its saying "Cannot find type "Something" in scope
// This file is in the Sources/SamplePackage/Sample.swift
import SampleFramework
// ^^ Was giving Error Module not found: Resolved
struct Model {
var something: Something // Something is a model in the SampleFramework.xcFramework
		// ERROR: Cannot find type "Something" in scope
}
import PackageDescription
let package = Package(
name: "SamplePackage",
platforms: [
.iOS(.v13),
.macOS(.v10_14)
],
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "SamplePackage",
targets: ["SamplePackage", "SampleXCFramework"]),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "SamplePackage",
dependencies: [
"SampleXCFramework"
]),
.testTarget(
name: "SamplePackageTests",
dependencies: ["SamplePackage"]),
.binaryTarget(
name: "SampleXCFramework",
path: "SampleFramework.xcframework")
]
)
The issue was that the .xcFramework needed to be at the root level of the Package!
| - | Sources
| - | Tests
| - | framework.xcframework
.
.
.target(
name: "Sample"),
.testTarget(
name: "SampleTests",
dependencies: ["Sample"]),
.binaryTarget(
name: "SampleFramework",
path: "framework.xcframework")
]
.
.