Post

Replies

Boosts

Views

Activity

Reply to How to use a local .xcFramework as a Resource of a Swift Package
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")         ] )
Jun ’20
Reply to Local xcFrameworks in Swift Packages
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")    ] . .
Jun ’20