I made a widget using new and shiny WidgetKit. It looks good and working as expected. Then I put all its logic into separate framework to share constant values between extension and main app as well as to provide a unit-testable target. And after introducing a framework SwiftUI previews stopped working. I'm getting error: Cannot preview in this file - Could not find host for previews. It seems that WidgetPreviewContext is not working. I'm wondering why. Could it be because I'm on macOS Catalina 10.15.6?
WidgetPreviewContext is not working in a framework
1.2k Views Asked by Artem Kirillov At
1
There are 1 best solutions below
Related Questions in IOS
- Overlapping UICollectionView in storyboard
- Cannot pod spec lint because of undeclared type errors
- Is the transactionReceipt data present in dataWithContentsOfURL?
- UIWebView Screen Fitting Issue
- ZXingObjC encoding issues
- iOS: None of the valid provisioning profiles allowed the specific entitlements
- How to hide "Now playing url" in control center
- CloudKit: Preventing Duplicate Records
- Slow performance on ipad erasing image
- Swift code with multiple NSDateFormatter - optimization
- iOS 8.3 Safari crashes on input type=file
- TTTTimeIntervalFormatter always returns strings in English
- How do I add multiple in app purchases in Swift Spritekit?
- Setup code for xibs in iOS. -awakFromNb:
- iOS Voice Over only reads out the title of any alert views
Related Questions in SWIFTUI
- Ternary operator inside NavigationLink SwiftUI
- Use ViewRouter in SwiftUI Project in Xcode 12
- SwiftUI Navigation View - Handling Size Classes over multiple views
- Is there any way to create a new Gesture in SwiftUI?
- SwiftUI extension to display Image in Alert()
- Get changes on button tapped using Combine and SwiftUI
- Does `ShapeStyle` inherit from `View`?
- Nested transitions / animations in SwiftUI
- How do I set an image in a cell class from a ImagePicker Controller
- How to disable minimum value of 0 in Slider?
- SwiftUI NavigationView issue with Parent-Child-Grandchild scenario when attempting grandchild previous next navigation
- SwiftUI strange tabbar behaviour with groups
- Picker in SwiftUI 2 .onChange() does not change UINavigationBar.appearance()
- SwiftUI Change Form Background
- SwiftUI image picker, url image from camera
Related Questions in MACOS-CATALINA
- "command not found: mongod" error despite updating PATH
- Install Ruby development tools for gem installation on OSX Catalina
- AppleScript Quick Action Services Shortcut issue - MacOS Catalina
- Opening a text file with no xattr gives "Operation not permitted" under macOS Catalina and Python 2
- SSH tunnelling in Catalina to use Screen Sharing (VNC)
- Service running on macOS cannot access files on attached volumes
- I am trying to install ruby-2.2.3 through rbenv build on mac os catalina but getting the following error
- How to have a fully functioning NavigationView in a .fullSizeContent window with SwiftUI
- Go programs won't run after MacOS Catalina upgrade
- Mac keyboard Option key emulation
- WidgetPreviewContext is not working in a framework
- How do I install homebrew on macOS? Error: > -bash: $: command not found
- How do I Install Unity 2D Extras on MacOS?
- node.js dyld: initializer function 0x0 not in mapped image for /usr/local/bin/node Abort trap: 6
- Installing git on macOS with Homebrew Error
Related Questions in XCODE12
- Use ViewRouter in SwiftUI Project in Xcode 12
- "Spotlight quit unexpectedly" in MacOS Catalina version 10.15.4, This crash happening after I have installed Xcode 12
- Alamofire carthage update not working for Xcode 12 Simulator
- replace Tabbar with toolbar in SwiiftUI 2.0
- Since iOS 14, my app does not display images only when with the debugger or a device with iOS 13. Also, the keyboard won't show all keys
- Since Xcode 12 uitextfields of existing project has black background
- Crash in the execution of a queue glmtl.telemetry
- How to debug Widget Xcode 12
- Array cannot be inferred Error in Xcode 12 with Swift 5
- How should I use AudioFileStreamOpen Xcode 12
- Why the Resources direrctory is not visible on my project navigatior
- iOS Simulator is Crashing on startup
- SwiftUI HStack within a scroll view not showing images correctly
- Where is debug view hierarchy button in Xcode 12
- Xcode 12 - Download more simulators runtime is empty
Related Questions in WIDGETKIT
- Keychain Error -25308 (errSecInteractionNotAllowed) in macOS WidgetKit extension
- How can I check whether my shared code is running in a WidgetKit widget or full app?
- How to debug Widget Xcode 12
- How to retrieve widget sizes in app to make a preview of it depending on the device?
- How Can I Handle Tap Gesture on Widget?
- SwiftUI Widget DateStyle Custom Format
- Updating iOS 14 Home Widget from StaticConfiguration to IntentConfiguration
- How to use Link in WidgetKit to define arbitrary regions, not just text links?
- iOS14 Intents on small widget only
- How to customize placeholder looks in SwiftUI WidgetKit placeholder?
- iOS 14 Widget is flickering or frozen, chronod crashing
- How to display data from Core Data in WidgetKit
- SwiftUI and WidgetKit image alignment to the right
- WidgetKit not updating
- widgetURL in SwiftUI
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I fixed this because I guess some of the files I had open in the workspace wasn't part of the same target?
Anyways I fixed this error by closing all files I had open in Xcode except the SwiftUI Code.