CapacitorWatch icon indicating copy to clipboard operation
CapacitorWatch copied to clipboard

Cannot find 'CapWatchContentView' in scope

Open jacobglowdev opened this issue 4 months ago • 20 comments

I've followed the documentation up to step 7, my watchOS.swift file currently looks like this:

import SwiftUI
import WatchConnectivity

@main
struct watchOS_Watch_AppApp: App {
    var body: some Scene {
        WindowGroup {
            CapWatchContentView()
                .onAppear {
                    assert(WCSession.isSupported(), "This sample requires Watch Connectivity support!")
                    WCSession.default.delegate = WatchViewModel.shared
                    WCSession.default.activate()
                }
        }
    }
}

I'm receiving the error: Cannot find 'CapWatchContentView' in scope

I can confirm the capacitor/watch plugin exists in my package.json file. The only other thing I can think of that may (or may not) be relevant is that after I added the Capacitor Watch Swift Package from node modules, its name reads as iOS-capWatch-watch instead of CapWatch-Watch-SPM.

I have tried adding import CapacitorWatch above the @main statement, but this also throws the No such module 'CapacitorWatch' error.

jacobglowdev avatar Feb 21 '24 16:02 jacobglowdev