O arquivo MeuLabWatch/Services/WatchSecrets.swift foi criado, mas não está registrado no projeto Xcode (project.pbxproj).
Erro de compilação:
Cannot find 'WatchSecrets' in scope
open MeuLabApp.xcodeprojNo Xcode:
-
Menu: File → Add Files to "MeuLabApp"
- Ou: Cmd ⌘ + Option ⌥ + A
-
Navegue até:
MeuLabWatch/Services/WatchSecrets.swift -
Marque as checkboxes:
- ☑ Copy items if needed (NÃO marque - arquivo já está lá)
- ☑ Create groups (Sim, para manter estrutura)
-
Adicione aos targets:
- ☑ MeuLabWatch (IMPORTANTE!)
- ☐ MeuLabApp (deixe desmarcado)
- ☐ MeuLabWidgets (deixe desmarcado)
-
Clique:
Add
xcodebuild clean -scheme MeuLabWatch
xcodebuild build -scheme MeuLabWatchResultado esperado: ✅ Sem erros
# No terminal:
grep "WatchSecrets.swift" MeuLabApp.xcodeproj/project.pbxprojDeve retornar uma ou mais linhas com "WatchSecrets.swift"
- Arquivo
MeuLabWatch/Services/WatchSecrets.swiftvisível no Xcode Navigator - Target Membership: ✅ MeuLabWatch
- Projeto compila sem erros
- Console mostra:
🔐 watchOS Secrets: Token configured = true
Próximo: After adding file, rebuild and copy Secrets.plist to project root.