firebase-ios-sdk
firebase-ios-sdk copied to clipboard
Cannot use Firebase with previews
Description
I am unable to see previews when using Firebase. The app builds correctly but previews don't work. Please see logs for more info.
Reproducing the issue
See logs.
Firebase SDK Version
11.4
Xcode Version
16.1
Installation Method
Swift Package Manager
Firebase Product(s)
Firestore
Targeted Platforms
macOS
Relevant Log Output
== PREVIEW UPDATE ERROR:
FailedToLaunchAppError: Failed to launch com.ReSchedule.ReSchedule
/***/Build/Products/Beta/ReSchedule.app
==================================
| [Remote] JITError
|
| ==================================
|
| | [Remote] CouldNotLoadInputStaticArchiveFile: Could not load static archive during preview: /***/Build/Products/Beta/FirebaseFirestoreInternal.framework/FirebaseFirestoreInternal
| |
| | path: /***/Build/Products/Beta/FirebaseFirestoreInternal.framework/FirebaseFirestoreInternal
| |
| | ==================================
| |
| | | [Remote] XOJITError
| | |
| | | XOJITError: '/***/Products/Beta/FirebaseFirestoreInternal.framework/FirebaseFirestoreInternal': Operation not permitted
== PREVIEW UPDATE ERROR:
FailedToLaunchAppError: Failed to launch com.ReSchedule.ReSchedule
/***/Build/Products/Beta/ReSchedule.app
==================================
| [Remote] JITError
|
| ==================================
|
| | [Remote] CouldNotLoadInputStaticArchiveFile: Could not load static archive during preview: /***/Build/Products/Beta/FirebaseFirestoreInternal.framework/FirebaseFirestoreInternal
| |
| | path: /***/Build/Products/Beta/FirebaseFirestoreInternal.framework/FirebaseFirestoreInternal
| |
| | ==================================
| |
| | | [Remote] XOJITError
| | |
| | | XOJITError: '/***/Build/Products/Beta/FirebaseFirestoreInternal.framework/FirebaseFirestoreInternal': Operation not permitted
== VERSION INFO:
Tools: 16B40
OS: 24B83
PID: 5387
Model: MacBook Pro
Arch: arm64e
== ENVIRONMENT:
openFiles = [
/***/Views/Start View/SurveyView.swift
]
wantsNewBuildSystem = true
newBuildSystemAvailable = true
activeScheme = Beta
activeRunDestination = My Mac variant macos arm64
workspaceArena = [x]
buildArena = [x]
buildableEntries = [
ReSchedule.app
]
runMode = JIT Executor
== SELECTED RUN DESTINATION:
macOS 15.1 | macos | arm64 | MacBook Pro | no proxy
== EXECUTION MODE OVERRIDES:
Workspace JIT mode user setting: true
Falling back to Dynamic Replacement: false
If using Swift Package Manager, the project's Package.resolved
Expand Package.resolved snippet
Replace this line with the contents of your Package.resolved.
If using CocoaPods, the project's Podfile.lock
Expand Podfile.lock snippet
Replace this line with the contents of your Podfile.lock!
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
This is likely related to https://github.com/firebase/firebase-ios-sdk/issues/14134 and https://github.com/firebase/firebase-ios-sdk/issues/13603. Using the legacy preview may be a workaround.
We've filed a feedback with Apple and will see if we can escalate.
The Xcode 16.2 release notes show multiple preview issue fixed. Is this one?
The Xcode 16.2 release notes show multiple preview issue fixed. Is this one?
I tried it - this is still an issue with Xcode 16.2.
Still happens, development is slowed as a result. bump
@vapidinfinity, which Xcode version and macOS version are you using?
Xcode Version 16.2 (16C5032a), macOS Sequoia 15.2 (24C101)
@girishw @vapidinfinity I recommend using Xcode 15.2 until it is fixed.
This issue persists with Xcode 16.2 and Firebase 11.7. It only occurs when I include the Firestore dependency in my Package.swift file:
.product(name: “FirebaseFirestore”, package: “firebase-ios-sdk”)
Same on Xcode Version Version 16.2 (16C5032a), macOS 15.0 (24A335)
I have a feedback ticked filed for this issue FB16477011. Feel free to cross reference it.
The Xcode 16.3 beta release notes list several fixes. https://developer.apple.com/documentation/xcode-release-notes/xcode-16_3-release-notes#Previews
Are folks still running into this issue on Xcode 16.3?
Hey @girishw. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
On Xcode 16.3, the situation is even worse than on 16.2. On 16.2 and earlier, the previews worked if you commented out Analytics.logEvent(_, _). On Xcode 16.3, the only thing that helps is completely removing Firebase from the project.
Thanks, @Sanych6666, I will try to get an update on the our Feedback ticket. Have you tried using the legacy preview engine as a workaround? See https://github.com/firebase/firebase-ios-sdk/issues/13603#issuecomment-2359828158
Hey @girishw. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
I’m encountering an Xcode preview error on macOS whenever I include the following frameworks:
- FirebaseAnalytics
- FirebaseAnalyticsOnDeviceConversion
- FirebaseAnalyticsWithoutAdIdSupport
If these are not filtered out (i.e., excluded from the build phase or from macOS targets), previews fail to launch. However, when running the app on an actual macOS device (rather than using previews), everything works correctly. Also, everything works fine on a real iOS device. Switching to the legacy preview engine does not resolve the issue.
Environment
- Xcode: 16.3
- Firebase: 11.11.0
- macOS: 15.4
Error Logs
== DATE:
Monday, April 14, 2025 at 20:34:18 Japan Standard Time
2025-04-14T11:34:18Z
== PREVIEW UPDATE ERROR:
FailedToLaunchAppError: Failed to launch com.app
/***/Build/Products/Debug/app.app
==================================
| [Remote] JITError
|
| ==================================
| | [Remote] CouldNotLoadInputStaticArchiveFile: Could not load static archive during preview: /***/Build/Products/Debug/FirebaseAnalytics.framework/FirebaseAnalytics
| |
| | path: /***/Build/Products/Debug/FirebaseAnalytics.framework/FirebaseAnalytics
| |
| | ==================================
| | | [Remote] XOJITError
| | |
| | | XOJITError: Universal binary /***/Build/Products/Debug/FirebaseAnalytics.framework/FirebaseAnalytics does not contain a slice for arm64e-apple-macosx21.1
...
== VERSION INFO:
Tools: 16E140
OS: 24E248
PID: 867
Additional Notes
- On a real macOS device (outside of previews) and on real iOS devices, these frameworks work without issues.
- The same error occurs whether or not I enable legacy previews.
- Please let me know if there’s a recommended workaround or if additional information is needed.
Update – still reproducible with Firebase 11.12.0
I’ve retested with the newest SDK and can confirm the preview failure remains unchanged.
Environment
- Xcode 16.3
- macOS 15.4
- Firebase 11.12.0 (via Swift Package Manager)
Behaviour
- Previews crash unless FirebaseAnalytics, FirebaseAnalyticsOnDeviceConversion, and FirebaseAnalyticsWithoutAdIdSupport are filtered out of the macOS target.
- The app still runs fine on a real macOS device and on iOS devices.
- Legacy previews do not help.
Latest preview log
== DATE:
Sunday, May 11, 2025 at 19:48:52 Japan Standard Time
2025-05-11T10:48:52Z
== PREVIEW UPDATE ERROR:
FailedToLaunchAppError: Failed to launch com.app
/***/Build/Products/Debug/app.app
==================================
| [Remote] JITError
|
| ==================================
|
| | [Remote] CouldNotLoadInputStaticArchiveFile: Could not load static archive during preview: /***/Build/Products/Debug/FirebaseAnalytics.framework/FirebaseAnalytics
| |
| | path: /***/Build/Products/Debug/FirebaseAnalytics.framework/FirebaseAnalytics
| |
| | ==================================
| |
| | | [Remote] XOJITError
| | |
| | | XOJITError: Universal binary /***/Build/Products/Debug/FirebaseAnalytics.framework/FirebaseAnalytics does not contain a slice for arm64e-apple-macosx21.1
== PREVIEW UPDATE ERROR:
FailedToLaunchAppError: Failed to launch com.app
/***/Build/Products/Debug/app.app
==================================
| [Remote] JITError
|
| ==================================
|
| | [Remote] CouldNotLoadInputStaticArchiveFile: Could not load static archive during preview: /***/Build/Products/Debug/FirebaseAnalytics.framework/FirebaseAnalytics
| |
| | path: /***/Build/Products/Debug/FirebaseAnalytics.framework/FirebaseAnalytics
| |
| | ==================================
| |
| | | [Remote] XOJITError
| | |
| | | XOJITError: Universal binary /***/Build/Products/Debug/FirebaseAnalytics.framework/FirebaseAnalytics does not contain a slice for arm64e-apple-macosx21.1
== VERSION INFO:
Tools: 16E140
OS: 24E263
PID: 990
Model: MacBook Pro
Arch: arm64e
== EXECUTION MODE PROPERTIES:
Automatically Refresh Previews: true
JIT Mode User Enabled: true
Falling back to Dynamic Replacement: false
== ENVIRONMENT:
openFiles = [
/Users/***/Views/CustomCSSView.swift
]
wantsNewBuildSystem = true
newBuildSystemAvailable = true
activeScheme = app
activeRunDestination = My Mac variant macos arm64
workspaceArena = [x]
buildArena = [x]
buildableEntries = [
app.app
]
runMode = JIT Executor
== SELECTED RUN DESTINATION:
macOS 15.4 | macos | arm64 | MacBook Pro | no proxy
== PACKAGE RESOLUTION ERRORS:
== POWER STATE LOGS:
2025/05/11, 19:44 Received power source state: Battery Powered (lowPowerMode: false, status: unplugged, level: 80%)
2025/05/11, 19:44 Broadcasting device power state: Mid Power
2025/05/11, 19:44 No device power state user override user default value.Current power state: Mid Power
Please let me know if any additional diagnostics would be useful.
Update – fixed in Firebase 11.13.0
I’ve upgraded the project to Firebase 11.13.0 via Swift Package Manager and can confirm that previews now work as expected on Xcode 16.3 / macOS 15.4. No need to exclude any FirebaseAnalytics frameworks, and I no longer have to fall back to legacy previews—everything runs with the standard preview engine.
Thanks to the Firebase team for the quick turnaround!