Replies: 3 comments 5 replies
-
Hello @gojyuan,
You have truncated the only interesting part: the error message. 🤷♂️ Anyway, I'm not sure GRDB can run on iPad Playgrounds: #467, #1115, maybe other issues (search for iPad, for example). |
Beta Was this translation helpful? Give feedback.
-
Thank you for your fast response. i have attached the full message but it is deceiving about what option was selected - the same error seemed to appear when each of the options was individually selected ie GRDB / GRDB-Dynamic or GRDBSqlite |
Beta Was this translation helpful? Give feedback.
-
O que está acontecendo No iPad, o Swift Playgrounds só aceita targets estáticos, puros Swift e sem dependências nativas extras. O repositório do GRDB oferece três alvos: GRDB, GRDBDynamic e GRDBSQLite. GRDB → estático, usa o SQLite do sistema (o que o Playgrounds consegue lidar melhor). GRDBDynamic → dinâmico (tende a falhar no Playgrounds). GRDBSQLite → compila o SQLite junto (costuma bater nas restrições do Playgrounds). O erro “Swift Package Target GRDB is linked as a static library…” normalmente aparece quando o Playgrounds tenta linkar dois alvos conflitantes (ex.: GRDB + GRDBSQLite) ou quando alguma dependência vira dinâmica. Passo a passo que geralmente resolve no iPad Remova todos os pacotes do projeto no Playgrounds. Feche o app. Reabra o Playgrounds e adicione apenas o pacote do GRDB: Escolha a versão estável (7.6.1 está ok). Selecione somente o target GRDB. Não selecione GRDBDynamic nem GRDBSQLite. Se aparecer “Could not resolve package graph”: Verifique conexão (Wi-Fi/dados) e tente de novo. Abra Ajustes > Playgrounds e limpe cache (se a opção estiver disponível). Como plano B, crie um novo projeto no Playgrounds e repita o passo 2. Evite combinar GRDB com outros wrappers de SQLite (ex.: SQLCipher) no iPad Playgrounds. Teste com um código mínimo:
Se ainda travar no iPad No Mac mini + Xcode, tudo fica mais simples: o SPM resolve melhor e você pode rodar no iPhone/iPad sem precisar de licença (para desenvolver e testar no próprio device você até consegue; a licença é necessária para distribuir/TestFlight/App Store). Como “ponte”, você pode desenvolver no Xcode e só rodar fragmentos no iPad Playgrounds (sem GRDB) — ou usar SwiftData/Core Data temporariamente no iPad até o licenciamento ficar ok. Resumo rápido No iPad Playgrounds: use apenas GRDB (nada de GRDBDynamic/GRDBSQLite). Limpe pacotes e tente resolver o grafo do zero se der erro. Evite dependências que tragam linking dinâmico. Se persistir, faça o setup no Xcode no Mac (mais estável) e continue o app universal normalmente. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
My apologies if this post is too much detail.
I am a programmer with 37 years experience - only 12 months learning Swift. I started with iPAD ( main device ) Swift Playgrounds and wanted my app to run on both iPAD and iPhone. Initial apps were using SwiftData but I had reasonable experience with Sqlite so wanted to upgrade
Purchased MacMini and installed Xcode and GRDB - works very well. Having issues getting a Developer License so had to go back to iPAD Playgrounds.
I cannot import the GRDB Package. Have tried with different versions 7.6.1 being the latest. Sometimes I get the message - Could not resolve package graph. Cannot continue.
Then sometimes Three options are presented - GRDB, GRDB-Dynamic and GRDBSqlite. I have tried each option separately and also combined ( with GRDBSqlite) and get message —Swift Package Target GRDB is linked as a static library…—
I am running the latest releases on both MacOS and iPadOS.
Any help much appreciated
Regards
Linda
Beta Was this translation helpful? Give feedback.
All reactions