JournalingSuggestions Crashes on iOS 18 Simulator with Xcode 16.2 – Linker Error

I’m running into an issue while implementing JournalingSuggestions with Xcode 16.2 and the iOS 18 simulator. My code builds and runs fine on a physical device, but it consistently crashes on the simulator and in Xcode previews. I’ve tried several workarounds, including weak linking and solutions from this post (746843), but I’m still hitting a wall.
Here’s what’s happening:
I get a warning: JournalingSuggestions is not available when building for iOS Simulator.

This is followed by a build error: Linker command failed with exit code 1 (use -v to see invocation).

What I’ve Tried: Weak linking the JournalingSuggestions framework.

Applying fixes from this post (746843), such as cleaning the build folder and using weak link.

Deleting Derived Data and rebuilding.

Testing on a physical device (works fine).

My Setup: Xcode Version: 16.2

Simulator: iOS 18

Build Success: Works on physical device, fails on simulator/preview

Code:

#if canImport(JournalingSuggestions)

import JournalingSuggestions

#endif



...



  var suggestionButton: some View {

      #if canImport(JournalingSuggestions)

          #if !targetEnvironment(simulator)

              if #available(iOS 17.2, *) {

                  return AnyView(journalingSuggestionsPickerButton)

              }

          #endif

          return AnyView(disabledSuggestionButton)

      #else

          return AnyView(disabledSuggestionButton)

      #endif

  }
Answered by DTS Engineer in 828363022

Journaling Suggestions is an ongoing source of ‘fun’ when it comes to building an app for all environments. See this thread.

Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Journaling Suggestions is an ongoing source of ‘fun’ when it comes to building an app for all environments. See this thread.

Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"