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

Cannot find type 'PhoneNumberTextField' in scope & SPM wrong version #778

Closed
soiferman opened this issue Jun 10, 2024 · 1 comment
Closed
Labels

Comments

@soiferman
Copy link

The issue is "Cannot find type 'PhoneNumberTextField' in scope" in ViewController and PhoneNumbeKit version in SPM

When I add a library via spm, it says that version is 2.6.0
Screenshot 2024-06-09 at 19 48 21
but the documentation says that you need to specify 3.7.0, If I manually set 3.7.0, then error occurred -> PhoneNumberKit could not be resolved.

In the next page, specify the version resolving rule as "Up to Next Major" from "3.7.0"

Screenshot 2024-06-10 at 09 03 58

I could continue using 2.6.0, but the project won't build due to the error "Cannot find type 'PhoneNumberTextField' in scope" in ViewController. The issue appeared after I cleaned the project (cmd + k)

After watching Package.json, i noticed that in 2.6.0 there is "exclude: ["UI"]" line, which probably explains my mistake, but anyhow it worked before cleaning

package import PackageDescription

let package = Package(
    name: "PhoneNumberKit",
    products: [
        .library(name: "PhoneNumberKit", targets: ["PhoneNumberKit"])
    ],
    targets: [
        .target(name: "PhoneNumberKit", path: "PhoneNumberKit", exclude: ["UI"]),
        .testTarget(name: "PhoneNumberKitTests", dependencies: ["PhoneNumberKit"], path: "PhoneNumberKitTests")
    ])

I also noticed that there used to be PhoneNumberKit-Dynamic and PhoneNumberKit-Static link, now its not.

Screenshot 2024-06-09 at 20 02 24

Tried to create a new project - same problem
Tried to delete "Package.resolved" at /Name.xcodeproj/project.xcworkspace/xcshareddata/swiftpm - doesn't help

Environment

Xcode - Version 15.4 (15F31d)

Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant