Open Mozahler opened 1 year ago
Can you provide us a project to reproduce the issue? (a zip archive of your project for example) I'm using the package in my apps and I don't have any problem with previews.
Thanks for responding. Let me see if I can figure it out then. I appreciate you taking the time. I'll close it with a solution as soon as I can.
I was able to create an ultra simple project which demonstrates the problem. Thursday.zip
It just prints out the name of the DB connection in a Text. Runs fine on the simulator, but ContentViewX
will not preview from the package.
First of all: I don't believe this is an error in SQLite.swift package, but I'm hoping someone has solved this problem.
I'm getting
when I try to use previews. I don't run into this problem in the main module, but when the view is in a local package imported by my app.
I imagine that you (or Stephen) have run into this problem when using previews (I see he makes heavy use of them in his point free episodes), and trust that one of you knows how to make the compiler happy. I have posted this question on StackOverflow, but all I got is downvoted :(
Xcode Previews fail with: "missing required module 'SQLiteObjc'"
An issue was recently fixed for Carthage installs:
https://github.com/stephencelis/SQLite.swift/issues/1150
One suggestion I found was to try adding: ${SRCROOT}/SQLiteObjc to the Swift Compiler Search Paths but that didn't help.
my Package.swift contains:
which resolves to 0.13.3
This problem occurs on an M1 MacBookPro running Monterey 12.5.1/Xcode 13.4.1 as well as Monterey 12.6 using (just released) Xcode 14. The app compiles without errors and runs fine. I just can't view previews.
When I compiled this morning, the missing SQLiteObjc message did not appear. Again 🤷🏻
Monterey 12.5.1
no such file or directory: '/Users/xxx/Library/Developer/Xcode/DerivedData/Tasklist-abrktmwcewhompgocivntszewxla/Build/Intermediates.noindex/Previews/Tasklist/Products/Debug-iphonesimulator/PackageFrameworks/TasksSQLite_584AE96A3AF58A43_PackageProduct.framework/TasksSQLite_584AE96A3AF58A43_PackageProduct'
LinkDylibError: Failed to build PrimaryPage.swift
Linking failed: no such file or directory: '/Users/xxx/Library/Developer/Xcode/DerivedData/Tasklist-abrktmwcewhompgocivntszewxla/Build/Intermediates.noindex/Previews/Tasklist/Products/Debug-iphonesimulator/PackageFrameworks/TasksSQLite_584AE96A3AF58A43_PackageProduct.framework/TasksSQLite_584AE96A3AF58A43_PackageProduct'
clang: error: no such file or directory: '/Users/xxx/Library/Developer/Xcode/DerivedData/Tasklist-abrktmwcewhompgocivntszewxla/Build/Intermediates.noindex/Previews/Tasklist/Products/Debug-iphonesimulator/PackageFrameworks/TasksSQLite_584AE96A3AF58A43_PackageProduct.framework/TasksSQLite_584AE96A3AF58A43_PackageProduct'
Edit:
I just cleaned the build folder again, and the error came back up:
\:0: error: missing required module 'SQLiteObjc'
missing required module 'SQLiteObjc'
SchemeBuildError: Failed to build the scheme "Tasklist"
missing required module 'SQLiteObjc'
Compile TasklistApp.swift (arm64):