ios – Swift Package deal Supervisor failing after updating to Xcode 14

[ad_1]

I’ve a perform referred to as .readSize that, in SwiftUI, permits a baby View to report its dimension to its father or mother View. The perform is included in an extension to the View struct. Earlier than upgrading to Xcode 14 this bundle was working. Now, at Xcode 14.0.1, it doesn’t work. Xcode merely tells me that Textual content has no member .readSize. After I test, the Mission Navigator is exhibiting the bundle and I can open the module containing .readSize.

(The logic for reporting little one dimension is taken from the 5 Stars weblog).

After I click on on the challenge within the Mission Navigator, click on on the Mission discipline and click on the “Package deal Dependencies” tab then the “packages” part is empty. If I faucet on the “+” image then Xcode presents a popover with an “Add Native” button. Clicking that can permit me to seek out the bundle and add it. That course of, nevertheless, merely duplicates the bundle within the Mission Navigator. Within the Package deal Dependencies tab the “packages” part remains to be empty.

I’ve tried among the commonplace cleanup approaches, comparable to eradicating the bundle, performing a clear, restarting Xcode, after which re-introducing the bundle with File -> Add Packages. I get the identical error.

At a guess, it might be that my bundle is not outlined property. The manifest reads as follows:

// swift-tools-version:5.5
// The swift-tools-version declares the minimal model of Swift required to construct this bundle.

import PackageDescription

let bundle = Package deal(
    title: "ViewExtensions",
    platforms: [.iOS("13.0")],
    merchandise: [
        // Products define the executables and libraries a package produces, and make them visible to other packages.
        .library(
            name: "ViewExtensions",
            targets: ["ViewExtensions"]),
    ],
    dependencies: [
        // Dependencies declare other packages that this package depends on.
        // .package(url: /* package url */, from: "1.0.0"),
    ],
    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 this package depends on.
        .target(
            name: "ViewExtensions",
            dependencies: []),
        .testTarget(
            title: "ViewExtensionsTests",
            dependencies: ["ViewExtensions"]),
    ]
)

I am at a standstill. Is there some strategy to debug why Xcode is not going to permit me so as to add my bundle below Package deal Dependencies?

[ad_2]

Leave a Reply